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

Improve commenting logic to not produce repetitive comments #11

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

HappyTetrahedron
Copy link
Contributor

Summary

Previously, the bot would generally make a new comment when it had something to say on a particular PR, except in the case where the new comment would be exactly the same as the previous one (in which case no comment is created).

This turns out to be not quite good enough: on a regular MR that's waiting for its window, even if the status generally remains as "merge scheduled", the precise content of the comment could change slightly (e.g. when the MR becomes briefly unmergeable because tests rerun or the branch was updated), resulting in a string of similar-looking comments.

I thus devised a better system for comments. Comments now have a "title", which is written in bold. If the bot adds a new comment and detects that there is already a previous comment with the same title, the previous comment is updated. If the title differs, a new comment is always created - this way, we don't lose the record when potential errors occur, but we also don't flood the PR with repetitions of similar status updates. The most recent comment will always have the most recent status update.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.

@HappyTetrahedron HappyTetrahedron added the enhancement New feature or request label Jul 15, 2024
@HappyTetrahedron HappyTetrahedron requested a review from a team July 15, 2024 11:45
@HappyTetrahedron HappyTetrahedron merged commit 6bce9ed into master Jul 15, 2024
3 checks passed
@HappyTetrahedron HappyTetrahedron deleted the feat/improve-comment-logic branch July 15, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant