MCPcopy Index your code
hub / github.com/apache/devlake / ToJenkinsJob

Method ToJenkinsJob

backend/plugins/jenkins/models/response.go:46–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func (j Job) ToJenkinsJob() *JenkinsJob {
47 if j.FullName == "" {
48 if j.Name != "" || j.Path != "" {
49 beforeNames := strings.Split(j.Path, "/")
50 befornName := ""
51 for i, part := range beforeNames {
52 if i%2 == 0 && part == "job" {
53 continue
54 }
55 if part == "" {
56 continue
57 }
58 befornName += part + "/"
59 }
60 j.FullName = befornName + j.Name
61 }
62 }
63
64 return &JenkinsJob{
65 FullName: j.FullName,
66 Name: j.Name,
67 Path: j.Path,
68 Class: j.Class,
69 Color: j.Color,
70 Base: j.Base,
71 Url: j.URL,
72 Description: j.Description,
73 PrimaryView: j.URL + j.Path + j.Class,
74 }
75}
76
77type Project struct {
78 Class string `json:"_class"`

Callers 3

ExtractApiJobsFunction · 0.95
EnrichOptionsFunction · 0.80
listJenkinsRemoteScopesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected