Skip to content

SRE-968: Recreate the closed Version Packages pull request - #9328

Merged
CiaranMn merged 1 commit into
mainfrom
claude/sre-968-recreate-version-packages-pr
Aug 25, 2026
Merged

SRE-968: Recreate the closed Version Packages pull request#9328
CiaranMn merged 1 commit into
mainfrom
claude/sre-968-recreate-version-packages-pr

Conversation

@claude

@claude claude Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Requested by Ciaran Morinan · Slack thread

🌟 What is the purpose of this PR?

Restore npm publishing from the release workflow, and republish @hashintel/ds-helpers with its payload.

The workflow passes commitMode: github-api to changesets/action, which delegates the version commit to @changesets/ghcommit. That library makes two separate remote ref writes: updateRef resets changeset-release/main to the tip of main with force: true, then createCommitOnBranch adds the version commit. Between the two writes the branch matches main, so GitHub's empty-pull-request detector closes the Version Packages pull request. The action counters this with an updatePullRequest mutation carrying state: OPEN, which races the close and usually loses. 38 of the last 40 pull requests from changeset-release/main were closed without merging.

changesets/action either 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-api would remove the race. That option was rejected: signed commits are required, and the API commit path is what signs them.

@hashintel/ds-helpers 0.2.1 is the current latest on npm. Its tarball holds six files — package.json, three licence files, the README, and the changelog — with no styled-system directory, so all five subpath exports fail to resolve.

🔗 Related links

🚫 Blocked by

  • Nothing.

🔍 What does this change?

  • Adds a Recreate the Version Packages pull request step to .github/workflows/release.yml, directly after the changesets/action step.
  • Adds a patch changeset for @hashintel/ds-helpers. Repository policy for pre-v1 ds-* packages reserves minor for breaking changes, so a republish is a patch.

The new step:

  • Exits 0 without acting when changeset-release/main does not exist, when the compare endpoint reports ahead_by == 0 against main, or when the branch already has an open pull request into main.
  • Reopens the most recent closed, unmerged pull request from the branch with 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.
  • Runs under if: ${{ !cancelled() }} rather than always(), 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, so Notify Slack on failure still fires.
  • Authenticates with steps.app-token.outputs.value through GH_TOKEN. The job's permissions: block needs no change: it scopes secrets.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.
  • Titles the pull request Version Packages, the default prTitle in the action's runVersion. The fallback body reproduces the header from the action's getVersionPrBody plus the # Releases heading, and the action's next run replaces it with the full generated body.
  • Calls gh from the runner image rather than adding a pinned action. The repository's workflows contain no actions/github-script step and no curl call to api.github.com, so there was no existing idiom to match.
  • Needs no separate handling for merged version pull requests: the repository has delete_branch_on_merge enabled, so a merge removes changeset-release/main and the branch-does-not-exist check exits 0.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

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 main rather than in the same run.

🐾 Next steps

  • Merging this opens a Version Packages pull request carrying the @hashintel/ds-helpers patch bump. Merging that publishes 0.2.2 with the generated styled-system files.

🛡 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 gh for 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. shellcheck reports no findings on it. markdownlint-cli2 and oxfmt --check pass on both changed files.

❓ How to test this?

  1. Merge this pull request. The release workflow runs on main and changesets/action opens a Version Packages pull request.
  2. Confirm the Recreate the Version Packages pull request step logs changeset-release/main already has an open pull request into main, or Reopened #<number> when the close already landed.
  3. If GitHub closes that pull request afterwards, push to main again and confirm the step logs Reopened #<number>.
  4. Merge the Version Packages pull request, then confirm npm view @hashintel/ds-helpers@0.2.2 dist.fileCount reports more than six files.

📹 Demo

Not applicable.

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 25, 2026 2:44pm
hashdotdesign-tokens Ready Ready Preview Aug 25, 2026 2:44pm
petrinaut Ready Ready Preview Aug 25, 2026 2:44pm
petrinaut-docs Ready Ready Preview Aug 25, 2026 2:44pm

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.97%. Comparing base (5e0ec66) to head (0b57f6d).
⚠️ Report is 2 commits behind head on main.

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     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 14.66% <ø> (ø)
blockprotocol.type-system 40.84% <ø> (ø)
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.antsi 2.36% <ø> (ø)
rust.error-stack 90.81% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.38% <ø> (+0.19%) ⬆️
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-graph-api 12.34% <ø> (ø)
rust.hash-graph-authentication 95.64% <ø> (ø)
rust.hash-graph-authorization 62.59% <ø> (ø)
rust.hash-graph-embeddings 91.88% <ø> (ø)
rust.hash-graph-postgres-store 29.33% <ø> (ø)
rust.hash-graph-store 46.78% <ø> (ø)
rust.hash-graph-temporal-versioning 47.95% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 84.71% <ø> (ø)
rust.hashql-ast 89.63% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-core 78.98% <ø> (ø)
rust.hashql-diagnostics 72.51% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)
rust.hashql-hir 89.09% <ø> (ø)
rust.hashql-mir 87.92% <ø> (ø)
rust.hashql-syntax-jexpr 94.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.38%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 2 regressed benchmarks
✅ 96 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. No successful run was found on main (9c2ec2f) during the generation of this report, so 5e0ec66 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

`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.
@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes production release automation and PR lifecycle; logic is scoped and well-guarded, but mistakes could affect npm publishing or duplicate PRs.

Overview
Fixes npm release flow when changesets/action uses commitMode: github-api: GitHub often closes the “Version Packages” PR while the version branch is briefly identical to main, which blocks merges and publishing.

Adds a Recreate the Version Packages pull request step in release.yml (after changesets, if: !cancelled()). It uses gh and the app token to no-op when the branch is missing, not ahead, or an open PR exists; otherwise reopens the latest closed unmerged PR or creates a new “Version Packages” PR.

Adds a patch changeset for @hashintel/ds-helpers so the next release includes generated styled-system files in the npm tarball (fixing broken subpath exports on current latest).

Reviewed by Cursor Bugbot for commit fa6317f. Bugbot is set up for automated code reviews on this repo. Configure here.

@CiaranMn
CiaranMn added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 001d41a Aug 25, 2026
208 of 210 checks passed
@CiaranMn
CiaranMn deleted the claude/sre-968-recreate-version-packages-pr branch August 25, 2026 16:46
This was referenced Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area)

Development

Successfully merging this pull request may close these issues.

2 participants