Skip to content

BUILD-11444 Replace decision file gate with CI_METRICS_ENABLED env var#286

Open
julien-carsique-sonarsource wants to merge 1 commit into
masterfrom
feat/jcarsique/BUILD-11444-github-env-gate
Open

BUILD-11444 Replace decision file gate with CI_METRICS_ENABLED env var#286
julien-carsique-sonarsource wants to merge 1 commit into
masterfrom
feat/jcarsique/BUILD-11444-github-env-gate

Conversation

@julien-carsique-sonarsource
Copy link
Copy Markdown
Contributor

Summary

Replaces the presence-only file gate in the WarpBuild job-completed.sh hook:

  • Removes ${CI_METRICS_DIR}/enabled presence check.
  • Reads $CI_METRICS_ENABLED directly — 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-infraPR #416: pre-job hook writes to $GITHUB_ENV; post-job hook reads env var; test updated.
  • ci-ami-images — same gate replacement in WarpBuild job-started.sh
  • gh-action_cache — drops "Resolve CI metrics gate" step; simplifies cache-metrics-prep if:

Test plan

  • Deployed to dev runner and validated on sonar-dummy E2E workflow (before merging)

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>
@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented Jun 5, 2026

BUILD-11444

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 5, 2026

Code Review ✅ Approved

Replaces the file-based metrics gate with the CI_METRICS_ENABLED environment variable to eliminate redundant state tracking. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

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 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}/enabled file 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.

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