Skip to content

Build overview: don't create comment for projects with empty diffs #12291

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

Merged
merged 9 commits into from
Jul 15, 2025

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jul 2, 2025

This is so we don't create comments when no files have been changed, but we still update the comment if we already reported a build with changed files.

@stsewd stsewd marked this pull request as ready for review July 9, 2025 19:20
@stsewd stsewd requested a review from a team as a code owner July 9, 2025 19:20
@stsewd stsewd requested a review from humitos July 9, 2025 19:20
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This is great, I just had a question on the control of the logic.

@humitos
Copy link
Member

humitos commented Jul 10, 2025

but we still update the comment if we already reported a build with changed files.

I don't remember were we ended finally. Are we posting only one comment or a comment per build/push? If we are posting multiple comments, what comment will we update when there is no file changes?

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This is great, I just had a question on the control of the logic.

@stsewd
Copy link
Member Author

stsewd commented Jul 10, 2025

I don't remember were we ended finally. Are we posting only one comment or a comment per build/push? If we are posting multiple comments, what comment will we update when there is no file changes?

One comment per project

@stsewd stsewd requested a review from ericholscher July 14, 2025 22:11
@@ -111,8 +111,13 @@ def get_clone_token(self, project):
"""Get a token used for cloning the repository."""
raise NotImplementedError

def post_comment(self, build, comment: str):
"""Post a comment on the pull request attached to the build."""
def post_comment(self, build, comment: str, update_only: bool = False):
Copy link
Member

Choose a reason for hiding this comment

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

Seems this didn't get updated?

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Pushed up a fix to the base, looks good to me.

@ericholscher ericholscher merged commit c9a398a into main Jul 15, 2025
7 checks passed
@ericholscher ericholscher deleted the dont-create-comment-for-empty-diffs branch July 15, 2025 09:15
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.

3 participants