| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It isn't working, and this PR didn't break it. Let's fix it in a separate PR.
This doesn't give us much net new test coverage
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
This PR introduces bundling of the CodeQL Action using esbuild to replace the previous TypeScript compilation approach. The change aims to reduce download times, speed up workflows, and avoid Windows path length issues by consolidating dependencies into fewer files.
Copilot reviewed 63 out of 23839 changed files in this pull request and generated 1 comment.
Show a summary per file| File | Description |
|---|---|
| lib/setup-codeql.test.js | Updated bundled test file for CodeQL setup functionality |
| lib/setup-codeql.js | Updated bundled implementation file for CodeQL setup and download logic |
| lib/resolve-environment.js | Updated bundled utility for build environment resolution |
| lib/repository.js | Updated bundled repository utilities for GitHub repository handling |
| lib/overlay-database-utils.test.js | Updated bundled test file for overlay database functionality |
| lib/overlay-database-utils.js | Updated bundled implementation for overlay database caching and management |
| lib/logging.js | Updated bundled logging utilities for Actions and runner logging |
| lib/languages.js | Updated bundled language enumeration definitions |
| lib/init.test.js | Updated bundled test file for initialization functionality |
| lib/init.js | Updated bundled initialization logic for CodeQL setup |
| lib/init-action-post-helper.test.js | Updated bundled test file for post-action helper functionality |
| lib/init-action-post-helper.js | Updated bundled post-action cleanup and SARIF upload logic |
| lib/git-utils.test.js | Updated bundled test file for Git utilities |
| lib/git-utils.js | Updated bundled Git operation utilities |
| lib/fingerprints.test.js | Updated bundled test file for SARIF fingerprinting |
| lib/fingerprints.js | Updated bundled SARIF fingerprinting implementation |
| lib/feature-flags.test.js | Updated bundled test file for feature flag functionality |
Sorry, something went wrong.
There was a problem hiding this comment.
Nice. I haven't tried this locally, but it looks good.
Sorry, something went wrong.
|
If I have time later, I'll try checking this PR out and making sure the dev flow still works for me. |
Sorry, something went wrong.
There was a problem hiding this comment.
Let's use npm ci instead of npm install in the workflows.
Sorry, something went wrong.
|
We'll need to update the set of required checks before merging this PR. |
Sorry, something went wrong.
There was a problem hiding this comment.
Let's run npm ci instead of npm install. Also don't forget to update poackage-lock.json`
Sorry, something went wrong.
There was a problem hiding this comment.
Avoid changing the module resolution system — this is tricky and requires us to change a lot of our unit tests.
Note that bundling CJS is less reliable than ESM due to its dynamic nature. ESBuild is designed with ESM in mind, and there has been (at least historically) some gotchas wrt. its CJS bundling.
Sorry, something went wrong.
Is there a different bundler you'd recommend for CJS? I chose ESBuild since it's much faster than webpack and we're using it successfully in other projects, but we could explore something else. |
Sorry, something went wrong.
It looks like the typescript-action template repo uses rollup, no idea if it is better. https://github.com/actions/typescript-action/blob/main/package.json#L33 . They used to use ncc but switched not to long ago to rollup: actions/typescript-action#969 |
Sorry, something went wrong.
I believe rollup was designed for ES modules perhaps more so than esbuild — you need to use a plugin to use it with CommonJS modules. |
Sorry, something went wrong.
esbuild has been my favourite tool for bundling. It's easy to use, still fairly flexible, and fast. I have only used it for ESM bundling, though. I know that vite has used esbuild for transpilation and rollup for bundling (not sure if still true). Historically webpack has had the best support for CJS bundling, but it is slow and bloated. I haven't kept up on the bundling scene the past 2 years though, so a lot may have happened... |
Sorry, something went wrong.
This means we avoid doing a type checking pass twice
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
The esbuild setup looks sound. You will likely want 👀 from somebody else as well as I don't know of the complexities around distributing codeql-action.
As I said, there can be nasty surprises when bundling CJS, so be sure to test various setups.
Sorry, something went wrong.
It's no longer needed since we aren't checking in `node_modules`.
There was a problem hiding this comment.
Looks good to me and I am happy with the testing we have done to believe that this doesn't break anything horribly.
There might be minor follow-up changes needed to edit documentation or some automation, but I think it's fine to ship-to-learn a change like this as long as we are happy that it doesn't break the actual functionality of the Action.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR bundles the Action using esbuild.
Reasoning
Downsides we should be aware of
Risk assessment
For internal use only. Please select the risk level of this change:
This is a risky change. Things I've done to minimise the risk:
Merge / deployment checklist