Skip to content

Convert sync.py to TypeScript#3526

Draft
mbg wants to merge 22 commits intomainfrom
mbg/pr-checks/ts
Draft

Convert sync.py to TypeScript#3526
mbg wants to merge 22 commits intomainfrom
mbg/pr-checks/ts

Conversation

@mbg
Copy link
Member

@mbg mbg commented Feb 28, 2026

This PR takes a first step at converting a script from Python to TypeScript. Concretely, it replaces the sync.py script that turns our PR check specifications into GitHub Actions workflows with a roughly equivalent TypeScript replacement.

Initially, I aimed for exact textual equivalence in the output between the two scripts, but then I ultimately allowed a few minor changes:

  • The formatting of the steps from the specification is now preserved more accurately.
    • This mainly allows more comments from the specification to be preserved and in more accurate locations.
    • There are also some cases where there are now quoted strings in the output where there weren't quotes before. For consistency, all double quoted strings in the steps are converted to single quoted strings.
  • The yaml package allows for unlimited line length, which ruamel.yaml didn't quite handle correctly before, so some lines are no longer wrapped as intended.

I have left the sync.py script around for the minute, and I have not yet tackled any other scripts.

I initially started by using js-yaml, since we already use this elsewhere in the repo, but then switched to yaml since it gave me more control over the formatting.

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?

  • 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?

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

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 Feb 28, 2026
@github-actions github-actions bot added the size/XXL May be extremely hard to review label Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL May be extremely hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant