BUILD-11444 Replace decision file gate with CI_METRICS_ENABLED env var#286
BUILD-11444 Replace decision file gate with CI_METRICS_ENABLED env var#286julien-carsique-sonarsource wants to merge 1 commit into
Conversation
The post-job completion hook no longer checks for the presence of
${CI_METRICS_DIR}/enabled. It now reads $CI_METRICS_ENABLED which is
written to $GITHUB_ENV by the pre-job hook (job-started.sh).
Companion changes in github-runners-infra, ci-ami-images, and gh-action_cache.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Review ✅ ApprovedReplaces the file-based metrics gate with the CI_METRICS_ENABLED environment variable to eliminate redundant state tracking. No issues found. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
There was a problem hiding this comment.
Pull request overview
This PR updates the CI metrics post-job hook (ci-metrics/job-completed.sh) to use a single feature-flag source of truth: the CI_METRICS_ENABLED environment variable (written via $GITHUB_ENV by the pre-job hook), replacing the previous presence-only gate file check under ${CI_METRICS_DIR}/enabled. This reduces the risk of stale gate files on persistent runners and removes the dual-source-of-truth behavior.
Changes:
- Remove the
${CI_METRICS_DIR}/enabledfile presence gate. - Gate metrics collection on
CI_METRICS_ENABLED == "true"and improve skip logging with the observed value.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Summary
Replaces the presence-only file gate in the WarpBuild
job-completed.shhook:${CI_METRICS_DIR}/enabledpresence check.$CI_METRICS_ENABLEDdirectly — set by the pre-job hook via$GITHUB_ENV.Why: eliminates the dual-source-of-truth (env var + file) and the stale-file risk on persistent runners.
Companion PRs
github-runners-infra— PR #416: pre-job hook writes to$GITHUB_ENV; post-job hook reads env var; test updated.ci-ami-images— same gate replacement in WarpBuildjob-started.shgh-action_cache— drops "Resolve CI metrics gate" step; simplifiescache-metrics-prepif:Test plan