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 — Reduce duplication across JS bundles by creating one bundle with smaller entry point wrappers by mbg · Pull Request #3899 · github/codeql-action

Conversation

@mbg

@mbg mbg commented May 14, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Currently, we have a lot of duplication across the JS bundles that esbuild produces for each entry point. This PR fundamentally changes this as follows:

  • All CodeQL Action code is now bundled into entry-points.js. This avoids significant duplication across the individual bundles, since most of the Action's code is shared among the different actions.
  • We have new entry points for the individual actions, which import entry-points and call the relevant run function.
  • In the esbuild configuration, we mark entry-points as external, so that it is not bundled up with the entry point wrappers.

This reduces the size of the compressed repo. I tested the impact of this locally with a fresh, shallow checkout of the repo:

$ git clone [email protected]:github/codeql-action --depth=1 --branch mbg/esbuild/split
$ cd codeql-action
$ tar -czvf *

The resulting .tar.gz file is around ~2.9M. This is approximately a 70% reduction in archive size.

Risk assessment

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

  • High risk: Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.
  • Managed - Impacts users with dynamic workflows (Default Setup, Code Quality, ...).

Products:

  • Code Scanning - The changes impact analyses when analysis-kinds: code-scanning.
  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.
  • Other first-party - The changes impact other first-party analyses.
  • Third-party analyses - The changes affect the upload-sarif action.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency.
  • GHES - Impacts CodeQL workflows on GitHub Enterprise Server.
  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • Test repository - This change will be tested on a test repository before merging.
  • 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?

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

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

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.

jsoref reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@mbg
WIP: Reduce bundle duplication
237b03b
@github-actions github-actions Bot added the size/XXL May be extremely hard to review label May 14, 2026
@mbg mbg self-assigned this May 14, 2026
mbg added 4 commits May 14, 2026 14:47
@mbg
Update action specs for new entry points
f0489ab
@mbg
Add remaining new entry points
2f137c9
@mbg
Avoid top-level promise in analyze-action
bb30f31
@mbg
Fix linter errors
d7e50c2
@mbg
mbg marked this pull request as ready for review May 14, 2026 14:33
Copilot AI review requested due to automatic review settings May 14, 2026 14:33
@mbg
mbg requested a review from a team as a code owner May 14, 2026 14:33
@mbg mbg changed the title WIP: Reduce bundle duplication Reduce duplication across JS bundles by creating one bundle with smaller entry point wrappers May 14, 2026
Copilot started reviewing on behalf of mbg May 14, 2026 14:34
View session
Copilot AI reviewed May 14, 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

This PR reworks the esbuild output structure to reduce duplicated bundled code across the action entrypoints by introducing a shared entry-points bundle and small per-action wrapper entry files that call into it.

Changes:

  • Introduces src/entry-points.ts as a shared bundle that imports all action implementations and exposes run* functions.
  • Adds new *-entry.ts wrapper entrypoints for each action/post action, and updates each action.yml to reference the new wrapper outputs in lib/.
  • Updates the build configuration (build.mjs) to build the new entrypoints and mark ./entry-points as external for wrapper bundles; updates analyze tests to invoke runWrapper() directly.
Show a summary per file
File Description
upload-sarif/action.yml Point main/post to new wrapper bundles.
start-proxy/action.yml Point main/post to new wrapper bundles.
setup-codeql/action.yml Point main to new wrapper bundle.
resolve-environment/action.yml Point main to new wrapper bundle.
init/action.yml Point main/post to new wrapper bundles.
analyze/action.yml Point main/post to new wrapper bundles.
autobuild/action.yml Point main to new wrapper bundle.
build.mjs Switch entrypoints to *-entry.ts + entry-points.ts; externalize ./entry-points to reduce duplication.
src/entry-points.ts New shared entrypoint module that dispatches to each action’s runWrapper().
src/analyze-entry.ts New analyze wrapper entrypoint that calls into entry-points.
src/analyze-post-entry.ts New analyze-post wrapper entrypoint that calls into entry-points.
src/autobuild-entry.ts New autobuild wrapper entrypoint that calls into entry-points.
src/init-entry.ts New init wrapper entrypoint that calls into entry-points.
src/init-post-entry.ts New init-post wrapper entrypoint that calls into entry-points.
src/resolve-environment-entry.ts New resolve-environment wrapper entrypoint that calls into entry-points.
src/setup-codeql-entry.ts New setup-codeql wrapper entrypoint that calls into entry-points.
src/start-proxy-entry.ts New start-proxy wrapper entrypoint that calls into entry-points.
src/start-proxy-post-entry.ts New start-proxy-post wrapper entrypoint that calls into entry-points.
src/upload-sarif-entry.ts New upload-sarif wrapper entrypoint that calls into entry-points.
src/upload-sarif-post-entry.ts New upload-sarif-post wrapper entrypoint that calls into entry-points.
src/analyze-action.ts Export runWrapper() and remove import-time execution (runPromise/top-level invocation).
src/analyze-action-post.ts Export runWrapper() and remove top-level invocation.
src/autobuild-action.ts Export runWrapper() and remove top-level invocation.
src/init-action.ts Export runWrapper() and remove top-level invocation.
src/init-action-post.ts Export runWrapper() and remove top-level invocation.
src/resolve-environment-action.ts Export runWrapper() and remove top-level invocation.
src/setup-codeql-action.ts Export runWrapper() and remove top-level invocation.
src/start-proxy-action.ts Export runWrapper() and remove top-level invocation.
src/start-proxy-action-post.ts Export runWrapper() and remove top-level invocation.
src/upload-sarif-action.ts Export runWrapper() and remove top-level invocation.
src/upload-sarif-action-post.ts Export runWrapper() and remove top-level invocation.
src/analyze-action-input.test.ts Update test to call runWrapper() instead of awaiting a removed runPromise.
src/analyze-action-env.test.ts Update test to call runWrapper() instead of awaiting a removed runPromise.
lib/analyze-entry.js Generated wrapper bundle output (not reviewed).
lib/analyze-post-entry.js Generated wrapper bundle output (not reviewed).
lib/autobuild-entry.js Generated wrapper bundle output (not reviewed).
lib/init-entry.js Generated wrapper bundle output (not reviewed).
lib/init-post-entry.js Generated wrapper bundle output (not reviewed).
lib/resolve-environment-entry.js Generated wrapper bundle output (not reviewed).
lib/setup-codeql-entry.js Generated wrapper bundle output (not reviewed).
lib/start-proxy-entry.js Generated wrapper bundle output (not reviewed).
lib/start-proxy-post-entry.js Generated wrapper bundle output (not reviewed).
lib/upload-sarif-entry.js Generated wrapper bundle output (not reviewed).
lib/upload-sarif-post-entry.js Generated wrapper bundle output (not reviewed).

Copilot's findings

  • Files reviewed: 33/55 changed files
  • Comments generated: 3

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/entry-points.ts Resolved

Uh oh!

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

Comment thread src/analyze-action-input.test.ts Resolved

Uh oh!

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

Comment thread src/analyze-action-env.test.ts Resolved

Uh oh!

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

mbg added 3 commits May 14, 2026 18:13
@mbg
Auto-generate entry points
14085a6
@mbg
Auto-generate shared bundle
0d08c01
@mbg
Import and call runWrapper normally in analyze tests
52aafec
henrymercer
henrymercer reviewed May 14, 2026
View reviewed changes
Comment thread src/analyze-action-env.test.ts Resolved

Uh oh!

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

Comment thread src/analyze-action-input.test.ts Resolved

Uh oh!

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

Comment thread build.mjs Resolved

Uh oh!

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

@mbg
Improve pattern matching and error handling
dfa61e7
@henrymercer henrymercer mentioned this pull request May 14, 2026
Build: Generate shared entrypoint to reduce repo size #3902
Closed
mbg added 2 commits May 14, 2026 19:10
@mbg
Use src + basename in header to avoid issues on Windows
7fde13f
@mbg
Merge remote-tracking branch 'origin/main' into mbg/esbuild/split
127de81
@mbg
mbg requested a review from henrymercer May 14, 2026 19:02
henrymercer
henrymercer approved these changes May 15, 2026
View reviewed changes

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

I'd like to see a couple of things addressed, but it can be done as followup.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/analyze-action-env.test.ts Resolved

Uh oh!

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

Comment thread src/analyze-action-input.test.ts Resolved

Uh oh!

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

Comment thread build.mjs Resolved

Uh oh!

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

Comment thread build.mjs Resolved

Uh oh!

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

@mbg

mbg commented May 15, 2026

Copy link
Copy Markdown
Member Author

@henrymercer I agree with all points. I will merge this and then prepare a follow-up PR to address the comments.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mbg
mbg added this pull request to the merge queue May 15, 2026
@mbg mbg mentioned this pull request May 15, 2026
Address review comments for #3899 #3904
Merged
Merged via the queue into main with commit d4b4855 May 15, 2026
227 checks passed

Uh oh!

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

@mbg
mbg deleted the mbg/esbuild/split branch May 15, 2026 10:36
@github-actions github-actions Bot mentioned this pull request May 15, 2026
Merge main into releases/v4 #3905
Merged
6 of 8 tasks
mbg added a commit that referenced this pull request May 15, 2026
@mbg
Add changelog entry for #3899
6d7d599
@github-actions github-actions Bot mentioned this pull request May 15, 2026
Merge releases/v4 into releases/v3 #3907
Merged
16 of 18 tasks
pull Bot pushed a commit to ftos-forks/codeql-action that referenced this pull request May 15, 2026
@mbg
Merge pull request github#3904 from github/mbg/esbuild/split-follow-up
bbef5ff
Address review comments for github#3899
@github-actions github-actions Bot mentioned this pull request May 18, 2026
chore(ci)(deps): bump github/codeql-action from 3.35.4 to 4.35.5 ag-ui-protocol/ag-ui#1711
Closed
@github-actions github-actions Bot mentioned this pull request May 26, 2026
Bump github/codeql-action from 4.35.4 to 4.35.5 Chia-Network/chiavdf#364
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
@henrymercer henrymercer henrymercer 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 @henrymercer
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.