maxsxu commented on code in PR #70:
URL: https://github.com/apache/pulsar-test-infra/pull/70#discussion_r965611984


##########
docbot/action.go:
##########
@@ -47,11 +48,17 @@ func NewActionWithClient(ctx context.Context, ac 
*ActionConfig, client *github.C
        }
 }
 
+const openedActionType = "opened"
+const editedActionType = "edited"
+const unlabeledActionType = "unlabeled"
+const labeledActionType = "labeled"
+
 func (a *Action) Run(prNumber int, actionType string) error {
        a.prNumber = prNumber
+       a.actionType = actionType
 
        switch actionType {
-       case "opened", "edited", "labeled", "unlabeled":
+       case openedActionType, editedActionType, labeledActionType, 
unlabeledActionType:

Review Comment:
   Suggest handling labeled and unlabled event in another case:



##########
docbot/action.go:
##########
@@ -47,11 +48,17 @@ func NewActionWithClient(ctx context.Context, ac 
*ActionConfig, client *github.C
        }
 }
 
+const openedActionType = "opened"
+const editedActionType = "edited"
+const unlabeledActionType = "unlabeled"
+const labeledActionType = "labeled"

Review Comment:
   Suggest using one const group like:
   ```
   
   const (
        openedActionType = "opened"
        editedActionType = "edited"
        unlabeledActionType = "unlabeled"
        labeledActionType = "labeled"
   )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to