Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ The flag was removed in the `0.1.1` release commit. `publish.yml` still fails in

To prevent a single long mutation worker from exceeding runner availability, the PR CI executes the unchanged mutation sample in five independent jobs (11 ordinary targets plus four non-overlapping 10-mutant write-plan shards). The required `Verify (ubuntu-latest)` gate aggregates the complete sample and enforces all original score floors, including write-plan's 90%. Windows and macOS checks remain required, and package-preview waits for all three. No checks rerun after the merge.


### GitHub Actions PR associations after merge

GitHub can report `workflow_run.pull_requests: []` for a previously successful PR-triggered CI run **after** that PR is merged. This is a GitHub API metadata behavior, not a loss of the original CI result. The release provenance resolver accepts an empty association array **only after** it has independently identified the one merged PR for the actual `main` commit, and verified the run's exact PR head SHA, repository, `CI` workflow path, `pull_request` event, successful completion and pre-merge timestamp. A non-empty association array for another PR is rejected. The downloaded VSIX's manifest must then match the PR number, run ID, head SHA, merged Git tree, version and SHA-256. Missing fields, other repositories, stale runs or altered bytes continue to block publishing.

This allows safe recovery from the failed 0.2.0 publish after PR #4 without re-running any tests on `main`. If 0.2.0 has not yet been published, an ordinary new PR containing only the provenance fix may keep the version at 0.2.0; merging the successful follow-up PR starts the publish workflow using its own validated VSIX. Do **not** bump to 0.2.1 solely to repair a release that was never shipped.

## Release checklist

1. Feature, security, privacy, accessibility and i18n acceptance complete (`ENTERPRISE_AAAA_STATUS.md`).
Expand Down
8 changes: 7 additions & 1 deletion scripts/release-provenance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ export function selectMergedPr(prs, sha) {
}

export function selectSuccessfulRun(runs, pr) {
// GitHub can clear workflow_run.pull_requests after the PR is merged. An empty array
// is NOT proof that a run was unrelated: the authoritative link is the merged PR's
// exact head SHA, verified repository, workflow, event and pre-merge timestamp.
// A non-empty association MUST still contain the expected PR number.
const associated = (run) => Array.isArray(run.pull_requests) &&
(run.pull_requests.length === 0 || run.pull_requests.some((p) => p.number === pr.number));
const matches = runs.filter((r) => r.status === 'completed' && r.conclusion === 'success' &&
r.event === 'pull_request' && r.path === '.github/workflows/ci.yml' &&
r.head_sha === pr.head.sha && r.head_repository?.full_name === pr.base.repo.full_name &&
r.pull_requests?.some((p) => p.number === pr.number) &&
associated(r) &&
new Date(r.created_at).getTime() <= new Date(pr.merged_at).getTime() && numberId(r.id));
matches.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
assert(matches.length, 'no successful pre-merge PR CI for the exact head');
Expand Down
6 changes: 5 additions & 1 deletion test/release-provenance.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ test('release: only actual merged PR and successful pre-merge exact-head CI qual
const { selectMergedPr, selectSuccessfulRun } = await load();
assert.equal(selectMergedPr([pr], sha('a')).number, 4);
assert.equal(selectSuccessfulRun([run], pr).id, 123);
// Real GitHub Actions behavior after closing PR #4: pull_requests becomes [].
// That does not invalidate the successful exact-head run (run #42871117473).
assert.equal(selectSuccessfulRun([{ ...run, pull_requests: [] }], pr).id, 123);
for (const change of [
{ conclusion: 'failure' }, { conclusion: 'cancelled' }, { event: 'push' },
{ head_sha: sha('c') }, { path: '.github/workflows/publish.yml' },
{ pull_requests: [{ number: 99 }] }, { created_at: '2026-11-10T20:00:00Z' },
{ pull_requests: [{ number: 99 }] }, { pull_requests: undefined },
{ created_at: '2026-11-10T20:00:00Z' },
]) assert.throws(() => selectSuccessfulRun([{ ...run, ...change }], pr));
assert.throws(() => selectMergedPr([{ ...pr, base: { ref: 'develop' } }], sha('a')));
assert.throws(() => selectMergedPr([{ ...pr, merge_commit_sha: sha('c') }], sha('a')));
Expand Down
Loading