MCPcopy Create free account
hub / github.com/apache/devlake / getBambooHomePage

Function getBambooHomePage

backend/plugins/bamboo/tasks/shared.go:115–128  ·  view source on GitHub ↗

getBambooHomePage receive endpoint like "http://127.0.0.1:30001/rest/api/latest/" and return bamboo's homepage like "http://127.0.0.1:30001/"

(endpoint string)

Source from the content-addressed store, hash-verified

113
114// getBambooHomePage receive endpoint like "http://127.0.0.1:30001/rest/api/latest/" and return bamboo's homepage like "http://127.0.0.1:30001/"
115func getBambooHomePage(endpoint string) (string, error) {
116 if endpoint == "" {
117 return "", errors.Default.New("empty endpoint")
118 }
119 endpointURL, err := url.Parse(endpoint)
120 if err != nil {
121 return "", err
122 } else {
123 protocol := endpointURL.Scheme
124 host := endpointURL.Host
125 bambooPath, _, _ := strings.Cut(endpointURL.Path, "/rest/api/latest")
126 return fmt.Sprintf("%s://%s%s", protocol, host, bambooPath), nil
127 }
128}
129
130// generateFakeRepoUrl will return a fake url for repo url field.
131func generateFakeRepoUrl(endpoint string, repoId int) (string, error) {

Callers 4

ExtractPlanBuildFunction · 0.85
ConvertPlansFunction · 0.85
Test_getBambooWebURLFunction · 0.85
ConvertPlanBuildsFunction · 0.85

Calls 1

NewMethod · 0.65

Tested by 1

Test_getBambooWebURLFunction · 0.68