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
"Code scanning cannot determine the alerts introduced or fixed by this pull request" #1179
Comments
|
Early on, there was an analysis for python. See ddev/ddev@112ea75. The way that code scanning works is that it compares the latest analysis for the branch you are merging into with the analysis for the PR you are running (for each language). Code scanning then compares the two analyses to determine which alerts are new, fixed, or already existing. Since there was once an analysis uploaded for python (presumably by accident) into the main branc, code scanning is looking for a python analysis in your PR, but it's not finding one. The simplest thing to do is just delete the python analysis from your repo. See the GitHub API: https://docs.github.com/en/rest/code-scanning#delete-a-code-scanning-analysis-from-a-repository |
|
Thanks. It's not clear to me how to know the ANALYSIS_ID that needs to be deleted. Or did you perhaps delete it? I don't see this happening now. I used Originally the action had auto-detected python usage, and yes I had turned that off because it wasn't useful on this project. |
|
Hmmm...I didn't do anything. Your Code Scanning results pages are still showing a missing python analysis. I am not sure why it is not showing up when you list all the analyses. Let me ask internally. |
|
Ah...the python analyses do indeed exist, you just need to paginate your request. Try this instead: And you'll see the analyses for python. Something like this will work: This will delete the most recent analysis for python on the main branch. See the docs for how to delete all of the analyses. |
|
`gh api \
(using the python analysis found with "Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete" How do I specify I tried |
|
Not sure why that isn't working for you. Maybe try the curl variant of the API (just replace |
|
Well, I used the curl to get rid of that one, but there are more, and
gets {
"message": "Analysis specified is not deletable.",
"documentation_url": "https://docs.github.com/rest/reference/code-scanning#delete-a-code-scanning-analysis-from-a-repository"
}I see that that one has {
"ref": "refs/heads/master",
"commit_sha": "125f700de5ae37d9686359a4a6bff4aea9b0f2a3",
"analysis_key": ".github/workflows/codeql.yml:analyze",
"environment": "{\"language\":\"python\"}",
"category": ".github/workflows/codeql.yml:analyze/language:python",
"error": "",
"created_at": "2022-06-03T23:27:27Z",
"results_count": 0,
"rules_count": 34,
"id": 31308286,
"url": "https://api.github.com/repos/drud/ddev/code-scanning/analyses/31308286",
"sarif_id": "bad68c30-e394-11ec-90b4-161f2c5671f5",
"tool": {
"name": "CodeQL",
"guid": null,
"version": "2.9.2"
},
"deletable": false,
"warning": ""
},In fact, there are several more python items that are not deletable, and there are 16,900 of these python ones still out there. Is this a lost cause? Is there any way to wipe it all out and start over? I thought probably codeql had some value but am not seeing it at this point. |
|
I apologize that you are having so much difficulty with this and I understand your frustration. Managing and deleting old analyses is something we are discussing internally to make this process easier. I'm discussing internally to see what the best way forward is. |
|
Thanks. I think there's a bug here too... the OP describes misbehavior, not just something I can fix by deleting one analysis, and there's nothing that was done wrong in the use of this action. So:
|
I ran this command couple of times until this stopped returning code-scanning results |
Recently I see failures always from codeql, "Code scanning cannot determine the alerts introduced or fixed by this pull request"
Although I have only the go language configured:
(See https://github.com/drud/ddev/blob/a5edc5dde1a630658d7acfded2bfd11b53811f25/.github/workflows/codeql.yml#L32-L37)
it still complains that it can't find a python run.

Is this because it's a forked PR perhaps? Anyway, it's pretty unuseful behavior.
Result is in https://github.com/drud/ddev/pull/4118/checks?check_run_id=7822079521
The text was updated successfully, but these errors were encountered: