SRE-968: Recreate the closed Version Packages pull request - #9328
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9328 +/- ##
=======================================
Coverage 59.96% 59.97%
=======================================
Files 1428 1428
Lines 139981 139981
Branches 6597 6597
=======================================
+ Hits 83946 83958 +12
+ Misses 54961 54951 -10
+ Partials 1074 1072 -2 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 15.38%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | bit_matrix/dense/iter_row[64] |
140.8 ns | 170 ns | -17.16% |
| ❌ | bit_matrix/dense/iter_row[200] |
185.8 ns | 215 ns | -13.57% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/sre-968-recreate-version-packages-pr (fa6317f) with main (5e0ec66)1
Footnotes
`commitMode: github-api` writes the version commit in two remote ref updates, resetting `changeset-release/main` to `main` before adding the commit. GitHub closes the Version Packages pull request as empty in the window between the two writes. Add a release-workflow step that reopens the closed pull request, or creates a new one, whenever `changeset-release/main` is ahead of `main` and has no open pull request. Add a patch changeset for `@hashintel/ds-helpers` so the next release replaces the 0.2.1 tarball, which shipped without its generated `styled-system` files.
0b57f6d to
fa6317f
Compare
PR SummaryMedium Risk Overview Adds a Adds a patch changeset for Reviewed by Cursor Bugbot for commit fa6317f. Bugbot is set up for automated code reviews on this repo. Configure here. |
Requested by Ciaran Morinan · Slack thread
🌟 What is the purpose of this PR?
Restore npm publishing from the release workflow, and republish
@hashintel/ds-helperswith its payload.The workflow passes
commitMode: github-apitochangesets/action, which delegates the version commit to@changesets/ghcommit. That library makes two separate remote ref writes:updateRefresetschangeset-release/mainto the tip ofmainwithforce: true, thencreateCommitOnBranchadds the version commit. Between the two writes the branch matchesmain, so GitHub's empty-pull-request detector closes the Version Packages pull request. The action counters this with anupdatePullRequestmutation carryingstate: OPEN, which races the close and usually loses. 38 of the last 40 pull requests fromchangeset-release/mainwere closed without merging.changesets/actioneither versions or publishes in a single run, never both. While the version pull request stays closed nobody merges it,.changeset/never empties, and no package reaches npm.Dropping
commitMode: github-apiwould remove the race. That option was rejected: signed commits are required, and the API commit path is what signs them.@hashintel/ds-helpers0.2.1 is the currentlateston npm. Its tarball holds six files —package.json, three licence files, the README, and the changelog — with nostyled-systemdirectory, so all five subpath exports fail to resolve.🔗 Related links
🚫 Blocked by
🔍 What does this change?
Recreate the Version Packages pull requeststep to.github/workflows/release.yml, directly after thechangesets/actionstep.@hashintel/ds-helpers. Repository policy for pre-v1ds-*packages reserves minor for breaking changes, so a republish is a patch.The new step:
changeset-release/maindoes not exist, when the compare endpoint reportsahead_by == 0againstmain, or when the branch already has an open pull request intomain.PATCH state=open. The pull request was closed while empty and the version commit exists by the time the step runs, so the reopen succeeds. Creating a fresh pull request is the fallback for a reopen that fails.if: ${{ !cancelled() }}rather thanalways(), so it still acts when the changesets step failed or was skipped, and stays out of the way while a run is being cancelled. A failed earlier step holds the job's conclusion at failure whatever runs afterwards, soNotify Slack on failurestill fires.steps.app-token.outputs.valuethroughGH_TOKEN. The job'spermissions:block needs no change: it scopessecrets.GITHUB_TOKEN, which this step does not use, and the app installation already holds the pull-request write access it uses to open Version Packages pull requests.Version Packages, the defaultprTitlein the action'srunVersion. The fallback body reproduces the header from the action'sgetVersionPrBodyplus the# Releasesheading, and the action's next run replaces it with the full generated body.ghfrom the runner image rather than adding a pinned action. The repository's workflows contain noactions/github-scriptstep and nocurlcall toapi.github.com, so there was no existing idiom to match.delete_branch_on_mergeenabled, so a merge removeschangeset-release/mainand the branch-does-not-exist check exits 0.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
The step reacts to a close that has already happened. When GitHub closes the pull request after the step has run, the recovery lands on the next push to
mainrather than in the same run.🐾 Next steps
@hashintel/ds-helperspatch bump. Merging that publishes 0.2.2 with the generatedstyled-systemfiles.🛡 What tests cover this?
No automated test covers it; the repository has no harness for workflow steps. The step's shell script was extracted from the parsed workflow and run against a stubbed
ghfor each of its six paths: branch absent, branch not ahead, open pull request present, reopen succeeds, reopen fails, and no closed pull request to reopen.shellcheckreports no findings on it.markdownlint-cli2andoxfmt --checkpass on both changed files.❓ How to test this?
mainandchangesets/actionopens a Version Packages pull request.Recreate the Version Packages pull requeststep logschangeset-release/main already has an open pull request into main, orReopened #<number>when the close already landed.mainagain and confirm the step logsReopened #<number>.npm view @hashintel/ds-helpers@0.2.2 dist.fileCountreports more than six files.📹 Demo
Not applicable.