-
Notifications
You must be signed in to change notification settings - Fork 351
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
Upload database with commit SHA and branch name #1399
Comments
Thanks for your feedback. I think this information is already available, though perhaps not quite in an easily accessible format:
Is this the information you are looking for? We can do better at exposing this information and we are discussing internally. |
@aeisenberg, thank you for your response.
It would be cool, if you could expose this information in the API response. We are working on some integration service and being able to quickly tell if the database same or different version of the source code, would be extremely helpful. |
Something to clarify here. The upload database request is not public API and is restricted to the default branch. We have no intention of changing that. The list databases request is public API and you will receive at most one database per language. When newer databases are uploaded for a language, the older one is no longer available. |
@aeisenberg, it's good that only default branch can be upload but, I see the following check in if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
// We only want to upload a database if we are analyzing the default branch.
logger.debug("Not analyzing default branch. Skipping upload.");
return;
} It looks like it is not the API restricting the user branch upload. I know that only one database per language can be uploaded and I really like it. We have GitHubApp that checks for CodeQL databases and downloads them into our internal archive. Right now, it's hard to tell from the API response, if the database changed. Unless I download it and check the |
This is an internal, undocumented request. You should not be explicitly calling this request. I know the server side does some checking on the request data, but I am not sure exactly to what extent it checks. Are you downloading databases from third party repos and concerned that they may be calling this API in the wrong way?
We're discussing internally. |
@aeisenberg, you are correct. We are downloading databases from accounts/repos in our Enterprise github. Basically, creating archive of databases. In case of security incident, we can easily query all of the databases for a specific code pattern. The branch is not a big concern. The commit SHA (and ideally CodeQL version) in the API response would be really nice, thou... |
The commit SHA is now part of the API response, when getting CodeQL databases! Every database who is newly created will have the SHA. It will take some time until older databases - for which we hadn't stored the commit SHA - will be replaced by newer builds that include the SHA. |
The codeql version used to create the database is available in the |
Would it be possible to extend the CodeQL database upload/download API to contain the commit sha and branch name?
Having a database but not knowing which source code version it is belonging too, is not very useful.
This is code from
src/database-upload.ts
. Perfect place to pass the SHA and branch.When calling the database list API:
https://api.github.com/repos/{repository full name}/code-scanning/codeql/databases
It would be nice to see the branch name and commit sha in the response.
The text was updated successfully, but these errors were encountered: