Skip to content

Convert most remaining CI scripts to TypeScript in pr-checks - #4064

Open
mbg wants to merge 8 commits into
mainfrom
mbg/ts/remaining-scripts
Open

mbg wants to merge 8 commits into
mainfrom
mbg/ts/remaining-scripts

Conversation

@mbg

@mbg mbg commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

This PR converts most remaining CI scripts to TypeScript (if they weren't already) and integrates them with the sub-project in pr-checks. There are a couple or so left which I'll address separately in the future.

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 Jul 31, 2026
@github-actions github-actions Bot added size/M Should be of average difficulty to review size/XL May be very hard to review and removed size/M Should be of average difficulty to review labels Jul 31, 2026
@mbg
mbg force-pushed the mbg/ts/remaining-scripts branch from c30ddcc to 86a0c12 Compare July 31, 2026 13:24
@mbg
mbg force-pushed the mbg/ts/remaining-scripts branch from 86a0c12 to d8e40bf Compare July 31, 2026 13:38
@mbg
mbg force-pushed the mbg/ts/remaining-scripts branch from d8e40bf to 7e36708 Compare July 31, 2026 16:18
@mbg mbg changed the title Add remaining CI scripts to pr-checks Convert most remaining CI scripts to TypeScript in pr-checks Oct 14, 2026
@mbg
mbg marked this pull request as ready for review October 14, 2026 09:44
@mbg
mbg requested a review from a team as a code owner October 14, 2026 09:44
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The JavaScript check can miss generated files and omit its job summary, while moved-action paths may use an unpinned runtime dependency.

6 open findings
What changed in this PR

Converts remaining CI utilities into the pr-checks TypeScript project with unit coverage and shared helpers.

Changes:

  • Migrates bundle, SARIF, configuration, and generated-JavaScript checks.
  • Adds tests for migrated scripts.
  • Updates workflows and composite actions to invoke TypeScript scripts.
File Description
pr-checks/​update-release-branch.ts Uses shared command helpers.
pr-checks/​update-bundle.ts Adds TypeScript bundle updater.
pr-checks/​update-bundle.test.ts Tests bundle metadata updates.
pr-checks/​config.ts Exports source, library, and defaults paths.
pr-checks/​command.ts Adds shared command and Git helpers.
pr-checks/​check-sarif.ts Adds TypeScript SARIF validator.
pr-checks/​check-sarif.test.ts Tests SARIF validation.
pr-checks/​check-js.ts Replaces generated-JavaScript shell check.
pr-checks/​check-cs-config.ts Adds TypeScript configuration validator.
pr-checks/​check-cs-config.test.ts Tests configuration comparison.
.github/​workflows/​update-bundle.yml Runs the new bundle updater.
.github/​workflows/​script/​check-js.sh Removes superseded shell script.
.github/​workflows/​pr-checks.yml Runs the TypeScript JavaScript check.
.github/​actions/​update-bundle/​index.ts Removes the old updater implementation.
.github/​actions/​update-bundle/​action.yml Removes the old composite updater.
.github/​actions/​check-sarif/​index.js Removes the old SARIF implementation.
.github/​actions/​check-sarif/​action.yml Delegates SARIF validation to pr-checks.
.github/​actions/​check-codescanning-config/​index.ts Removes the old configuration checker.
.github/​actions/​check-codescanning-config/​action.yml Delegates configuration validation to pr-checks.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}'
run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS"
run: |
npx tsx ../action/pr-checks/check-cs-config.ts \
--queries-run "$QUERIES_RUN" \
--queries-not-run "$QUERIES_NOT_RUN"
else
npx tsx ../action/pr-checks/check-sarif.ts \
Comment thread pr-checks/check-js.ts
function main() {
// Sanity check that repo is clean to start with
try {
runGit(["diff", "--exit-code"], { allowNonZeroExitCode: false });
Comment thread pr-checks/check-js.ts
Comment on lines +50 to +51
core.summary.addHeading("Transpiled JS diff", 3);
core.summary.addCodeBlock(fs.readFileSync(diffFile, "utf-8"), "diff");
Comment on lines +19 to +22
await it("passes when queries arrays match after sorting", () => {
const actual: UserConfig = { paths: ["b", "a", "c"] };
const expected = JSON.stringify(actual);
assert.doesNotThrow(() => checkConfiguration(actual, expected));
Comment thread pr-checks/config.ts
const SOURCE_ROOT = path.join(REPO_ROOT, "src");
export const SOURCE_ROOT = path.join(REPO_ROOT, "src");

/** The `src` directory. */

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL May be very hard to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants