Skip to content

Commit

Permalink
refactor: Change url -> dashboardUrl to make a place for another …
Browse files Browse the repository at this point in the history
…urls like logs url
  • Loading branch information
keskad committed Nov 25, 2023
1 parent afbbb24 commit 56f2e5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions pkgs/contract/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type PipelineInfo struct {
dateStarted time.Time
status Status
stages []PipelineStage
url string
dashboardUrl string
retrievalNum int
labels labels.Labels
annotations labels.Labels
Expand Down Expand Up @@ -116,9 +116,9 @@ func (pi PipelineInfo) GetInstanceName() string {
return pi.instanceName
}

// GetUrl returns a URL to some dashboard, where the pipeline could be looked up
func (pi PipelineInfo) GetUrl() string {
return pi.url
// GetDashboardUrl returns a URL to some dashboard, where the pipeline could be looked up
func (pi PipelineInfo) GetDashboardUrl() string {
return pi.dashboardUrl
}

// GetName returns a full object name, including namespace
Expand Down Expand Up @@ -167,7 +167,7 @@ func PipelineInfoWithLogsCollector(collector func() string) func(pipelineInfo *P
// PipelineInfoWithUrl is setting optionally a URL pointing to a Pipeline visualization
func PipelineInfoWithUrl(url string) func(pipelineInfo *PipelineInfo) {
return func(pipelineInfo *PipelineInfo) {
pipelineInfo.url = url
pipelineInfo.dashboardUrl = url
}
}

Expand All @@ -182,7 +182,7 @@ func NewPipelineInfo(scm JobContext, namespace string, name string, instanceName
stages: stages,
labels: labels,
annotations: annotations,
url: "",
dashboardUrl: "",
globalCfg: globalCfg,
logs: func() string {
return ""
Expand Down
6 changes: 3 additions & 3 deletions pkgs/feedback/jxscm/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const defaultProgressComment = `
| {{ $stage.Name }} | {{ if $stage.Status.IsNotStarted }}Pending{{ else if $stage.Status.IsRunning }}:hourglass_flowing_sand:{{ else if $stage.Status.IsErroredOrFailed }}:x:{{ else if $stage.Status.IsSucceeded }}:white_check_mark:{{ end }} |
{{- end }}
{{ if .pipeline.GetUrl }}- [Open in dashboard]({{ .pipeline.GetUrl }}){{ end }}
{{ if .pipeline.GetDashboardUrl }}- [Open in dashboard]({{ .pipeline.GetDashboardUrl }}){{ end }}
`

const defaultFinishedComment = `
Expand All @@ -39,7 +39,7 @@ The Pipeline finished with status '{{ .pipeline.GetStatus }}' {{ if .pipeline.Ge
~~~
{{ end }}
{{ if .pipeline.GetUrl }}- [Open in dashboard]({{ .pipeline.GetUrl }}){{ end }}
{{ if .pipeline.GetDashboardUrl }}- [Open in dashboard]({{ .pipeline.GetDashboardUrl }}){{ end }}
`

const markingBodyPart = `
Expand Down Expand Up @@ -250,7 +250,7 @@ func (jx *Receiver) updateCommitStatus(ctx context.Context, cfg config.Data, cli
State: overallStatus,
Label: "Pipeline - " + pipeline.GetFullName(),
Desc: ourStatus.AsHumanReadableDescription(),
Target: pipeline.GetUrl(),
Target: pipeline.GetDashboardUrl(),
},
)

Expand Down

0 comments on commit 56f2e5a

Please sign in to comment.