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

avoid duplicate docbot comment #56

Merged
merged 2 commits into from Aug 16, 2022

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented Aug 13, 2022

We should send the comment only once when we add doc/label-missing label once.

Otherwise, it may produce duplicate comments which act as spam. For example, apache/pulsar#17009 (comment).

cc @michaeljmarshall @maxsxu @nodece

Signed-off-by: tison <wander4096@gmail.com>
docbot/main.go Outdated Show resolved Hide resolved
docbot/main.go Outdated Show resolved Hide resolved
Signed-off-by: tison <wander4096@gmail.com>
@@ -311,6 +311,11 @@ func (a *Action) onPullRequestOpenedOrEdited() error {

// Add missing label
if a.config.GetEnableLabelMissing() && checkedCount == 0 {
if _, exist := currentLabelsSet[a.config.GetLabelMissing()]; exist {
logger.Infoln("Already added missing label.")
return fmt.Errorf("%s", MessageLabelMissing)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("%s", MessageLabelMissing)
return nil;

Copy link
Member Author

Choose a reason for hiding this comment

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

We should return the error here. Still the pr needs a valid doc label. We just skip the create comment step.

docbot/main.go Show resolved Hide resolved
@nodece
Copy link
Member

nodece commented Aug 13, 2022

Sorry that I forget to review the return value.

@tisonkun
Copy link
Member Author

ping @maxsxu @michaeljmarshall

Copy link
Contributor

@maxsxu maxsxu left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for this improvement!

@tisonkun
Copy link
Member Author

tisonkun commented Aug 16, 2022

@maxsxu @nodece thanks for your review! Could you help with merging this patch?

@nodece nodece merged commit 88136c6 into apache:master Aug 16, 2022
@tisonkun tisonkun deleted the avoid-duplicate-docbot-comments branch August 16, 2022 13:25
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.

None yet

3 participants