-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for releaseServerUrl #70
Conversation
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.
Left some minor comments, but LGTM otherwise.
action.yml
Outdated
@@ -21,6 +21,9 @@ inputs: | |||
detectorsFilter: | |||
description: 'A comma separated list with the identifiers of the specific detectors to be used. This is meant to be used for testing purposes only.' | |||
required: false | |||
releaseServerUrl: | |||
description: 'The baseUrl of the release server to use. If you set this, it should be set to `https://api.github.com`' |
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.
This description is a bit confusing to me: Does it mean that https://api.github.com
is the default value, in which case we should change the wording. I don't think it does now that I looked at the code.
Otherwise, if it means that https://api.github.com
is the only possible valid value, then we should probably hardcode the url and use a boolean instead to trigger that option.
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.
Yeah, that is confusing. Let me figure that out and update.
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.
Ok, I see what the original intent was and I rewrote it so that it should work without setting any configuration options. I'm going to try to test this in a real GHES instance to make sure.
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.
Mostly LGTM too! Pulled down the branch and ran the tests just in case.
I got this timeout error a couple times but after reloading the codespace I haven't encountered it again. Looks like it might've been an issue with my machine
● Downloads CLI
thrown: "Exceeded timeout of 5000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
10 | await ComponentDetection.downloadLatestRelease();
11 | await ComponentDetection.runComponentDetection("./test");
> 12 | expect(fs.existsSync(ComponentDetection.outputPath));
| ^
13 | });
14 |
15 | test("Parses CLI output", async () => {
at componentDetection.test.ts:12:1
Thanks @bteng22, I wonder if that was just a weird fluke. I haven't seen that in any of my test runs, nor has it been happening in CI. I've now confirmed that this works in GHES 3.13 and on github.com, so I think it's ready to merge and release. I'll do that on Monday, though, to avoid tempting fate. |
Hi juxtin, I tried implementing the action against the latest version Following the release of the new version, v0.0.3 and the conversion here: Fixed-issue, I tried to implement the following on my end:
But still end up with the same error as below:
|
This is based on #67, with one additional commit to fix tests. Since @jhutchings1 has sadly moved on to other things, I've taken over this PR to see it through.
Original PR description from #67:
– @jhutchings1
That's the main part of the PR. The part that I added was using
babel-jest
to fix the tests. In short, tests were failing because Jest couldn't properly handle ES modules likeoctokit
and@github/dependency-submission-toolkit
, which are mixed with CommonJS modules in this project. Addingbabel-jest
allows Jest to transform those modules on the fly so that they can be used in tests. It has no effect on the actual code.I also removed the configuration option because it only had one possible value and only in one specific case, which I think we can detect automatically. In this version, it should Just Work™ without any intervention.