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

@julien-carsique-sonarsource julien-carsique-sonarsource commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Keep ci-metrics/job-completed.sh in sync with the source of truth in github-runners-infra PR #416.

Merge order

Deploy after SonarSource/github-runners-infra#416 and SonarSource/ci-ami-images#384 are deployed to prod runners.

@hashicorp-vault-sonar-prod

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

Copy link
Copy Markdown

BUILD-11444

Copilot AI left a comment

Copy link
Copy Markdown

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.

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>
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/jcarsique/BUILD-11444-github-env-gate branch from ce27b2b to 6670636 Compare June 8, 2026 17:32
@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as ready for review June 8, 2026 17:32
@gitar-bot

gitar-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Replaces the decision file gate with the CI_METRICS_ENABLED environment variable to align with the infrastructure source of truth. 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

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

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