ci(env-cache): fail fast, add --fix, fix e2e-only hook regex#10413
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bundles three CI/dev-tooling improvements: speeding up the env-cache sync check by removing its dependency on the full setup_harmony build, adding a --fix mode to automatically update stale CircleCI cache keys to match .bitmap, and adjusting the e2e .only-guard regex.
Changes:
- Make
check_env_cache_syncrun fail-fast by usingcheckoutinstead ofattach_workspace, and removing therequires: setup_harmonyworkflow dependency. - Extend
scripts/check-env-cache-sync.shwith--fixto rewritecore-aspect-envcache keys while preserving each key’s cache-bust-v<n>suffix and improving failure output. - Update
.claude/hooks/check-e2e-only.shto detect.onlymarkers in both column-0 and indented added lines.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/check-env-cache-sync.sh |
Adds --fix support and improves diagnostics when .bitmap and CircleCI cache keys diverge. |
.claude/hooks/check-e2e-only.sh |
Updates the diff-scanning regex used to permit running e2e tests only when .only markers exist. |
.circleci/config.yml |
Makes the env-cache sync job independent of setup_harmony so it can fail quickly. |
GiladShoham
approved these changes
Jun 10, 2026
Comment on lines
+45
to
+49
| if grep -qE "$CACHE_KEY_PATTERN" "$CONFIG_FILE"; then | ||
| FOUND_KEY=$(grep -oE "core-aspect-env-v${CORE_ASPECT_ENV_VERSION}-v[0-9]+" "$CONFIG_FILE" | head -1) | ||
| echo -e "${GREEN}✓ Cache key matches: $FOUND_KEY${NC}" | ||
| exit 0 | ||
| else | ||
| echo -e "${RED}✗ ERROR: Cache key mismatch!${NC}" | ||
| echo -e "${YELLOW}Expected cache key pattern: core-aspect-env-v${CORE_ASPECT_ENV_VERSION}-v*${NC}" | ||
| echo "" | ||
| echo "Current cache keys in .circleci/config.yml:" | ||
| grep -oE 'core-aspect-env-v[0-9.]+-v[0-9]+' .circleci/config.yml | sort -u | ||
| echo "" | ||
| echo -e "${RED}When upgrading envs, you must update the cache keys in .circleci/config.yml${NC}" | ||
| echo "Please update all instances of 'core-aspect-env-v*' to match the version in .bitmap" | ||
| fi |
| # 2. Untracked new files (e.g. a bug-repro test Claude just created but | ||
| # hasn't `git add`'d yet) via `git ls-files --others --exclude-standard`. | ||
| if git diff HEAD -- 'e2e/' 2>/dev/null | grep -qE '^\+[^+].*(describe|context|it)\.only\b'; then | ||
| if git diff HEAD -- 'e2e/' 2>/dev/null | grep -vE '^\+\+\+ ' | grep -qE '^\+.*\b(describe|context|it)\.only\b'; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small, independent fixes bundled together.
check_env_cache_syncruns fail-fast — switched the job fromattach_workspace(which waited on the fullsetup_harmonybuild) to a plaincheckout, and dropped itsrequires: setup_harmonyin the workflow. It only reads.bitmapand.circleci/config.yml, so it now runs and fails within seconds instead of after the whole build.scripts/check-env-cache-sync.sh --fix— when an env-update PR leaves the CircleCI cache keys stale,--fixrewrites only the version segment of everycore-aspect-env-v*-v*key and always preserves each key's-v<n>cache-bust suffix, so the "bumped the version but dropped the-v1" mistake is no longer possible. On failure (no--fix) the error now prints the stale keys and the exact command to run..claude/hooks/check-e2e-only.shregex —^\+[^+]...consumed thedof column-0+describe.only(lines, so top-level.onlymarkers were wrongly rejected. Changed to^\+.*\b(describe|context|it)\.only\b, which matches both column-0 and indented markers and still skips+++diff headers.