Skip to content

Convert release-branches.py and update-required-checks.sh to TypeScript#3575

Open
mbg wants to merge 22 commits intomainfrom
mbg/ts/sync-checks
Open

Convert release-branches.py and update-required-checks.sh to TypeScript#3575
mbg wants to merge 22 commits intomainfrom
mbg/ts/sync-checks

Conversation

@mbg
Copy link
Member

@mbg mbg commented Mar 16, 2026

Converts release-branches.py and update-required-checks.sh to TypeScript, similarly to what we have done for sync.py and sync_back.py recently.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Environments:

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).
  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • Other - Please provide details.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@mbg mbg self-assigned this Mar 16, 2026
@mbg mbg requested a review from a team as a code owner March 16, 2026 08:35
Copilot AI review requested due to automatic review settings March 16, 2026 08:35
@github-actions github-actions bot added the size/L May be hard to review label Mar 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.includes with freshly-created objects from toCheckInfo(...). Because includes checks 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")));
  });

@mbg mbg force-pushed the mbg/ts/sync-checks branch from 957c182 to c9ad41d Compare March 16, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L May be hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants