Skip to content
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

semver_checks: Edit comment instead of posting new one #952

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Lorak-mmk
Copy link
Collaborator

@Lorak-mmk Lorak-mmk commented Mar 9, 2024

Up until now semver_checks CI posted a new comment after each push to a PR if such push resulted in PR (still) having breaking changes.
This was quite spammy for PRs that intentionally made breaking changes, because each and every push resulted in a new comment.

This commit changes the CI so that it edits already posted comment, and only posts a new one when there was none before.

If there are multiple comments already (as is the case with already open PRs) then the oldest one will be chosen for edit.
The aim is to always have semver status immediately below PR description.

Fixes: #938

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Up until now semver_checks CI posted a new comment after each push to
a PR if such push resulted in PR (still) having breaking changes.
This was quite spammy for PRs that intentionally made breaking changes,
because each and every push resulted in a new comment.

This commit changes the CI so that it edits already posted comment,
and only posts a new one when there was none before.

If there are multiple comments already (as is the case with already
open PRs) then the oldest one will be chosen for edit.
The aim is to always have semver status immediately below PR description.
@Lorak-mmk Lorak-mmk force-pushed the semver-checks-edit-comment branch from a88bf6a to a875d12 Compare March 10, 2024 20:09
@Lorak-mmk Lorak-mmk marked this pull request as ready for review March 10, 2024 20:10
@Lorak-mmk Lorak-mmk force-pushed the semver-checks-edit-comment branch 2 times, most recently from 5964539 to a875d12 Compare March 12, 2024 13:23
Copy link
Collaborator

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been successfully tested on mock PR: #953

@Lorak-mmk Lorak-mmk merged commit 07df198 into main Mar 12, 2024
32 of 33 checks passed
@Lorak-mmk Lorak-mmk deleted the semver-checks-edit-comment branch March 12, 2024 13:57
@Lorak-mmk Lorak-mmk mentioned this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: semver-checks generates a lot of GitHub comments
3 participants