Skip to content

ci(release): give release paths a code owner and push version bumps with a deploy key - #5409

Merged
thymikee merged 5 commits into
mainfrom
ci/release-codeowners
Dec 6, 2026
Merged

thymikee merged 5 commits into
mainfrom
ci/release-codeowners

Conversation

@thymikee

@thymikee thymikee commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Summary

These are the prerequisites for a main/0.22 branch ruleset that replaces the release environment reviewer.

  • .github/CODEOWNERS: @thymikee owns .github/, scripts/release-* and scripts/*android-helper*. The ruleset requires code-owner review and 0 other approvals, so other PRs merge as before. Build stays the known exception until ci(release): sign Android helpers in a job that runs only workflow-commit code #5410.
  • mark-released now has two jobs. prepare-next-version runs with no secrets and uploads a -U0 version patch. mark-released holds a deploy key that only the release environment has, and it runs no repository code. It accepts only "version" lines set to the computed -dev version, in package.json, packages/*/package.json or server.json. If main has already moved, it exits cleanly. The commit message carries [skip ci], because deploy-key pushes start workflows and GITHUB_TOKEN pushes did not.
  • docs/agents/pull-requests.md: owner-authored release PRs merge with the admin bypass, and the PR records the reason.

Rollout

  1. Admin: create the write deploy key and the RELEASE_PUSH_DEPLOY_KEY secret in release.
  2. Merge this PR, and add CODEOWNERS to 0.22.
  3. Admin: apply the ruleset.
  4. Merge ci(release): sign Android helpers in a job that runs only workflow-commit code #5410.
  5. Admin: drop the release reviewer and allow only main and v*.

Validation

  • I ran the validator by hand: it accepts the real 0.21.46 bump and rejects a wrong version, an injected field, a mode change, a renamed target and mismatched headers. git apply --unidiff-zero applies the accepted patch.
  • The release workflow tests and the guidance budget check pass.
  • The stable-only jobs first run on the next tag.

@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.80 MB 6.80 MB 0 B
Package (unpacked) 6.80 MB 6.80 MB 0 B
Package (download) 2.07 MB 2.07 MB -5 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 19.7 ms 19.0 ms -0.7 ms
CLI --help 39.7 ms 40.9 ms +1.2 ms

@cubic-dev-ai cubic-dev-ai Bot 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.

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/CODEOWNERS Resolved
Comment thread .github/CODEOWNERS Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/CODEOWNERS Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot 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.

Apex Sentinel: 2 new findings on 813f53a. The verdict and the full list are in the summary comment.

  • 🟡 Minor · CODEOWNERS globs miss the package.json script chain the keystore-holding build job runs · .github/CODEOWNERS:1
  • 🟡 Minor · mark-released hard-fails instead of exiting cleanly when main already advanced past the version · .github/workflows/release.yml:437

Comment thread .github/CODEOWNERS Resolved
Comment thread .github/workflows/release.yml Resolved
@thymikee

thymikee commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

This PR has findings at 813f53a, and the "Ownership and context budgets" check fails because of this diff. The new section in docs/agents/pull-requests.md adds 660 bytes, which takes docs/agents/*.md from 39717 to 40377 against the 40000 budget. The "Body rules" check also fails: the body has no ## Summary section and is about 353 words against the 250-word limit. No conflicts. Before merge, bring the docs under budget, fix the body, and fix the rollout order below.

Not blocking, and each can be taken or left: (1) CODEOWNERS:3 and the new docs say jobs that hold release secrets run only owned paths, but the build job (release.yml:113-137) holds the Android keystore and runs unowned package.json scripts, lockfile dependencies and scripts/prepare-publish-assets.mjs; state the rule as the target, name build as the known exception until the signing split, and make rollout step 4 depend on that split. (2) The ruleset is described for main and 0.22, but CODEOWNERS lands only on main, and GitHub reads owners from the PR's base branch; land the same file on 0.22 before the ruleset applies there, or drop 0.22 from the docs sentence. (3) The merge happens in step 1 and RELEASE_PUSH_DEPLOY_KEY is created in step 2, so in between ssh-key is empty, checkout falls back to a read-only github.token, and all three pushes at release.yml:389 get a 403; create the write-enabled deploy key and the release secret before merging. (4) A deploy-key push triggers workflows, so each bump commit now starts every push-to-main workflow, and ciConclusion (release-plan.mjs:196-207) finds that run before the isVersionOnlyCommit fallback that release-plan.mjs:101-102 relies on; add [skip ci] to the bump message, or update those comments and the PR body. (5) The patch artifact has retention-days: 1 (release.yml:370) while mark-released can wait up to 30 days for approval, and a re-run of only mark-released cannot recover it; raise retention to cover the approval timeout. (6) If main's version moves between prepare and mark-released, git apply at release.yml:447 fails under set -e with no clean exit, where the base exited 0; in the loop, when git apply --check fails and the root version on origin/main is no longer the released X.Y.Z-dev, print "main already moved past $VERSION" and exit 0. (7) release-workflow.test.ts:107 asserts structure only, so nothing tests the validator between the unprivileged job and the deploy key; could accept and reject cases (the real 0.21.46 patch, a wrong version, an injected line, a mode change, a rename) be added as unit tests of the exported checker?

Of the open inline threads, the keystore-in-build one (topic), the stale-patch one (topic) and the one-day retention one (topic) still apply, and so do two lower-priority threads (the keystore follow-up and the git apply hard-fail). These do not apply and can be resolved: #5409 (comment) (javac compiles the sources and never runs them with the key), #5409 (comment) (a private manifest can change only a harmless version line), #5409 (comment) (a wrong -dev version never reaches a secret) and #5409 (comment) (/.github/ is the correct scope).

Evidence: the 0.21.46 patch was accepted by the validator in a local run. Not verified here: the stable-only jobs (prepare-next-version, mark-released) have not run at this head, since a PR dry run skips them. Not verified here: the validator's rejection cases, which were checked by reading only. Not verified here: the ruleset settings (deploy-key bypass, code-owner review, status checks), the origin/0.22 contents beyond the local remote-tracking ref, and that deploy-key pushes trigger workflows in this repo.

@thymikee

thymikee commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Replies to the review in e2a43b9:

  • Guidance budget: the docs section is trimmed. docs/agents is now 39,924 bytes.
  • Body: rewritten. Rollout now creates the deploy key and secret before merge.
  • Build exception: CODEOWNERS names Build as the known exception until ci(release): sign Android helpers in a job that runs only workflow-commit code #5410. Reviewer removal stays the last step.
  • 0.22: a CODEOWNERS PR to 0.22 follows, so it lands before the ruleset.
  • [skip ci]: added to the bump commit, which keeps the planner's version-only fallback behaviour.
  • Retention: raised to 30 days.
  • Moved main: exits 0 when main is no longer at $VERSION-dev.
  • Validator unit tests: left as is. The awk check is inline workflow shell, and the accept and reject cases were run by hand (real 0.21.46 patch, wrong version, injected field, mode change, rename, header mismatch).

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot 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.

Apex Sentinel: 2 new findings on e2a43b9. The verdict and the full list are in the summary comment.

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 18b3123

Since the review of e2a43b9: 0 new · 0 still open · 1 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (ccd530bf2cf9).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

thymikee commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at 18b3123. Both high-priority findings from the earlier review (#5409 (comment)) are fixed: the apply-failure branch now reads the version on the reset origin/main and exits 0 when main has moved past $VERSION, and the upload-artifact step has retention-days: 30. The [skip ci] comment now matches what the planner reads, and the docs-budget and body-rules checks that failed before now pass. CI is green at this head (35 checks, none failing), and no conflicts are known. Nothing else must happen in the code before merge.

Not blocking: PR #5414 (the 0.22 copy) still has the old line 3 in .github/CODEOWNERS ('Jobs that hold release secrets run only these paths.'), while this PR now says 'Target: ... Build job ... known exception'; the owner rules are identical, so updating #5414 to the head wording keeps both branches in agreement, and this can be taken or left.

The four earlier inline threads no longer need action: #5409 (comment) (apply-failure branch) and #5409 (comment) (artifact retention) are fixed at this head, #5409 (comment) is fixed because the [skip ci] comment now matches release-plan.mjs, and #5409 (comment) is resolved with no change needed. The author can resolve them.

Not verified here: the stable-only jobs (prepare-next-version, mark-released) have not run at this head, because a PR dry run skips them and no stable tag exists, so the apply-failure branch, the [skip ci] effect and the deploy-key checkout are checked by reading only. Also not verified here: that GitHub suppresses push workflows for a deploy-key push carrying [skip ci] in this repo, the ruleset settings (deploy-key bypass, code-owner review), and the deploy key and secret creation. Those are admin steps outside the diff, and the PR states them in its rollout.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 5, 2026
@thymikee
thymikee added this pull request to stack #5415 December 5, 2026 17:46
@thymikee
thymikee merged commit af0122f into main Dec 6, 2026
35 checks passed
@thymikee
thymikee deleted the ci/release-codeowners branch December 6, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant