02ad0c0bf0
Due to unhandled errors within the SonarQube client, users may be presented with Go panics or just don't know what the root cause of a non-working bot is. Now it is possible to identify network errors, authentication issues or an incorrect bot configuration regarding SonarQube. Fixes: #20 Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
23 lines
452 B
Go
23 lines
452 B
Go
package sonarqube
|
|
|
|
type PullRequest struct {
|
|
Key string `json:"key"`
|
|
Status struct {
|
|
QualityGateStatus string `json:"qualityGateStatus"`
|
|
} `json:"status"`
|
|
}
|
|
|
|
type PullsResponse struct {
|
|
PullRequests []PullRequest `json:"pullRequests"`
|
|
Errors []Error `json:"errors"`
|
|
}
|
|
|
|
func (r *PullsResponse) GetPullRequest(name string) *PullRequest {
|
|
for _, pr := range r.PullRequests {
|
|
if pr.Key == name {
|
|
return &pr
|
|
}
|
|
}
|
|
return nil
|
|
}
|