Skip to content

ci: convert release pipeline to dispatcher + tag-dispatched validators#4072

Draft
sydorovdmytro wants to merge 3 commits into
mainfrom
dmytrosydorov/devops-1050-release-dispatch-main
Draft

ci: convert release pipeline to dispatcher + tag-dispatched validators#4072
sydorovdmytro wants to merge 3 commits into
mainfrom
dmytrosydorov/devops-1050-release-dispatch-main

Conversation

@sydorovdmytro

@sydorovdmytro sydorovdmytro commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reference conversion for DEVOPS-1050 phase 4 (loft-sh/vcluster main). Draft.

Builder (release.yaml)

  • on: release:[created]on: workflow_dispatch. The GitHub Release is a pipeline output (goreleaser creates it at the end of a green build), dispatched by the shared vcluster-release action via gh workflow run release.yaml --ref <tag>. Nothing listens on release:created, closing the DEVOPS-1013 re-trigger gap.
  • Decoupled github.event.release.*github.ref_name; branch-local previous_tag.
  • New trigger-validators job: on a green, non--next build it dispatches each validator at the built tag (gh workflow run <wf> --ref <tag>, GITHUB_TOKEN + actions: write), guarded so a missing validator warns instead of failing.

Validators (e2e.yaml, e2e-ginkgo.yaml, unit-tests.yaml)

  • on: workflow_dispatch (+ pull_request). unit-tests gains a workflow_dispatch trigger so it is dispatchable at the tag.
  • Dispatched with --ref <tag>, so each validator runs its own tag's version against the tag's code — glue and code both from the release line (no main-branch drift).
  • detect_changes stays PR-only; the release path (workflow_dispatch) runs the full suite. e2e-ginkgo resolves the release label filter when github.ref is a tag.

Why dispatch, not workflow_run

workflow_run is a privileged trigger; checking out the built tag under it tripped CodeQL “untrusted checkout in a privileged context” (3 critical + 2 high). workflow_dispatch is a trusted trigger — no untrusted-checkout finding, no alert dismissals — and it lets each validator run the tag's own version rather than main's.

Legacy vs new lines

Only main/new-line (>= v0.37) builders carry trigger-validators, so legacy lines (v0.31v0.35, builder-only PRs) get no post-build validation — matching current behavior. A validator and its dispatch entry travel together per branch, so a v0.37 branch cut from main has everything it needs.

Actionlint-clean; release-as-output + dispatch flow proven on the throwaway fixtures. Draft until the GitHub Actions incident clears and CI can run.

Builder release.yaml becomes workflow_dispatch-only (release-as-output):
goreleaser creates the GitHub release at the end of a green build, so a
monorepo-created OSS release can no longer re-trigger this builder (closes the
DEVOPS-1013 gap). Decouples check_minimum_version_tag/notify_failure from
github.event.release.*, derives the version from the dispatched tag, and fixes
previous_tag to be branch-local.

Validators (e2e, e2e-ginkgo, unit-tests) move from release:created to
on: workflow_run keyed on the "Release" builder completing - release:created
does not fire for builder-created releases inside Actions. On that path
detect_changes is bypassed and the full suite runs against the built tag
(github.event.workflow_run.head_branch).

Related to DEVOPS-1050
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

E2E Ginkgo Tests

Status Commit Run
Passed 6be1a4e25e0fc6f276ea0245f4dd9475ea5c4817 View run #29258923211

…-1050)

main is the only validator copy that fires on workflow_run, so without a gate it
would also validate legacy (< v0.37) releases against the newer main test
orchestration (drift risk). release_line_gate restricts the workflow_run path to
new lines; legacy lines are builder-only, matching current behavior. PR path
unchanged.
…run (DEVOPS-1050)

The release builder now dispatches each validator via
`gh workflow run <wf> --ref <tag>`, so every validator runs its OWN
version at the built tag rather than being triggered by a workflow_run on
the "Release" builder completing.

workflow_dispatch is a trusted trigger, so a plain checkout of the tag is
correct and this clears the CodeQL "untrusted checkout in privileged
context" alerts that the workflow_run + `ref: head_branch` model raised.

- e2e.yaml, e2e-ginkgo.yaml, unit-tests.yaml: drop the workflow_run trigger
  and the release_line_gate job; the builder only dispatches new release
  lines, so the gate is no longer needed. Job `if:` conditions now take the
  release path via `github.event_name == 'workflow_dispatch'`, and the
  `ref: head_branch` checkout overrides are removed (a --ref <tag> dispatch
  already sets github.ref to the tag).
- unit-tests.yaml gains a bare workflow_dispatch trigger so the builder can
  dispatch it at the tag.
- e2e-ginkgo.yaml resolves the release label filter from
  startsWith(github.ref, 'refs/tags/') instead of the workflow_run event.
- release.yaml gains a trigger-validators job that dispatches the three
  validators at the built tag once publish succeeds (skipping -next).
@sydorovdmytro sydorovdmytro changed the title ci: convert release pipeline to dispatch + workflow_run (DEVOPS-1050) ci: convert release pipeline to dispatch + workflow_run Jul 13, 2026
@sydorovdmytro sydorovdmytro changed the title ci: convert release pipeline to dispatch + workflow_run ci: convert release pipeline to dispatcher + tag-dispatched validators Jul 14, 2026
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.

1 participant