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
.
-
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). These are automatically deleted every time cpp-linter-action runs. -
file-annotations
are comments posted within the diff for an event.
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.