synopsys-sig / synopsys-action

Synopsys Action consuming Synopsys scanning tools
Apache License 2.0
23 stars 16 forks source link

blackduck_automation_prcomment with GitHub Enterprise #111

Closed Carsten87 closed 7 months ago

Carsten87 commented 1 year ago

How can I configure the synopsys-action to work with GitHub Enterprise? If I set blackduck_automation_prcomment: true the action tries to communicate with github.com instead of the GH Enterprise instance the action is running on which obviously fails.

I think the action itself should figure out where it is running and select the appropriate API endpoint accordingly.

2023-06-16 10:34:37.7338 CEST [GitHub Commenter] INFO: will use default GitHub API URL "https://api.github.com/", as "github.api.url" is not configured
2023-06-16 10:34:37.9617 CEST [GitHub Commenter] ERROR: authorization failure - please check if the value configured for "github.user.token" has appropriate permissions: Bad credentials: Received unexpected response status code '401 Unauthorized' from GitHub API
2023-06-16 10:34:37.9874 CEST [GitHub Commenter] ERROR: Adapter failed: exit status 1
Error: Workflow failed! Exit Code: 2 Error from adapter end
frederikb commented 1 year ago

I can confirm. We're running into the same problem.

Looking at the implementation of tools-parameter.ts there seems to be no override possible, even though the Synopsys Bridge exposes the setting github.api.url. I would be fine with an additional optional input parameter to the action itself which defaults to "GitHub", but allows me to override with our GHES domai.

tvcsantos commented 1 year ago

Actually there is no need for a custom input parameter the API URL is already provided out-of-the-box in GitHub actions context by the env variable GITHUB_API_URL.

tvcsantos commented 1 year ago

A PR #115 was opened to address this issue.

sig-tithi commented 1 year ago

We are working on it and fix will be available sometime next month.

tvcsantos commented 1 year ago

We are working on it and fix will be available sometime next month.

Nice 👍 . Thanks for the feedback

ToWi87 commented 1 year ago

Hello @tvcsantos, I just tried to verify your fix, but am running in a new problem: [GitHub Commenter] ERROR: Not Found: Received unexpected response status code '404 Not Found' from GitHub API

What settings did you run this so it worked? I didn't change anything beside using your PR's code.

tvcsantos commented 1 year ago

Hello @tvcsantos, I just tried to verify your fix, but am running in a new problem: [GitHub Commenter] ERROR: Not Found: Received unexpected response status code '404 Not Found' from GitHub API

What settings did you run this so it worked? I didn't change anything beside using your PR's code.

Hey @ToWi87, we are facing the same problem. This PR only addresses the URL change. Since synopsys uses bridge to do the remaining steps and bridge is a blackbox and I don't have access to the code I was not able to investigate further :(.

gonmmarques commented 1 year ago

We are working on it and fix will be available sometime next month.

Hello, by any chance can you please share when this might be available? Thanks

gonmmarques commented 1 year ago

We are working on it and fix will be available sometime next month.

Hello again, we are already mid September, any ETA here? @spurohitsynopsys (sorry for tagging but no one seems to reply here)

sig-tithi commented 1 year ago

@gonmmarques - Apologies for the delay. We couldn't look into or verify this issue during our past release due to some infrastructure issue on our end and also other priority items. We will look into this and keep you posted.

ToWi87 commented 1 year ago

Hello again, after seeing this: https://github.com/synopsys-sig/synopsys-action/releases/tag/v1.5.0 I briefly tried to run this with blackduck_automation_prcomment: true

Here my feedback:

Run synopsys-sig/synopsys-action@v1.5.0
Synopsys Action started...
Blackduck Automation comment is enabled
Error: Workflow failed! Missing required github token for fix pull request/automation comment

And then the whole step is killed.

My GH Action config is (as of https://sig-product-docs.synopsys.com/bundle/bridge/page/documentation/c_additional-github-parameters.html) set to image

Can someone confirm this?

ToWi87 commented 1 year ago

update from myself:

with:
  github_token: ${{ github.token }} (instead of secrets.GITHUB_TOKEN as mentioned in the docs)

I am back to my initial 404 report: https://github.com/synopsys-sig/synopsys-action/issues/111#issuecomment-1684027951

sig-tithi commented 1 year ago

The fix is not yet available, we are working with our internal teams to prioritise it.

benlamm-abi commented 12 months ago

Any updates here? May be there is already a prediction for the release date of the fix, so that we can better plan further steps? What is the official workaround? Using Detect Rapid Scan Action?

sig-tithi commented 9 months ago

Any updates here? May be there is already a prediction for the release date of the fix, so that we can better plan further steps? What is the official workaround? Using Detect Rapid Scan Action?

Carsten87 commented 8 months ago

I can confirm that it works on my end now.