From bf0611c5b9307fd77bd98b8f7c8113c9e46b2b52 Mon Sep 17 00:00:00 2001 From: repeat98 Date: Wed, 25 Nov 2026 17:43:56 +0100 Subject: [PATCH] Workflow: compare every PR check against the merge commit's base parent The contract, suite and Windows path checks took the event's base.sha, which can be an older main than the one GitHub merged the pull request onto. Main's later changes then counted as the pull request's own: on 25 November main's migration 0105 failed the board check of PRs that never touched it (#2077, #2125, #2126), and the checks behind it never ran. The scope step already used HEAD^1 for this reason; these steps now resolve the same parent to a commit. The workflow test pins it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/module-pr.yml | 12 ++++++------ scripts/pr-check-plan.test.mjs | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/module-pr.yml b/.github/workflows/module-pr.yml index e1300464f8..ad0cfc9bf8 100644 --- a/.github/workflows/module-pr.yml +++ b/.github/workflows/module-pr.yml @@ -86,9 +86,9 @@ jobs: restore-keys: check-cache-${{ runner.os }}- - name: Require versions, qualification evidence and complete release documentation env: - OCTAMOD_PR_BASE: ${{ github.event.pull_request.base.sha }} MODWERK_PAGES_RUN: ${{ needs.scope.outputs.pages-run }} - run: npm run check -- --base "$OCTAMOD_PR_BASE" --part contract + # The merge commit's base parent, as scope's: base.sha can be an older main, whose later changes would count as this PR's. + run: npm run check -- --base "$(git rev-parse HEAD^1)" --part contract # Qualification records, complete docs/tutorials and monochrome screenshots are mandatory. # First release: owner reviews actual evidence. Later releases: registered author # verifies it and explicitly requests automatic publication within the trusted scope. @@ -130,9 +130,9 @@ jobs: check-cache-${{ runner.os }}- - name: Run one suite of the check env: - OCTAMOD_PR_BASE: ${{ github.event.pull_request.base.sha }} PART: ${{ matrix.part }} - run: npm run check -- --base "$OCTAMOD_PR_BASE" --part "$PART" + # The merge commit's base parent, as scope's: base.sha can be an older main, whose later changes would count as this PR's. + run: npm run check -- --base "$(git rev-parse HEAD^1)" --part "$PART" module-paths-windows: needs: [scope, module-contract] if: needs.scope.outputs.windows == 'true' @@ -150,9 +150,9 @@ jobs: - run: npm ci - name: Validate module paths against the exact PR base env: - OCTAMOD_PR_BASE: ${{ github.event.pull_request.base.sha }} MODWERK_PAGES_RUN: ${{ needs.scope.outputs.pages-run }} - run: npm run modules:check -- --base "$env:OCTAMOD_PR_BASE" + # The merge commit's base parent, as scope's: base.sha can be an older main, whose later changes would count as this PR's. + run: npm run modules:check -- --base "$(git rev-parse HEAD^1)" - name: Check byte-exact source integrity run: npm run sdk:check - name: Exercise paths and directory junctions on Windows diff --git a/scripts/pr-check-plan.test.mjs b/scripts/pr-check-plan.test.mjs index a14451417a..e4d51532c0 100644 --- a/scripts/pr-check-plan.test.mjs +++ b/scripts/pr-check-plan.test.mjs @@ -110,6 +110,9 @@ it('starts the workflow’s scope command as a fresh Node process', () => { expect(command).toBeTruthy() // The base is the merge commit's parent, which the two-commit checkout holds; the event's base.sha may not be in it. expect(workflow).toMatch(/- id: scope\n {8}env:\n(?: {10}#.*\n)* {10}OCTAMOD_PR_BASE: HEAD\^1\n/) + // Every later check compares against the same parent: none takes the event's base.sha. + expect(workflow).not.toMatch(/pull_request\.base\.sha \}\}\n/) + expect(workflow.match(/--base "\$\(git rev-parse HEAD\^1\)"/g)).toHaveLength(3) const output = execFileSync(process.execPath, [command[1], '--base', 'HEAD', '--head', 'HEAD'], { cwd: root, encoding: 'utf8' }) expect(output.trim().split('\n')).toEqual([ 'parts=["test:1/2","test:2/2","sdk"]', 'modules=false', 'windows=false', 'elemod=false', 'logger=false',