BUILD-11444 Drop Resolve CI metrics gate step; read CI_METRICS_ENABLED directly#81
Conversation
…D directly
The pre-job hook now writes CI_METRICS_ENABLED=<true|false> to $GITHUB_ENV,
so the action no longer needs to read/write ${CI_METRICS_DIR}/enabled to
communicate the decision to the post-job hook.
- Remove the "Resolve CI metrics gate" step entirely (37 lines)
- Change cache-metrics-prep `if:` from `steps.ci-metrics-gate.outputs.decision == 'true'`
to `env.CI_METRICS_ENABLED == 'true'`
Companion changes: github-runners-infra PR #416, ci-github-actions PR #286,
ci-ami-images PR #384.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
CI failed: The CI failures were caused by the removal of the 'Resolve CI metrics gate' step, which left downstream test and validation scripts unable to find expected outputs like 'cache-size-bytes' or properly honor the 'CI_METRICS_ENABLED' flag.OverviewThree distinct test and build failures occurred across the suite, all directly resulting from the removal of the 'Resolve CI metrics gate' step in FailuresMissing 'cache-size-bytes' output (confidence: high)
Metrics gate not honoring opt-out (confidence: high)
Metrics decision file test failure (confidence: high)
Summary
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsSimplifies CI metrics gating by reading CI_METRICS_ENABLED directly from the environment instead of a file. Please update the README to reflect the removal of the file-based metrics gate. 💡 Quality: README still documents the dropped file-based metrics gateThis PR removes the
This leaves the docs contradicting actual behavior, which can mislead workflow authors (e.g. expecting that touching 🤖 Prompt for agentsTip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
| - name: Prepare local cache-metrics sub-action | ||
| id: cache-metrics-prep | ||
| if: steps.ci-metrics-gate.outputs.decision == 'true' | ||
| if: env.CI_METRICS_ENABLED == 'true' |
There was a problem hiding this comment.
💡 Quality: README still documents the dropped file-based metrics gate
This PR removes the Resolve CI metrics gate step and changes cache-metrics-prep to gate purely on env.CI_METRICS_ENABLED == 'true', with the runner pre-job hook now writing CI_METRICS_ENABLED to $GITHUB_ENV. The README's ### Pipeline runtime metrics / **Gate resolution** section still describes the old behavior that no longer exists in the action:
- Item 3 ("Otherwise, on iff
${CI_METRICS_DIR}/enabledexists") — the action no longer reads this decision file; the gate is now env-only. - The paragraph stating the action "propagates the workflow
CI_METRICS_ENABLEDoverride to the same file (touch on 'true', remove on 'false')" — that propagation step was deleted. - The
CI_METRICS_DIRenv table row still says the directory holds "the runner-side decision file (enabled)";CI_METRICS_DIRis now only used for the per-invocationcache-*.jsonfiles.
This leaves the docs contradicting actual behavior, which can mislead workflow authors (e.g. expecting that touching ${CI_METRICS_DIR}/enabled enables metrics). Update the Gate resolution section to reflect that the gate is now simply CI_METRICS_ENABLED (set directly or via the runner hook writing to $GITHUB_ENV), and drop the decision-file and propagation language.
Was this helpful? React with 👍 / 👎



Summary
The pre-job runner hook now writes
CI_METRICS_ENABLED=<true|false>to$GITHUB_ENV. This action no longer needs to read/write${CI_METRICS_DIR}/enabledto communicate the decision between the pre-job hook, workflow steps, and post-job hook.Changes:
Resolve CI metrics gatestep (37 lines dropped)cache-metrics-prepif:fromsteps.ci-metrics-gate.outputs.decision == 'true'→env.CI_METRICS_ENABLED == 'true'CI_METRICS_DIRis still used by thecache-metricssub-action for writingcache-*.jsonfilesWhy: eliminates the dual-source-of-truth problem (env var + file) and the risk of a stale
enabledfile from a previous job on the same runner. Simpler, fewer moving parts.Companion PRs
github-runners-infra— PR #416: hooks write to / read from$GITHUB_ENVci-github-actions— PR #286: same gate replacement inci-metrics/job-completed.shci-ami-images— PR #384: WarpBuildjob-started.sh+ promote summaryTest plan
ci-github-actions/cache@<this-branch>(temp PR)cache-*.jsonfiles still emitted whenCI_METRICS_ENABLED=true