cpp-linter / cpp-linter-action

A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of file-annotations, thread-comments, workflow step-summary, and Pull Request reviews.

Home Page:https://cpp-linter.github.io/cpp-linter-action/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Needs option to delete old PR comments

turol opened this issue · comments

From chocolate-doom/chocolate-doom#1537
I got some (correct) complains about file src/hexen/p_action.h
I force-pushed the branch to correct them. The old comments were not deleted. This makes it hard to check if all the things have been fixed.

I have to check with the github REST API docs (optimistic it will help). My first guess is that the force push, which basically resets the branch's history, may be hiding the PR's full history, thus acting like a PR just opened.

Just to be clear, there is a difference between file-annotations and thread-comments.

  1. thread-comments look like user comments that are only displayed in the PR's thread (or after the diff for a commit on push events). image These are automatically deleted every time cpp-linter-action runs.

  2. file-annotations are comments posted within the diff for an event. image
    These cannot be deleted as they are specific to the commit that triggered the CI event. This is not our choice, it is a limitation of the workflow log commands that we use to post the annotations. Existing annotations cannot be fetched without recursively searching the parent commits (which would result in a catastrophic failure on forced pushed commits), and I'm still not sure its even possible to get a list of previous annotations via GitHub's REST API.

    I had initially planned to use GitHub's Checks API to post file-annotations, but I ended up going with workflow log commands because it didn't require a server constantly running a GitHub app (which costs 💰 AFAIK).

Therefore, we cannot offer an option to delete file-annotations. And thread-comments are automatically deleted on every run of cpp-linter-action. I'm closing this... Feel free to comment if I somehow misinterpreted the request.