Skip to content

fix(ci): diff the PR head in the SDK freeze checks - #5951

Merged
pimlock merged 1 commit into
mainfrom
ci/python-freeze-pr-head/vishwa-raman
Nov 24, 2026
Merged

pimlock merged 1 commit into
mainfrom
ci/python-freeze-pr-head/vishwa-raman

Conversation

@vishwa-raman

Copy link
Copy Markdown
Collaborator

Summary

The Python and TypeScript SDK freeze checks fail PRs that never touch the SDKs when the PR's recorded base is older than main. Diff against the PR head rather than the checked-out merge commit so only the PR's own changes are checked.

Related Issue

No issue: this fixes a broken check, under the write-access exception in CONTRIBUTING.md.

Python SDK Freeze fails on #4564, which changes only rfc/0020-cedar-policy-engine/README.md. The job ran git diff BASE_SHA...HEAD. BASE_SHA is pull_request.base.sha, recorded for #4564 as fa2d381ea (Oct 27), and it does not move when main advances. HEAD is the merge commit actions/checkout builds against today's main. Their merge-base is fa2d381ea, so the diff covered every change main made since then, and the job reported 7 Python files changed on main by other PRs (failed run).

Changes

  • Python SDK Freeze and TypeScript SDK Freeze pass pull_request.head.sha as HEAD_SHA and diff BASE_SHA...HEAD_SHA. The merge-base of the recorded base and the PR head is the PR's fork point, so the diff holds only the PR's changes. fetch-depth: 0 already fetches the head commit as a parent of the merge commit.
  • Not changed: the monitoring mixin change detector uses the same BASE_SHA...HEAD pattern, but it also serves merge_group events, and a false positive there only runs the mixin job. That can follow separately if wanted.

Testing

Ran both checks' exact git diff commands locally on real commits:

Case Old (BASE_SHA...merge commit) New (BASE_SHA...HEAD_SHA)
#4564 (RFC only) 7 Python files flagged, matching CI nothing flagged
A main commit that changed python/openshell/sandbox.py (00222c281) — 3 files flagged
A main commit that changed sdk/typescript/src (90e34ad10) — 2 files flagged
  • Workflow YAML parses, and both jobs carry the new HEAD_SHA env
  • Old and new commands reproduced against the failing PR and positive controls
  • Unit tests added/updated (not applicable)
  • E2E tests added/updated (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

The Python and TypeScript SDK freeze checks ran
`git diff BASE_SHA...HEAD`, where HEAD is the merge commit that
actions/checkout creates for a pull_request event. The recorded
pull_request.base.sha does not move when main advances, so on a
long-lived PR the diff included every change main made after that base,
and the checks failed PRs that never touched the SDKs.

Diff against pull_request.head.sha instead. The merge-base of the
recorded base and the PR head is the PR's real fork point, so only the
PR's own changes are checked.

Signed-off-by: Vishwanath Raman <vishwanathr@nvidia.com>
@vishwa-raman
vishwa-raman requested a review from a team as a code owner November 24, 2026 21:30
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 24, 2026
@pimlock
pimlock added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit db7bced Nov 24, 2026
89 checks passed
@pimlock
pimlock deleted the ci/python-freeze-pr-head/vishwa-raman branch November 24, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants