Skip to content

ci(release): publish preflight and CI trigger fixes (M3, #922) - #1067

Merged
rita7lopes merged 4 commits into
metrico:masterfrom
Guess-Who-sec:ci/m3-publish-preflight
Nov 24, 2026
Merged

rita7lopes merged 4 commits into
metrico:masterfrom
Guess-Who-sec:ci/m3-publish-preflight

Conversation

@Guess-Who-sec

@Guess-Who-sec Guess-Who-sec commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Part of #922 (M3). This is the "do now, separately" half from @rita7lopes's comment on #922: the publish preflight and the two CI trigger fixes.

Still open in #922 after this: the PromQL parity harness, baseline ratchet and triage, the release-gate skeleton, and the k6 lane fix.

No dependencies: branches from master.

Why

On the commit behind the latest release, v5.6.0 (9b45a1bb), these workflows ran: CodeQL, Gigapipe CI Cluster, K6, and the release itself. Go Build CI (unit tests) never ran, because it only triggers on pull requests. And build_release.yml publishes without checking anything.

Changes

  • build_release.yml: new first job, Publish preflight. It resolves the commit being released (git rev-parse HEAD after the same checkout the other jobs use: the tag for a release, the branch tip for a manual run) and runs .github/scripts/publish-preflight.sh. validate_module_path now needs: preflight, and every build job already needs validate_module_path, so nothing builds or publishes unless the preflight passes. The job only gets actions: read and contents: read.
  • .github/scripts/publish-preflight.sh (new): for each lane in PUBLISH_REQUIRED_LANES, the most recent run of that workflow on the commit must be completed / success. A missing run, any other conclusion, or an empty list refuses the release immediately, and every failing lane is named with a link to its run. A lane that is still running is waited for: it's checked every 30 s, for up to 30 minutes (PREFLIGHT_POLL_SECONDS / PREFLIGHT_WAIT_SECONDS), then the release is refused if it still hasn't finished. Releases are usually created right after a merge, while that merge's lanes are still running. For v5.6.0, the release started at 13:36:24 and the cluster lane on the same commit finished at 13:38:56, so without waiting it would have been refused for no real reason.
  • PUBLISH_REQUIRED_LANES = Go Build CI, Gigapipe CI Cluster. It's set in the workflow file, so changing it is a reviewed PR. k6 stays informational, as M3 — PromQL parity harness + release-gate skeleton + publish preflight #922 says. CodeQL is left out as a security scan rather than a test lane; adding it is one line.
  • go.yml: also runs on push to master, so unit tests run on the merged commit and the preflight has a result to check.
  • node-clickhouse-cluster.js.yml: drops '**.yml' from both paths-ignore lists, so edits to workflows or compose files run the cluster lane. .md and .yaml are unchanged.

Why workflow names rather than check-run (job) names: job names aren't unique. On PR #1050's head commit there are two check-runs called build, one from Go Build CI and one from Gigapipe CI Cluster. Workflow names are unique, so they can be matched directly without renaming any job.

Tests

Every case below was run against real commits. The script was run locally with gh against metrico/gigapipe:

Commit Lanes Result
9b45a1bb (v5.6.0) Go Build CI, Gigapipe CI Cluster refused: "Go Build CI" has no run
9b45a1bb (v5.6.0) Gigapipe CI Cluster, CodeQL passed
a9475eba (master, cluster lane failed; the workflow was named "QRYN CI CLUSTER" then) QRYN CI CLUSTER, CodeQL refused: did not pass (conclusion=failure) + run link
4806162a (PR #1050 head, both lanes green) Go Build CI, Gigapipe CI Cluster passed
any empty list refused: no lanes configured

Waiting for a running lane: I started K6 by hand on the fork on this branch's commit (run), then pointed the script at it while it was running:

Setting Result
40 s limit, 10 s polling waited, then refused: required lanes still running after 40s
defaults (30 min, 30 s) waited ~3 min; K6 finished at 23:49:15, preflight passed at 23:49:27

On GitHub (fork): I started "CI+CD Gigapipe" by hand on this branch (run). The preflight failed and named both missing lanes. Validate, arm64, amd64 and Docker were all skipped: nothing was built or published.

Static checks:

  • actionlint v1.7.7: no new findings. The existing findings in build_release.yml are unchanged, only shifted down by the new job.
  • shellcheck v0.10.0 on the script: clean.

Not tested: a passing preflight on GitHub. That would continue into the publish jobs, so I only tested the passing path locally against real commits.

Potential risks

  • A release created right after a merge now starts building a few minutes later, while the preflight waits for that merge's lanes to finish. During the wait, the preflight job occupies one runner.
  • A lane stuck for more than 30 minutes refuses the release. Fix: re-run the release workflow once the lane has finished.
  • Renaming a lane's workflow requires updating PUBLISH_REQUIRED_LANES. Otherwise releases are refused (it fails closed, never open). This already happened once: "QRYN CI CLUSTER" → "Gigapipe CI Cluster".
  • A commit that only changes .md files doesn't run the cluster lane (its paths-ignore still has **.md), so releasing exactly that commit is refused.
  • Manual runs (workflow_dispatch) check the branch tip at the moment the preflight runs. If something merges while the build jobs are starting, they could build a newer commit. Releases from a tag aren't affected, and the last 40 runs of this workflow were all release events.
  • Go Build CI now also runs on every push to master, one extra run per merge.
  • Overlap with chore(ci): M1 tooling groundwork and deterministic PromQL substitute names (#918) #1059 (M1): this PR makes go.yml run on pushes, and M1 adds a lint job to go.yml. M1's lint originally used github.event.pull_request.base.sha, which is empty on a push. Lint then failed on every pre-existing issue (reproduced locally), which would have turned Go Build CI red on master and made this preflight refuse every release. chore(ci): M1 tooling groundwork and deterministic PromQL substitute names (#918) #1059 now falls back to github.event.before, so nothing further is needed here, in either merge order.

Not in this PR

The publish steps' if: github.event_name == 'release' || ${{ inputs.release }} is flagged by actionlint as "always evaluated to true". It's pre-existing, so I left it untouched here.

- build_release.yml: a first "Publish preflight" job refuses to publish
  unless every workflow in PUBLISH_REQUIRED_LANES (Go Build CI, Gigapipe CI
  Cluster) passed on the commit being released. Lanes are matched by
  workflow name because job names are not unique (two jobs are "build").
- go.yml: also run on pushes to master, so unit tests run on the merged
  commit and the preflight has a result to check.
- node-clickhouse-cluster.js.yml: stop ignoring '**.yml' changes, so
  workflow and compose edits run the cluster lane.
Releases are usually created right after a merge, while that merge's lanes
are still running: v5.6.0 started at 13:36:24 and the cluster lane on the
same commit finished at 13:38:56. Instead of refusing a lane that has not
finished, check it again every PREFLIGHT_POLL_SECONDS (30) for up to
PREFLIGHT_WAIT_SECONDS (1800). A missing or failed lane still refuses at
once.
A lane with no run, cancelled, skipped or still running after the wait,
and a GitHub API error, are now warnings. Refusing those blocked releases
from a docs or workflow-only commit and hotfixes from a branch, and left
a public release with no binaries or image.

Keep '**.yml' in the cluster lane's paths-ignore, and use the same
actions/checkout version as the rest of the workflow.

@rita7lopes rita7lopes 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.

I changed my mind on two things I asked for in #922, so I pushed the changes myself: the cluster lane keeps ignoring .yml, and the preflight refuses only when a lane failed or timed out. Anything else is a warning, so docs-only commits and hotfixes from a branch can still be released. #1113 is built on this, so it will need the same rule.

Merging

@rita7lopes
rita7lopes merged commit b7c4210 into metrico:master Nov 24, 2026
10 checks passed
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