Skip to content

Remove website previews after their pull requests close - #404

Draft
tony wants to merge 2 commits into
mainfrom
closed-site-preview-cleanup
Draft

tony wants to merge 2 commits into
mainfrom
closed-site-preview-cleanup

Conversation

@tony

@tony tony commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Website PR #383 kept serving its preview after it merged. GitHub rejected the close workflow before it assigned a runner, and the upload was already in progress. This change gives the website another opportunity to remove a closed preview, including one recreated by an old upload. Issue #403.

The hourly check looks at recent closures and a rotating page of older PRs. It probes up to 28 exact preview folders and queues cleanup for the ones that contain files. Each cleanup shares the PR’s upload queue and checks that the PR is still closed immediately before deleting its folder. The website publisher also checks that a retry still belongs to the current open PR and its tested merge.

Verification

  • All 21 new regression tests failed against the original workflow. All 191 cleanup and deployment tests passed with the fix. The tests cover a reopened PR, a late upload, a closed fork, and a denied storage lookup.
  • All 223 tests passed with the pending manual Lua preview change applied. Its port publisher kept its existing behavior. PR #393.
  • Astro checked 892 files with zero errors or warnings. Oxlint passed for the changed script and test. The AWS CLI exercised exact-prefix requests against a local endpoint.
  • Actionlint 1.7.12 does not recognize GitHub’s queue: max setting. The remaining cleanup workflow checks passed with that diagnostic excluded. GitHub concurrency settings.

The earlier close workflow removed PR 352’s preview after its upload finished. This repository has yet to run a scheduled cleanup. Keep #403 open until the schedule can read the preview folder, a closed page returns 404 after its cache expires, and the reopened PR gets its preview back when an upload was already in progress. Earlier cleanup.

The separate one-time check will use the scheduled cleanup role to look for one object under the closed pr-383/ prefix. Its local tests passed. The live permission check is pending. One-folder check #405.

tony added 2 commits December 6, 2026 02:51
why:
A website preview can finish uploading after its pull request closes.
The cleanup and upload jobs need tests for both orders of events.

what:
- Run the workflow commands against a local GitHub API and S3 fixtures.
- Cover reopen, late upload, permission denial and historical cleanup.
why:
GitHub rejected the close workflow before it could remove a merged
preview. An upload already in progress could recreate the closed page.

what:
- Discover closed previews with an hourly check of recent and older PRs.
- Recheck each PR in its upload queue before deleting its preview.
- Require the current open PR and its tested merge before uploading.
@tony tony added bug Something isn't working no-preview Run CI without publishing a PR preview. p2 Useful follow-up that can proceed independently of the core milestone. area:publishing Artifact verification, promotion, publication and rollback. topic:test-reliability Fixture timing, cleanup, or checks affected by scheduling and isolation. labels Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:publishing Artifact verification, promotion, publication and rollback. bug Something isn't working no-preview Run CI without publishing a PR preview. p2 Useful follow-up that can proceed independently of the core milestone. topic:test-reliability Fixture timing, cleanup, or checks affected by scheduling and isolation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant