Convert release-branches.py and update-required-checks.sh to TypeScript#3575
Open
Convert release-branches.py and update-required-checks.sh to TypeScript#3575
release-branches.py and update-required-checks.sh to TypeScript#3575Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates internal release/maintenance scripts from Python/Shell to TypeScript under pr-checks, aligning with the recent TS conversions in the same area of the repo.
Changes:
- Add TypeScript equivalents for release-branch backport targeting and required-checks syncing (
pr-checks/release-branches.ts,pr-checks/sync-checks.ts) plus unit tests. - Introduce shared config (
pr-checks/config.ts) and an exclusions YAML for required-check filtering. - Update release composite actions and docs to invoke the new TS script and reference the new config location.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pr-checks/sync-checks.ts | New TS script to compute/apply required checks and exclude configured checks. |
| pr-checks/sync-checks.test.ts | Unit tests for exclusion filtering logic. |
| pr-checks/release-branches.ts | New TS script to compute backport source/target branches and set outputs. |
| pr-checks/release-branches.test.ts | Unit tests for backport branch computation. |
| pr-checks/config.ts | New constant for oldest supported major version used by TS scripts. |
| pr-checks/excluded.yml | New configuration file for required-check exclusions. |
| pr-checks/package.json | Add devDependencies needed for the new TS scripts. |
| package-lock.json | Lockfile updates for the new pr-checks devDependencies. |
| CONTRIBUTING.md | Documentation update to point to pr-checks/config.ts for OLDEST_SUPPORTED_MAJOR_VERSION. |
| .github/actions/release-initialise/action.yml | Add Node setup to support running TS tooling during release workflows. |
| .github/actions/release-branches/action.yml | Switch from Python script invocation to npx tsx running the TS script. |
Comments suppressed due to low confidence (1)
pr-checks/sync-checks.test.ts:51
- These assertions use
Array.prototype.includeswith freshly-created objects fromtoCheckInfo(...). Becauseincludeschecks referential equality for objects, these checks will always pass even if the item is present, making the test ineffective. Compare on a stable key (e.g.,.some(c => c.context === ...)) or assert the retained contexts instead.
assert.equal(retained.length, 2);
assert.ok(!retained.includes(toCheckInfo("https://example.com")));
assert.ok(!retained.includes(toCheckInfo("PR Check - Foo")));
});
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.
Converts
release-branches.pyandupdate-required-checks.shto TypeScript, similarly to what we have done forsync.pyandsync_back.pyrecently.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Environments:
How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist