You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: How do I reinitialize/delete a CodeQL database for a language? #2609
In this repo's security status for CodeQL there is an extra C++ file that accidentally got scanned in. I would like to delete or at least reinitialize the database so that I can get rid of that file. How do I do this?
The CodeQL Action uses the linguist API to determine which files belong to which language. As you can see from this search, [archive/h/hack/hello-world.hh](https://github.com/TheRenegadeCoder/sample-programs/blob/main/archive/h/hack/hello-world.hh) is considered a C++ file even though you delete it as part of the workflow.
Deleting the file doesn't work since linguist looks at the files as they are in the repo, not what you have on disk. Instead, you can try adding a linguist override.
I modified the workflow to remove the Hack files before doing a scan. The problem is that the Hack file is stuck in the database (even after deleting the C++ database).
No, the status page tells you that there was an extra file discovered in the repo, but it is not in the database. Simply deleting the file before won't change the file counts because of the way linguist works.
Activity
rzuckerm commentedon Nov 16, 2024
I tried deleting the C++ database using this REST API, but it didn't seem to work.
aeisenberg commentedon Nov 16, 2024
The CodeQL Action uses the linguist API to determine which files belong to which language. As you can see from this search,
[archive/h/hack/hello-world.hh](https://github.com/TheRenegadeCoder/sample-programs/blob/main/archive/h/hack/hello-world.hh)is considered a C++ file even though you delete it as part of the workflow.Deleting the file doesn't work since linguist looks at the files as they are in the repo, not what you have on disk. Instead, you can try adding a linguist override.
rzuckerm commentedon Nov 16, 2024
I modified the workflow to remove the Hack files before doing a scan. The problem is that the Hack file is stuck in the database (even after deleting the C++ database).
aeisenberg commentedon Nov 16, 2024
No, the status page tells you that there was an extra file discovered in the repo, but it is not in the database. Simply deleting the file before won't change the file counts because of the way linguist works.
rzuckerm commentedon Nov 16, 2024
I added this, and it didn't seem to help.
rzuckerm commentedon Nov 16, 2024
Maybe I need to wait until our repo gets reindexed (or whatever) for this to be fixed