()
| 22 | } |
| 23 | |
| 24 | func (r *Reviewer) Review() { |
| 25 | if err := r.gitHub.Init(); err != nil { |
| 26 | r.logErrorAndExit("could not initialize GitHub client", err) |
| 27 | } |
| 28 | |
| 29 | if err := r.gitHub.InitIssue(); err != nil { |
| 30 | r.logErrorAndExit("could not initialize GitHub issue", err) |
| 31 | } |
| 32 | |
| 33 | r.application.Parse(r.gitHub.Issue) |
| 34 | |
| 35 | status := r.getStatus() |
| 36 | isClosed := *r.gitHub.Issue.State == "closed" |
| 37 | issueAuthor := *r.gitHub.Issue.User.Login |
| 38 | |
| 39 | r.updateLabels(status, isClosed) |
| 40 | r.createComment(status, isClosed, issueAuthor) |
| 41 | } |
| 42 | |
| 43 | func (r *Reviewer) getStatus() Status { |
| 44 | if r.gitHub.IssueHasLabel(LabelStatusApproved) { |
no test coverage detected