GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Convert `sync.py` to TypeScript by mbg · Pull Request #3526 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Feb 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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 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.

Follow-up in #3529 for sync_back.py.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 22 commits February 28, 2026 15:58
@mbg
Scaffold project for sync.ts script
c7e378f
@mbg
Add specification types
2f77cd0
@mbg
Add defaultTestVersions constant
04c1e60
@mbg
Strip trailing whitespace in output
898d46e
@mbg
Add isTruthy helper
efe64e0
@mbg
Add basic workflow construction
40aefb0
@mbg
Add concurrency settings
6932b1c
@mbg
Add matrix construction
63b4776
@mbg
Add job construction
e62a268
@mbg
Add matrix to job
dd78add
@mbg
Add permissions
9a0fe9e
@mbg
Add CODEQL_ACTION_TEST_MODE
b77ebbe
@mbg
Add env, container, and services
c889588
@mbg
Add basic job steps
b948e56
@mbg
Add useAllPlatformBundle
d52917b
@mbg
Add analysisKinds
57c7bc6
@mbg
Add tool-specific setup steps
96e6b65
@mbg
Track collections
47671ab
@mbg
Generate and write collections
a85af80
@mbg
Switch from js-yaml to yaml for better output formatting
0ea8490
@mbg
Switch sync.sh script to only use sync.ts
5876a93
@mbg
Adjust quotes and re-generate workflows
f91cab1
@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
@mbg
mbg marked this pull request as ready for review March 1, 2026 14:52
@mbg
mbg requested a review from a team as a code owner March 1, 2026 14:52
Copilot AI review requested due to automatic review settings March 1, 2026 14:52
Copilot started reviewing on behalf of mbg March 1, 2026 14:52
View session
Copilot AI reviewed Mar 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Replaces the Python-based PR-check workflow generator with a TypeScript implementation, updating the workflow-generation toolchain and regenerating the affected __*.yml workflows under .github/workflows.

Changes:

  • Added pr-checks/sync.ts (TypeScript replacement for sync.py) using the yaml package to preserve step formatting/comments.
  • Updated pr-checks/sync.sh to run the new generator via tsx and introduced a dedicated pr-checks/package.json + lockfile.
  • Regenerated the __*.yml workflows and made small formatting adjustments in a couple of check specs.

Reviewed changes

Copilot reviewed 42 out of 45 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.json Excludes pr-checks from the main TypeScript compilation scope.
eslint.config.mjs Ignores pr-checks/** for ESLint runs.
pr-checks/sync.ts New TypeScript workflow generator (replaces Python behavior).
pr-checks/sync.sh Switches generator execution from Python/ruamel to Node/tsx.
pr-checks/package.json Adds Node dependencies needed to run sync.ts.
pr-checks/package-lock.json Locks pr-checks generator dependencies for reproducibility.
pr-checks/.gitignore Ignores pr-checks/node_modules.
pr-checks/checks/upload-sarif.yml Minor formatting/quoting changes in if: conditions.
pr-checks/checks/bundle-from-nightly.yml Minor formatting change to if: condition style.
.github/workflows/__all-platform-bundle.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__analysis-kinds.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__analyze-ref-input.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__autobuild-action.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__autobuild-direct-tracing-with-working-dir.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__build-mode-autobuild.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__build-mode-manual.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__build-mode-none.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__build-mode-rollback.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__bundle-from-nightly.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__cleanup-db-cluster-dir.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__config-export.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__diagnostics-export.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__export-file-baseline-information.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__go-custom-queries.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__init-with-registries.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__job-run-uuid-sarif.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__language-aliases.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__local-bundle.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__multi-language-autodetect.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__packaging-codescanning-config-inputs-js.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__packaging-config-inputs-js.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__packaging-config-js.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__packaging-inputs-js.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__remote-config.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__resolve-environment-action.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__split-workflow.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__start-proxy.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__submit-sarif-failure.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__swift-custom-build.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__unset-environment.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__upload-ref-sha-input.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__upload-sarif.yml Regenerated workflow output (formatting/quoting changes).
.github/workflows/__with-checkout-path.yml Regenerated workflow output (formatting/quoting changes).
Files not reviewed (1)
  • pr-checks/package-lock.json: Language not supported

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/sync.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
Run npm ci in actions
8bfaf96
mbg added 2 commits March 1, 2026 16:03
@mbg
Replace remaining uses of sync.py
e931a24
@mbg
Remove sync.py
f0f92a1
@mbg mbg mentioned this pull request Mar 1, 2026
Convert sync_back.py to TypeScript #3529
Merged
esbena
esbena reviewed Mar 2, 2026
View reviewed changes

@esbena esbena left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

(submitting probably empty review for technical reasons, complete review will follow)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
esbena
esbena reviewed Mar 2, 2026
View reviewed changes
Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pr-checks/sync.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@esbena

esbena commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

LGTM, I only have some stylistic comments. The migration is pleasantly simple, and the near zero-diff strategy seems robust enough here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg added 5 commits March 2, 2026 14:03
@mbg
Merge remote-tracking branch 'origin/main' into mbg/pr-checks/ts
4ca0628
@mbg
Address basic style comments
41d5a06
@mbg
Remove isTruthy: consistently use booleans in templates
e7ec96c
@mbg
Type workflow input names
d09af9d
@mbg
Replace filename in CONTRIBUTING.md
c0b22b8
@mbg

mbg commented Mar 2, 2026

Copy link
Copy Markdown
Member Author

@esbena Thanks for the review! I think I have come up with reasonably good ways to address your feedback. In particular:

  • I have eliminated isTruthy entirely since that was mainly handling cases where we used strings instead of booleans in the specifications. I have changed them to all use booleans where isTruthy was previously used.
  • We didn't actually use the custom inputs in workflow specifications, so all of them were statically known in the script. I have typed them to make this more explicit.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg requested a review from esbena March 2, 2026 15:43
esbena
esbena approved these changes Mar 3, 2026
View reviewed changes

@esbena esbena left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the follow-ups. LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg added this pull request to the merge queue Mar 3, 2026
Merged via the queue into main with commit ff2daa0 Mar 3, 2026
244 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg deleted the mbg/pr-checks/ts branch March 3, 2026 11:06
This was referenced Mar 3, 2026
Add support for validation jobs to sync.ts, and refactor #3536
Closed
Add support for validation jobs to sync.ts, and refactor #3541
Merged
This was referenced Mar 5, 2026
Merge main into releases/v4 #3551
Merged
Merge releases/v4 into releases/v3 #3553
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@esbena esbena esbena approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mbg mbg

Labels

size/XXL May be extremely hard to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @esbena
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.