refactor(cicd): share the GitHub transport between the two release scripts - #37387
Open
sfreudenthaler wants to merge 1 commit into
Open
refactor(cicd): share the GitHub transport between the two release scripts#37387sfreudenthaler wants to merge 1 commit into
sfreudenthaler wants to merge 1 commit into
Conversation
…ripts release-qa-status was forked from gather-release-data and still carried a verbatim copy of its GitHub transport: onThrottle, createOctokit, parseRepo, listStandardReleaseTags, findPreviousTag, fetchCommitRange, resolvePRNumbers and the CommitInfo/ReleaseRef types. ~184 lines, differing only in comments, brace style and one error message. Every maintenance change to that layer since the fork has had to patch both copies — #37140 (for #37138) and #37213 (for #37201), both of them bug fixes for defects that shipped twice. release-qa-status even carried a findPreviousTag test whose stated purpose was "guards against drift from gather-release-data"; the shared module makes that drift structurally impossible, so the test is gone rather than duplicated. What moved is plumbing only. fetchPRDetails stays in both callers: the QA report needs url/author/authorType/externalRefs, the changelog needs a truncated body and no author, and merging them means a union return type with each caller ignoring half of it. Mechanics: - npm workspaces at .github/scripts — one install, one lockfile instead of two, and @octokit/* resolves from the shared module. - Consumers import ../../shared/github by relative path, so there is no build-ordering step between packages. - gather-release-data now runs through ts-node like release-qa-status already did. That drops a build step from the release-notes workflow and removes the rootDir constraint that blocks importing ../shared; tsc stays as a --noEmit type-check gate. Verified: gather-release-data output over v26.08.24-01...v26.09.02-01 is byte-identical to the pre-refactor run, release-qa-status renders its markdown report, 73 tests pass across the three packages. Closes: #37382 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Claude finished @sfreudenthaler's task in 3m 39s —— View job Code ReviewReviewed the transport extraction, the workspace/build wiring, and both workflow call sites against New Issues
Notes (non-blocking, not flagged as issues)
Everything else checks out: relative-path import of · |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #37382
Note
#37369 stacks on top of this one. #37361 (the fix this came out of) is already merged.
Why
release-qa-statuswas forked fromgather-release-dataand still carries a verbatim copy of its GitHub transport. Since the fork, every maintenance change to that layer has had to patch both copies:bf4c4c7(#35028)gather-release-data2825aff(#37140)02e9601(#37213)(#N)squash-subject regexTwo for two, and both were duplicated bugs: same defect, shipped twice, found twice, fixed twice.
The original author saw it coming.
release-qa-status/src/github.tsopens with:This is later.
What moved — ~184 lines, verbatim
resolvePRNumbersfetchCommitRangelistStandardReleaseTagsonThrottlecreateOctokitfindPreviousTagparseRepoCommitInfo,ReleaseRefWhat deliberately did not move
fetchPRDetails. Same name, different product: the QA report needsurl/author/authorType/externalRefs; the changelog needs a truncatedbodyand no author. Merging them means a union return type with each caller ignoring half of it.categorize,qa,exclusions,formatand bothindex.tsare untouched. The cut is transport vs. domain — nearly the boundary the file layout already implied.One test deleted rather than moved
release-qa-status/src/github.test.tsexisted solely to assert itsfindPreviousTagmatched the other copy's:A test that guards against drift between two copies is obsolete once there is one copy. Its three cases are already covered in
shared/github.test.ts.Mechanics
.github/scripts/— one install, one lockfile instead of two, and@octokit/*resolves from the shared module.../../shared/githubby relative path, so there is no build-ordering step between packages.gather-release-datanow runs throughts-node, whichrelease-qa-statusalready did. That drops a build step from the release-notes workflow and removes therootDirconstraint that otherwise blocks importing../shared.tsc --noEmitstays as a type-check gate, so nothing is lost.Verification
gather-release-dataoverv26.08.24-01...v26.09.02-01(485 commits, 51 PRs): output byte-identical to the pre-refactor run. This is a pure refactor and the diff of the JSON proves it.release-qa-statusrenders its markdown report unchanged.npm cifrom the workspace root, then both scripts run exactly as the workflows invoke them.Follow-up worth doing separately
Nothing in CI runs
npm testfor these scripts. The tests only ever run locally. A PR-triggered job over.github/scripts/**is what would actually catch this class of regression — happy to file it if you want it.🤖 Generated with Claude Code