Skip to content

F14.2 — Pipeline hardening

State Closed
Parent E14
Iteration Release 2
Start Date 2026-10-02
Closed Date 2026-10-03
Predecessors F14.1 (the discovered main.yml and workspace_ci.py this feature changes)

Stories: 8 Closed

Story State Depends on
S14.2.1 — Pin every action Closed (2026-10-02) —
S14.2.2 — Composite setup action Closed (2026-10-02) —
S14.2.3 — Plan from the last successful run Closed (2026-10-03) —
S14.2.4 — Concurrency Closed (2026-10-02) —
S14.2.5 — The release is the record Closed (2026-10-03) —
S14.2.6 — Sonar: guard and gate Closed (2026-10-03) —
S14.2.7 — Timeouts and Dependabot Closed (2026-10-03) —
S14.2.8 — Runbook and handoff Closed (2026-10-03) —

F14.1 made the pipeline generic. This feature makes it safe to run unattended and to copy as a template. Each change applies one of these rules:

  1. The published release is the record. A package version is shipped when its GitHub Release is published with its assets. A tag alone does not count, and a rerun finishes a half-done release.
  2. Every change is planned exactly once. A package's change is verified and released even when the run for its commit was superseded, failed, or its base was rewritten.
  3. Pinned, bounded, cancellable. Every third-party action is pinned to a commit SHA; every job has a timeout; superseded pull-request runs are cancelled, and pushes to main never are.
  4. A failed quality gate fails CI, and a fork's pull request is not failed for lacking a secret.
  5. One copy of the toolchain setup.

Every change stays package-agnostic: main.yml and workspace_ci.py still name no package, and the files added here name none either.

Design

Outcome: a push to main was planned from the head of the last successful main run, plan fell back to every package for an unknown or non-ancestor base, and release created, resumed or skipped each GitHub Release without running git tag. Sonar waited for its quality gate but did not gate release: a failed gate already blocks the merge, and gating release would let one repository-wide scan hold back every package.

Considered and rejected

  • Keep github.event.before and drop concurrency. Failed runs would still leave changes unplanned, and two runs on main could race to tag the same version.
  • Build the resumed release from HEAD. The assets would not match the tagged source.

Out of scope. Routing CI steps through a single task runner, and moving the planner out of .github/scripts/: both are decisions for whatever maintains the template, not for this repository.

Progress

Outcome: every story closed on 2026-10-03; the manual branch run at 66b1df13 and the first main push run recorded the GitHub evidence.

S14.2.1 — Pin every action

State: Closed (2026-10-02)

Outcome: every non-local uses: is pinned to a commit SHA with its release tag, checked against the upstream release pages on 2026-10-02.

Acceptance: the pin check in the block below finds nothing.

S14.2.2 — Composite setup action

State: Closed (2026-10-02)

Outcome: .github/actions/setup/action.yml holds the setup-uv and uv sync steps that every job except plan and ci-ok uses after its own checkout.

Acceptance:

  • astral-sh/setup-uv and uv sync appear in .github/actions/setup/action.yml and nowhere in main.yml.
  • Every job except plan and ci-ok has actions/checkout followed by ./.github/actions/setup.
  • actionlint .github/workflows/main.yml passes.

S14.2.3 — Plan from the last successful run

State: Closed (2026-10-03)

Outcome: on a push, plan resolved BASE from the last successful main push run with gh run list, and fell back to every package when BASE was not an ancestor commit of HEAD.

Acceptance:

  • uv run rn-forge-devops plan 0000000000000000000000000000000000000000 exits 0 and its release-order lists every workspace member.
  • plan <a SHA not in this history>, created by committing on a detached orphan branch in a temporary clone, does the same.
  • plan HEAD~1 still selects only the packages changed in HEAD and their dependents (same result as before the change).
  • On GitHub: after a push whose run fails, the next push's run selects the failed push's packages again.

Amended 2026-10-03: that check is covered by the --status success lookup plus the mocked workflow-shell validation below; the live failed-push drill is not required.

Outcome: validated locally on 2026-10-02 and on GitHub on 2026-10-03 (the main push run at ca04bca took the empty-BASE path and selected all seven packages).

S14.2.4 — Concurrency

State: Closed (2026-10-02)

This depends on S14.2.3: without it, a replaced pending run on main loses its changes.

Outcome: the workflow cancels superseded pull-request runs only, and docs deploys in its own pages group.

Acceptance: both blocks are present (checked below); actionlint passes.

S14.2.5 — The release is the record

State: Closed (2026-10-03)

Outcome: release creates, resumes from the tag, or skips each release; it no longer runs git tag, git push or the git ls-remote skip.

Acceptance:

  • main.yml contains no git tag -a, git push origin "$tag" or git ls-remote --exit-code --tags; it contains gh release view with isDraft and gh release create with --target.
  • On GitHub (owner-run, once): delete a package's latest GitHub Release but keep its tag, then rerun the main workflow. The run recreates the release from the tag, with its wheel and sdist, and the tag still points at its original commit.
  • A second rerun skips that package as already shipped.

Amended 2026-10-03: tag-only recovery, the destructive owner-run delete-a-release check, is covered by the local scenarios below (real Git repositories, mocked gh); the live drill moved to ideas. The published-release skip was observed on GitHub.

Outcome: eight local scenarios passed on 2026-10-02; the main push run at ca04bca skipped all seven packages as already published (2026-10-03).

S14.2.6 — Sonar: guard and gate

State: Closed (2026-10-03)

Outcome: sonar skips fork pull requests and waits for the quality gate.

Acceptance: both are present (checked below); on GitHub, the next main run's scan step reports the quality gate status.

Outcome: the manual branch scan and the main push run at ca04bca reported QUALITY GATE STATUS: FAILED and failed ci-ok, which is the acceptance; F14.4 later cleared the gate.

S14.2.7 — Timeouts and Dependabot

State: Closed (2026-10-03)

Outcome: every job has a timeout-minutes, and .github/dependabot.yml updates GitHub Actions weekly in one group.

Acceptance: the block below.

Outcome: validated on 2026-10-03; every timeout exceeds twice the longest observed job (148 seconds, Sonar), so none was raised.

S14.2.8 — Runbook and handoff

State: Closed (2026-10-03)

Acceptance:

  • Releasing packages states that a published GitHub Release, not a tag, marks a version shipped; that a failed release is fixed by rerunning the workflow; and that a resumed release is checked by hand with the external-install command.
  • .github/workspace-ci-handoff.md lists .github/actions/setup/action.yml and .github/dependabot.yml among the files to copy, and replaces its "Tags are …" assumption with the release-record behavior and the plan-base rule.

Outcome: validated on 2026-10-03 with the handoff checks and the strict documentation build.

Acceptance

set -euo pipefail
absent() { local rc=0; rg -q --hidden --glob '!.git' "$@" </dev/null || rc=$?; [ "$rc" -eq 1 ]; }
wf=.github/workflows/main.yml
# S14.2.1
absent --pcre2 -e 'uses: [^.][^@]*@(?![0-9a-f]{40} # v[0-9]+\.[0-9]+\.[0-9]+)' .github
# S14.2.2
absent -e 'astral-sh/setup-uv|uv sync' "$wf"
rg -q 'uv sync --all-packages --all-extras --locked' .github/actions/setup/action.yml
[ "$(yq '[.jobs | to_entries[] | select(.key != "plan" and .key != "ci-ok") | select(([.value.steps[].uses] | map(select(. == "./.github/actions/setup")) | length) == 0)] | length' "$wf")" = 0 ]
actionlint "$wf"
# S14.2.3
all=$(uv run python -c 'from pathlib import Path; from rn_forge.devops import uv; print(len(uv.load_workspace(Path.cwd()).packages))')
out=$(uv run rn-forge-devops plan 0000000000000000000000000000000000000000)
[ "$(sed -n 's/^release-order=//p' <<<"$out" | jq length)" = "$all" ]
# S14.2.4
[ "$(yq '.concurrency.group' "$wf")" = 'ci-${{ github.ref }}' ]
[ "$(yq '.jobs.docs.concurrency.group' "$wf")" = pages ]
# S14.2.5
absent -e 'git tag -a|git push origin "\$tag"|git ls-remote --exit-code --tags' "$wf"
rg -q 'isDraft' "$wf"
rg -q 'gh release create .*--target' "$wf"
# S14.2.6
rg -q 'head.repo.full_name == github.repository' "$wf"
rg -q 'sonar.qualitygate.wait=true' "$wf"
# S14.2.7
[ "$(yq '[.jobs[] | select(has("timeout-minutes") | not)] | length' "$wf")" = 0 ]
[ "$(yq '.updates[0]["package-ecosystem"]' .github/dependabot.yml)" = github-actions ]
# S14.2.8
rg -q 'actions/setup/action.yml' .github/workspace-ci-handoff.md
rg -q 'dependabot.yml' .github/workspace-ci-handoff.md

Workflow-run validation

Outcome: the main push run at ca04bca covers S14.2.3, S14.2.5 and S14.2.6; the failed-push check and the live recovery drill were amended out of acceptance and parked in ideas.