Skip to content

ci(env-cache): fail fast, add --fix, fix e2e-only hook regex#10413

Merged
davidfirst merged 5 commits into
masterfrom
ci-env-cache-sync-improvements
Jun 10, 2026
Merged

ci(env-cache): fail fast, add --fix, fix e2e-only hook regex#10413
davidfirst merged 5 commits into
masterfrom
ci-env-cache-sync-improvements

Conversation

@davidfirst

Copy link
Copy Markdown
Member

Three small, independent fixes bundled together.

check_env_cache_sync runs fail-fast — switched the job from attach_workspace (which waited on the full setup_harmony build) to a plain checkout, and dropped its requires: setup_harmony in the workflow. It only reads .bitmap and .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, --fix rewrites only the version segment of every core-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.sh regex^\+[^+]... consumed the d of column-0 +describe.only( lines, so top-level .only markers were wrongly rejected. Changed to ^\+.*\b(describe|context|it)\.only\b, which matches both column-0 and indented markers and still skips +++ diff headers.

Copilot AI review requested due to automatic review settings June 10, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_sync run fail-fast by using checkout instead of attach_workspace, and removing the requires: setup_harmony workflow dependency.
  • Extend scripts/check-env-cache-sync.sh with --fix to rewrite core-aspect-env cache keys while preserving each key’s cache-bust -v<n> suffix and improving failure output.
  • Update .claude/hooks/check-e2e-only.sh to detect .only markers 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.

Comment thread .claude/hooks/check-e2e-only.sh Outdated
Copilot AI review requested due to automatic review settings June 10, 2026 13:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread scripts/check-env-cache-sync.sh Outdated
Copilot AI review requested due to automatic review settings June 10, 2026 15:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

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
@davidfirst davidfirst merged commit 71d4dad into master Jun 10, 2026
12 of 13 checks passed
@davidfirst davidfirst deleted the ci-env-cache-sync-improvements branch June 10, 2026 15:48
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.

3 participants