diff --git a/hunk.go b/hunk.go index 600ae05c..38d937ad 100644 --- a/hunk.go +++ b/hunk.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/google/go-github/v57/github" + "github.com/qiniu/x/log" ) type HunkChecker interface { @@ -33,9 +34,10 @@ func NewGithubCommitFileHunkChecker(commitFiles []*github.CommitFile) (*GithubCo return nil, err } - _, ok := hunks[commitFile.GetFilename()] + v, ok := hunks[commitFile.GetFilename()] if ok { - return nil, fmt.Errorf("duplicate commitFile: %v", commitFile) + log.Warnf("duplicate commitFiles: %v, %v", commitFile, v) + continue } hunks[commitFile.GetFilename()] = fileHunks diff --git a/server.go b/server.go index ba205d4e..612583f7 100644 --- a/server.go +++ b/server.go @@ -53,7 +53,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (s *Server) processPullRequestEvent(log *xlog.Logger, event *github.PullRequestEvent, eventGUID string) error { - // TODO: synchonization 是什么意思? + // TODO: synchronization 是什么意思? if event.GetAction() != "opened" && event.GetAction() != "reopened" { log.Debugf("skipping action %s\n", event.GetAction()) return nil @@ -117,7 +117,7 @@ func (s *Server) handle(log *xlog.Logger, ctx context.Context, event *github.Pul log.Errorf("failed to build pull request comment body: %v", err) return err } - log.Infof("%s found valid %d comments related to this PR \n", name, len(comments)) + log.Infof("%s found valid %d comments related to this PR %d (%s) \n", name, len(comments), num, org+"/"+repo) totalComments = append(totalComments, comments...) }