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
avoid duplicate docbot comment #56
Conversation
Signed-off-by: tison <wander4096@gmail.com>
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("%s", MessageLabelMissing) | |
return nil; |
There was a problem hiding this comment.
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.
Sorry that I forget to review the return value. |
ping @maxsxu @michaeljmarshall |
There was a problem hiding this 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!
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