Repository navigation
Keep only the latest complete Nightly build - #2212
Conversation
Prune the rolling release by its advertised version once all five assets are accounted for. Keep source tags and the Alpha channel unchanged. Amp-Thread-ID: https://ampcode.com/threads/T-01a215f3-5c5e-7176-b500-086c669c77cc
eric8810
left a comment
There was a problem hiding this comment.
[P2] Keep an install in progress working across promotion. The installer reads the rolling title once (scripts/install-nightly.sh:26–33) and then fetches the selected version's checksum and archive. If .9 is read just before .11 is promoted, publish-nightly.mjs now deletes .9 immediately. A fresh install or upgrade that has not cached .9 exits when those downloads disappear. The previous retention kept .9 across this promotion.
I verified this with the existing local fake-gh/fake-curl fixture: the unmodified test passed on this head; a test that gives the installer the .9 metadata it could have read just before promotion while serving post-promotion assets passed on the base and failed on this head at SHA256SUMS-1.2.3-nightly.9. No live release was touched.
If one-version retention is the goal, please retry the metadata and both downloads together on a missing asset, with a bounded retry and no switch until the selected version verifies. Test a promotion between the title read and the download, while keeping the existing checksum-failure behavior.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed cdba6df2292d473b18f055a2ef06f00fd0773dc0 against c68dad5a776ee3a639da6bba499cee6bb33453a9. Two release behaviors need to hold before merge:
- Keep installs working across promotion. I independently confirmed the earlier review: after the installer selects the old Nightly, promotion can delete its checksum or archive before the next download, aborting a fresh install or upgrade. A local release fixture passed on the base and failed on this head when promotion occurred after metadata or checksum read. Verify that the same invocation completes with a verified Nightly across those boundaries, and that a checksum mismatch still leaves the installed version intact. Installer · Pruning
- Keep one complete set across publisher revisions. Publish jobs are serialized, but each uses the publisher from its source commit, and the tag path accepts older main ancestors. In the fixture, publishing
.11with this revision and then.10with the previous revision kept.11advertised but left ten Nightly assets. Verify that publication across the cutover and the supported historical tag path leaves just the advertised set, without rolling the title back or removing unrelated attachments. Supported tag source · Publisher checkout
The exact scripts CI and aggregate gate passed. These cases were checked with local fake release transports only; no live assets were changed.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Requesting changes. The retention change itself is consistent: the publisher uploads five version-named assets, promotes only after the upload returns, asserts the advertised set has all five, and then deletes every other owned set. An interrupted upload exits before promotion and pruning, unrelated attachments and source tags stay, and an installed payload on disk is independent of the release assets. Two existing findings still block, and the added test assertion does not cover the upload-failure promise.
I agree with eric8810 and zerob13 on the promotion race and with zerob13 on the mixed-revision case. Local fixtures reproduced both: a promotion between the installer's title read and its checksum fetch makes a fresh install exit 1 on this head while the base installs the previous version, and a publish from a pre-merge tag source after a post-merge publish leaves ten assets with the newer title until the next post-merge publish trims them.
P3, inline: the added install() at scripts/nightly.test.mjs:59 does not download anything. Version 8 was already installed at lines 48-52, so install-nightly.sh:29 skips the checksum and archive fetches because $XDG_DATA_HOME/dim-nightly/1.2.3-nightly.8 exists. I removed all of version 8's fake release assets before that line and the test still passed. Failure: a regression that prunes the previous version on a failed upload would not be caught, although docs/release/README.md:58 asks for installer upgrade and retention coverage when those mechanisms change. Fix: remove the installed payload (or use a fresh HOME) before the assertion, or assert the five version 8 assets remain; removing the payload and then deleting the assets fails at line 59 as intended.
Cross-PR: the head is based on origin/main c68dad5 (the merge base equals origin/main), so main does not conflict. #1881 ff9825d, #2174 4f59f2f, #2197 6f78bbc, #2206 3c4ef46, #2210 d99838e and #2211 ae694e9 touch none of the three changed files.
Verification: node --test scripts/nightly.test.mjs passed under an isolated HOME, TMPDIR and XDG. Local fake-gh/fake-curl fixtures produced the race, the mixed-revision state and the vacuous assertion; no live release was touched, no probe edits remain in the worktree, and no processes are left. CI on cdba6df passes scripts and ci-ok; the remaining checks are path-filtered to skipped.
| writeFileSync(file('interrupt'), ''); | ||
| publish(12, false); | ||
| assert.equal(release(), 'Nightly v1.2.3-nightly.8'); | ||
| assert.equal(install().status, 0); |
There was a problem hiding this comment.
P3. This assertion does not exercise a download.
Problem: version 8 was installed at lines 48-52, so $XDG_DATA_HOME/dim-nightly/1.2.3-nightly.8 exists and install-nightly.sh:29 skips the checksum and archive fetches at lines 32-33.
Failure: a change that deletes or misses the previous version's assets on a failed upload would still pass this test, so the PR's claim that upload failures leave the previous build installable is not covered.
Fix: remove file('data/dim-nightly/1.2.3-nightly.8') (or use a fresh HOME) before this install and keep the assertion. With version 8's assets present it passes, and with them removed it fails here. Alternatively assert the five version 8 assets remain in the fake release.
There was a problem hiding this comment.
Fixed in cfb6c05.
The interrupted-upload check now installs into a fresh home: scripts/nightly.test.mjs:76 calls install(file('fresh-after-interruption')), and the helper at scripts/nightly.test.mjs:58-60 overrides HOME and XDG_DATA_HOME. $XDG_DATA_HOME/dim-nightly/1.2.3-nightly.8 therefore does not exist, and install-nightly.sh:30-37 downloads the checksum and archive instead of skipping them. The promotion cases at scripts/nightly.test.mjs:92-99 also use fresh homes.
I confirmed the assertion is sensitive: deleting version 8's release assets before line 76 makes the test fail at that assertion (installer status 1, expected 0), and the unmodified test passes.
Refresh the release and retry once on an asset 404, without retrying verification failures. Build pinned historical sources through the main dispatch and use current main for publication policy. Amp-Thread-ID: https://ampcode.com/threads/T-01a215f3-5c5e-7176-b500-086c669c77cc
|
Follow-up for the three review findings:
All script tests passed locally (158 passed, 4 skipped). The workflow source step also passed local checks for default dispatch, an ancestor dispatch and a current-head tag, and rejected an off-main or abbreviated SHA. No live release or repository settings were changed. |
eric8810
left a comment
There was a problem hiding this comment.
My install-during-promotion blocker is resolved. A 404 from either asset restarts from release metadata, with one retry; the installer still verifies the checksum and binary version before switching. I ran node --test nightly.test.mjs from this exact head with fake GitHub and HTTP transports. Both missing-asset cases installed the promoted binary, permanent 404 and checksum mismatch kept the installed version, and a fresh HOME installed the previous version after an interrupted upload.
I also exercised the workflow's source-selection step in a temporary Git repo: default dispatch, full ancestor SHA, and current-head tag succeeded; abbreviated and off-main SHAs were rejected. The build stays pinned to that SHA while the publish job uses the current main publisher. The documented cutover still matters: drain legacy runs, and dispatch historical sources rather than triggering their old workflows. I did not run the live release workflow. The exact-head scripts job passed; the overall gate was still pending at review time.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed cfb6c0525f142cbc31354fb2e408174310f9f184. The installer now recovers on promotion after either metadata or checksum is read without replacing a working install on checksum failure. The supported historical dispatch now builds the selected source but uses the current publisher, preserving only the advertised set without title rollback or removal of unrelated attachments. Both were verified with isolated fixtures.
The remaining legacy-run issue is a one-time release step, not a code blocker: the documented cutover drains already-started legacy jobs before the first one-version publication, and the Nightly workflow pages currently show no queued or in-progress jobs. Recheck immediately before first publication and use dispatch for historical sources. No live assets were changed as part of this review.
Exact scripts CI passed; Linux and the aggregate gate were still pending at review and remain independent.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Approving at cfb6c05. The two round-1 blockers are resolved and the new source path holds in local fixtures.
Installer promotion race: I ran the head installer against a fake curl that serves stale .9 metadata on the first read and 404 for the pruned assets. Both the checksum-missing and archive-missing cases made two metadata calls, read .9 then .11, downloaded the .11 checksum and archive, verified the binary, and installed .11 in a fresh home (scripts/install-nightly.sh:27-38). The base installer stopped at the first missing asset (curl exit 22) with nothing installed. A checksum mismatch made one metadata call, failed with "Checksum mismatch", and left the installed .9 in place. A 500 made one metadata call and failed with HTTP 500. A permanent 404 made two metadata calls and failed with "Could not download Nightly assets ... (HTTP 404)". Real curl with -fsSL -o -w prints 404 or 500 on stdout and exits 22, so the status capture is sound.
Tests: node --test scripts/nightly.test.mjs passes. I confirmed the test exercises the new branches: replacing the installer with the base version fails at scripts/nightly.test.mjs:97 on the checksum promotion case, and deleting version 8's assets before scripts/nightly.test.mjs:76 fails the fresh-install assertion. The fake curl moves stale-release on the first metadata call and writes stale-sums only for the archive case, as intended.
Source input: I extracted the prepare source block and ran it under bash -e against a temp repository. Empty source and source equal to the dispatched head build the head; an ancestor source checks out that ancestor, and the reservation creates the tag at the source SHA (.github/workflows/nightly.yml:42-46, 55, 57-65). Abbreviated, tree, missing, non-ancestor, off-main, head-mismatch, invalid-tag, and newline-in-tag inputs are rejected before the reservation; tag pushes at the main tip and at an old main ancestor succeed; a tag at a non-ancestor commit fails the ancestry check. GITHUB_OUTPUT contains only the validated 40-hex sha and validated tag. The build job checks out needs.prepare.outputs.sha (.github/workflows/nightly.yml:117); the publish job checks out refs/heads/main (:184) and passes needs.prepare.outputs.sha as SOURCE (:196-201), so a manual historical source is built from that SHA and published by the current main publisher.
P3s: the refs/heads/main publisher closes the mixed-publisher case for tags at commits that contain this change; a tag pushed at a pre-merge commit still runs that commit's old workflow, which this change cannot alter. That residual path is documented at docs/release/README.md:54 and .agents/skills/publishing-dim-nightlies/SKILL.md:14-15. The round-1 cached-install test gap is fixed at scripts/nightly.test.mjs:75-76.
Cross-PR: merge-tree is clean with origin/main c68dad5 and #2197 8701164 and its current head 42c592e, #2214 6c7a70a, #2174 3914eaa, #2206 f125d5f, #2210 69a43e8, #2211 ae694e9. None changes the six PR files.
CI at cfb6c05: ci-ok, scripts, verify (linux), macos-native, windows-cli, web, static-checks, dependencies and changes pass; acp-registry is skipped. I did not run the live release workflow or the build and publish jobs, so the historical-source build and publication path is verified only at the prepare-step level.
No blocking findings.
Summary
Keep only the latest complete build on the rolling Nightly release, so its downloads are not mixed with previous builds. The publisher confirms the advertised version has all four platform archives and its checksum file before pruning other Nightly assets. Upload failures still leave the previous build installable, and out-of-order publication cannot roll back the advertised version. Source tags, unrelated attachments, and Alpha releases are unchanged.
Refs #2131 (updates the retention count, not the channel or release process).
Design rule checklist
N/A: release tooling only. No changes to Agent parts, services, state, commands, Timeline, context, configuration, or lifecycle. No new mechanism requirements.
Documentation
Updated only the Nightly release contract in
docs/release/README.md; no ADR or cross-module changes.Verification
node --test scripts/*.test.mjs— 158 passed, 4 skipped. The Nightly flow covers interrupted upload, out-of-order publication, keeping only the advertised complete version, and preserving unrelated assets.git diff --checkandnode scripts/adr-check.mjs --base origin/mainpassed.v0.1.0-nightly.3attachments and that both.2and.3Git tags still exist. No new Nightly build was triggered.