-
Notifications
You must be signed in to change notification settings - Fork 21
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
Option to only post thread comment when errors are detected #158
Comments
There wasn't any "LGTM" comment before addressing cpp-linter/cpp-linter#24 (in cpp-linter pkg v1.6.0). It would make sense to add a input flag to disable those (and restore previous behavior). Personally I don't use the
You don't mention which events you use to trigger the cpp-linter-action. The push event does not have access to PR threads (as concluded in #154). |
Thanks for the quick response!
I see. Maybe we'll just disable the feature as well. The new step summary is a great replacement anyways!
We trigger on on:
push:
branches:
- main
pull_request: This leads to cpp-linter adding a comment to commits after PRs have been merged. See, for example, cda-tum/mqt-core@ba5244e#commitcomment-125027883 |
I suppose we could also just update an existing comment instead of deleteing any old cpp-linter comments and posting new ones... That should relieve your email inbox a bit, that may lead to the comment getting hidden in long PR threads.
You could also conditionally disable # only post comments for PR events
thread-comments: ${{ github.event_name == 'pull_request' }} |
I'd be fine with that. It's kind of how codecov handles it (at least in the default configuration). See https://docs.codecov.com/docs/pull-request-comments#behavior
Thanks for the suggestion. Sounds reasonable! |
BTW, I had begun work on a PR review feature but stopped when I realized that the clang-tidy suggestions couldn't be guaranteed to fit within the PR diffs... Couple that with clang-format suggestions (which might be duplicates based on the configured |
I totally understand that headache 🙃 What I get from the discussion here is that this issue might have revealed two areas for improvement:
|
Thanks for inquiring! This is being tracked by cpp-linter/cpp-linter#34 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
PR cpp-linter/cpp-linter#35 still needs testing, but it should be the solution. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The changes have been implemented downstream (in python src pkg). We'll start the new release cycle (& testing) soon. I've also found a way to fake a ternary operator in github action expression syntax: - name: Run linter as action
uses: cpp-linter/cpp-linter-action@latest
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# only update comments in a PR thread:
thread-comments: ${{ github.event_name == 'pull_request' && 'update' || 'false' }}
|
After some testing, the following value will work well to update existing comments on only PR threads: thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} Using this approach will also prevent comments getting posted for commits (push events). |
Also the new |
Hey 👋🏼
I was wondering whether you would be willing to introduce an option to only post thread comments when some errors have been detected?
The "no errors found" message creates quite some noise as it always causes an email/notifcation to be sent. Especially after merging a PR (where all errors have been resolved), the subsequent run on
main
always triggers such a message.Maybe some people fancy that, but it would be great to have an option to turn that behavior off (and, e.g., remove the previous thread comment if there are no more errors).
The text was updated successfully, but these errors were encountered: