Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

The workflow mixes inputs.cache_buster with github.event.inputs.* for accessing workflow_dispatch inputs. Both work, but inconsistency hurts maintainability.

Changes

  • Unified input access to use github.event.inputs.cache_buster pattern, matching existing usage for backend_ref and frontend_ref
# Before
CACHE_BUSTER: ${{ inputs.cache_buster || '' }}

# After  
CACHE_BUSTER: ${{ github.event.inputs.cache_buster || '' }}

Note: The cache mechanism and cache buster functionality are correct—this is purely a consistency fix.

Original prompt

当前build.yml中的缓存机制是否存在问题?Cache buster是否有效?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Change CACHE_BUSTER from inputs.cache_buster to github.event.inputs.cache_buster
to match the pattern used elsewhere in the workflow file.

Co-authored-by: Nativu5 <[email protected]>
Copilot AI changed the title [WIP] Investigate cache mechanism in build.yml Fix inconsistent inputs access pattern in build.yaml Nov 28, 2025
Copilot AI requested a review from Nativu5 November 28, 2025 03:07
@Nativu5
Copy link
Collaborator

Nativu5 commented Nov 28, 2025

@copilot Cache buster在指纹计算和缓存查找中被使用并生效了吗?

Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot Cache buster在指纹计算和缓存查找中被使用并生效了吗?

是的,cache buster 在指纹计算和缓存查找中被正确使用并生效:

  1. 指纹计算 (第194行): FINGERPRINT="${CRANE_SHA}-${FE_REF}-${FE_SHA}-${CI_DIGEST}-${CACHE_BUSTER}" - CACHE_BUSTER 作为指纹组成部分

  2. 缓存键生成 (第196行): KEY_SHA256=$(printf '%s' "$FINGERPRINT" | sha256sum) - 指纹被哈希为缓存键

  3. 缓存路径 (第197-198行): CACHE_TGZ="${LOCAL_CACHE_DIR}/${KEY_SHA256}.tar.gz" - 缓存文件使用此键定位

当提供非空的 cache_buster 时,会产生不同的 KEY_SHA256,导致缓存未命中(第225行的 if [ -f "${CACHE_TGZ}" ] 检查失败),从而触发重新构建。

@Nativu5 Nativu5 closed this Nov 28, 2025
@Nativu5 Nativu5 deleted the copilot/check-cache-mechanism branch November 28, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants