| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Pushed a commit to update the checked-in dependencies. Please mark the PR as ready for review to trigger PR checks. |
Sorry, something went wrong.
There was a problem hiding this comment.
Overall looks good to me 👍 added a few in-line comments.
Additional nit: could you make all the variables in the TS files camelCase to match the repo convention? Thanks 🙇
Sorry, something went wrong.
| @@ -0,0 +1,22 @@ | |||
| name: "CodeQL: Start proxy" | |||
| description: "Start HTTP proxy server" | |||
There was a problem hiding this comment.
| description: "Start HTTP proxy server" | |
| description: "[Experimental] Start HTTP proxy server" |
to match the other experimental actions.
Sorry, something went wrong.
| }, | ||
| { | ||
| name: "organizationName", | ||
| value: "GitHub ic.", |
There was a problem hiding this comment.
Gut check: is this meant to be GitHub inc or something like that? I wasn't able to find the expected value in our internal issues.
Sorry, something went wrong.
There was a problem hiding this comment.
Well spotted, it comes from the following place, which has the same spelling mistake ;-)
Sorry, something went wrong.
| }); | ||
| subprocess.on("exit", (code) => { | ||
| if (code !== 0) { | ||
| port = Math.floor(Math.random() * (65535 - 49152) + 49152); |
There was a problem hiding this comment.
Just curious: where does this rand calculation come from?
Sorry, something went wrong.
There was a problem hiding this comment.
I just wanted to write port = random_int_between(49152, 65535), but I could not find such a function in typescript. The range [49152 .. 65535] is the dynamic ports range, meant for temporary/client stuff. The randomness is to avoid collisions.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah got it — I wasn't sure why those numbers were chosen but makes sense that it's the range for dynamic ports 👍
Sorry, something went wrong.
There was a problem hiding this comment.
Co-pilot generated the following comment for the code:
// If the proxy failed to start, try a different port from the ephemeral range [49152, 65535]
Sorry, something went wrong.
| ); | ||
| subprocess.unref(); | ||
| if (subprocess.pid) { | ||
| core.saveState("proxy-process-pid", `${subprocess.pid}`); |
There was a problem hiding this comment.
TIL about saveState and getState 👍
Sorry, something went wrong.
| `start-proxy post-action step failed: ${wrapError(error).message}`, | ||
| ); | ||
| } | ||
| if (core.isDebug()) { |
There was a problem hiding this comment.
You might want to use config.debugMode instead here; we use this throughout to take into account the debug input parameter in the init action:
codeql-action/src/init-action.ts
Line 285 in 0e346f2
Sorry, something went wrong.
There was a problem hiding this comment.
Nice! Note, the start proxy action may have failed before the init step has run, so I added some code that tries to get the config and falls back on core.isDebug() if it is undefined.
Sorry, something went wrong.
There was a problem hiding this comment.
Makes sense to me 👍
Sorry, something went wrong.
|
We may want to add a changelog note indicating this is a new experimental action, probably something similar to this one resolve-environment: https://github.com/github/codeql-action/blob/main/CHANGELOG.md#2201---21-jun-2023. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for addressing all the comments — looks great to me!
Sorry, something went wrong.
There was a problem hiding this comment.
Nice!
Sorry, something went wrong.
|
@angelapwen When we do the next release, we'll probably want to add a commit to the v3 -> v2 backport PR to run this Action on Node 16. I wonder whether it's worth doing a release now so we don't forget — what do you think? |
Sorry, something went wrong.
|
Good point @henrymercer — I'll release earlier in the workday tomorrow. |
Sorry, something went wrong.
|
Kicking off the release now 🙏 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This pull request adds a new experimental action, codeql-action/start-proxy, which starts the HTTP proxy server that is also used by dependabot update jobs. The Action is used for an experimental implementation leveraging Dependabot's configurations and secrets by CodeQL Default Setup jobs that require access to private maven repositories.
Merge / deployment checklist