mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-28 05:47:08 +02:00
sonarExecuteScan: fix building the URL to call sonar API (#4105)
* Fix IssueService * Debug * Debug * Fix ComponentService * Clean up * Add comments
This commit is contained in:
parent
7f6fbe4bac
commit
d256c3a604
@ -43,11 +43,11 @@ type SonarLanguageDistribution struct {
|
||||
}
|
||||
|
||||
func (service *ComponentService) Component(options *MeasuresComponentOption) (*sonargo.MeasuresComponentObject, *http.Response, error) {
|
||||
if len(service.Branch) > 0 {
|
||||
options.Branch = service.Branch
|
||||
}
|
||||
// if PR, ignore branch name and consider PR branch name. If not PR, consider branch name
|
||||
if len(service.PullRequest) > 0 {
|
||||
options.PullRequest = service.PullRequest
|
||||
} else if len(service.Branch) > 0 {
|
||||
options.Branch = service.Branch
|
||||
}
|
||||
request, err := service.apiClient.create("GET", EndpointMeasuresComponent, options)
|
||||
if err != nil {
|
||||
|
@ -51,14 +51,14 @@ func (service *IssueService) getIssueCount(severity issueSeverity) (int, error)
|
||||
Resolved: "false",
|
||||
Ps: "1",
|
||||
}
|
||||
if len(service.Branch) > 0 {
|
||||
options.Branch = service.Branch
|
||||
}
|
||||
if len(service.Organization) > 0 {
|
||||
options.Organization = service.Organization
|
||||
}
|
||||
// if PR, ignore branch name and consider PR branch name. If not PR, consider branch name
|
||||
if len(service.PullRequest) > 0 {
|
||||
options.PullRequest = service.PullRequest
|
||||
} else if len(service.Branch) > 0 {
|
||||
options.Branch = service.Branch
|
||||
}
|
||||
result, _, err := service.SearchIssues(options)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user