Skip to content

Question: How do I reinitialize/delete a CodeQL database for a language? #2609

Closed

Description

@rzuckerm

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?

Activity

  1. rzuckerm commented on Nov 16, 2024

    @rzuckerm
    Author

    I tried deleting the C++ database using this REST API, but it didn't seem to work.

  2. aeisenberg commented on Nov 16, 2024

    @aeisenberg
    Contributor

    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.

  3. rzuckerm commented on Nov 16, 2024

    @rzuckerm
    Author

    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).

  4. aeisenberg commented on Nov 16, 2024

    @aeisenberg
    Contributor

    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.

  5. rzuckerm commented on Nov 16, 2024

    @rzuckerm
    Author

    I added this, and it didn't seem to help.

  6. rzuckerm commented on Nov 16, 2024

    @rzuckerm
    Author

    Maybe I need to wait until our repo gets reindexed (or whatever) for this to be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions