fix(release): run own-repo finalize from the source-built cascade binary - #497
Conversation
Cascade's own-repo orchestrate finalize installed cascade via a pinned setup-cli release (v0.8.0) whose binary predates --tag-only, so every rc cut failed at the Manage Release step with 'unknown flag: --tag-only'. No published cascade carries --tag-only yet, so bumping the pin cannot fix it. Own-repo finalize now runs the binary built from the exact commit under release: the build-cli callback uploads its from-source binary as a cascade-cli artifact, and finalize downloads it onto PATH for the changelog and manage-release steps (falling back to the pinned install when build-cli was skipped). Cascade self-hosts, so a new CLI capability must be available in the same run that ships it. Scoped to own-repo generation only; downstream user output is unchanged. Regenerated the committed orchestrate.yaml and extended scenarios 46/47. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Scenario 47's added regression check asserted the literal
'stablekernel/cascade/.github/actions/setup-cli@' substring in
generated orchestrate.yaml, but the e2e harness's localizeWorkflows
step unconditionally rewrites every such reference to a local
'./.github/actions/X' path for ALL scenarios before assertions run
(harness.go's actionLocalizeSedExpr). That substring can never survive
localization, so the assertion was always going to fail regardless of
generator behavior; it was not a real regression in plain (non-own-repo)
finalize output.
Verified the real generator output is unaffected: a direct
'cascade generate-workflow' diff between origin/main's binary and this
branch's, for the same plain manifest, is byte-for-byte identical.
Replaced the assertion with localization-safe checks: the Setup CLI
step's presence, and the absence of the own-repo-only build-cli if-gate
('needs.build-cli.result') and from-source download lines. Scenarios
46 and 47 now pass against the real act+gitea harness.
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
|
E2E shard 4 failure investigated and fixed (pushed d52b207). Root cause: not a generator regression. Scenario 47's added assertion checked for the literal substring `stablekernel/cascade/.github/actions/setup-cli@` in the generated orchestrate.yaml, but the e2e harness's `localizeWorkflows` step (e2e/harness/harness.go) unconditionally rewrites every such reference to a local `./.github/actions/X` path for every scenario, before any assertion runs. That substring can never survive localization, so the check could never pass regardless of what the generator emits. Proved the real generator output is unaffected: built origin/main's binary and this branch's binary, generated plain (non-own-repo) orchestrate.yaml from the identical manifest with each, and diffed them byte-for-byte identical. Fixed scenario 47 to assert the Setup CLI step's presence plus the absence of the own-repo-only build-cli if-gate and from-source download lines (localization-safe). Reran scenarios 46 and 47 against the real act+gitea harness locally: both pass. Full inner loop (build, test, race on internal/generate, golangci-lint, e2e build/vet) is green, `cascade verify --own-repo` is clean, and the downstream byte-diff against origin/main is still empty. |
The break
Cascade's own-repo generated `orchestrate.yaml` finalize job installed cascade via a pinned `setup-cli@... # v0.8.0`. Its `Manage Release` step now runs `cascade manage-release ... --tag-only`, but the v0.8.0 binary predates `--tag-only`, so every rc cut failed at finalize with `Error: unknown flag: --tag-only`. No published cascade carries `--tag-only` (it is unreleased), so bumping the pin cannot fix it.
The fix
Own-repo finalize now runs the binary built from the exact commit under release instead of a stale pin. The finalize job already depends on the `build-cli` callback, which compiles cascade from source. That callback now uploads its binary as a `cascade-cli` artifact (via the pinned `actions/upload-artifact`), and own-repo finalize downloads it onto `PATH` for the changelog and `manage-release` steps. The download is gated on `build-cli` succeeding; when that callback is skipped, finalize falls back to the pinned `setup-cli` install so the changelog step still finds cascade on `PATH`. Cascade is self-hosting, so a new CLI capability must be usable in the same run that ships it.
Scope
Gated entirely on the existing own-repo generation path (`WithOwnRepoRelease()` / the `--own-repo` flag). Downstream (user) orchestrate output stays byte-identical to `main`: users install a pinned released cascade through `setup-cli` and never build from source. Proven by an empty `git diff origin/main` on `internal/generate/promote.go`, `.github/workflows/promote.yaml`, and the `manage-release` action, plus the plain-generation regression test and scenario 47.
How the binary is sourced
Reused the existing `build-cli` from-source build (added a `cascade-cli` artifact upload) rather than a duplicate `go build` in finalize.
Verification
Re-validated on a real rc after merge: one Release run, one fleet run, zero orphan drafts, finalize `--tag-only` works.