Skip to content

Commit

Permalink
feat(api): add pipeline name to event job summary (#6106)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored Mar 7, 2022
1 parent b04e3e2 commit 2876a3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engine/api/workflow_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func NewEventJobSummary(wr sdk.WorkflowRun, noderun sdk.WorkflowNodeRun, jobrun
GitCommit: noderun.VCSHash,
}

node := wr.Workflow.WorkflowData.NodeByID(noderun.WorkflowNodeID)
if node != nil && node.Context != nil {
ejs.PipelineName = node.Context.PipelineName
}

if wr.Version != nil {
ejs.WorkflowRunVersion = *wr.Version
} else {
Expand Down
1 change: 1 addition & 0 deletions sdk/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ type EventJobSummary struct {
ProjectKey string `json:"project_key"`
Workflow string `json:"workflow"`
Pipeline string `json:"pipeline"`
PipelineName string `json:"pipeline_name"`
Job string `json:"job"`
WorkflowRunVersion string `json:"workflow_run_version"`
WorkflowRunNumber int `json:"workflow_run_number"`
Expand Down

0 comments on commit 2876a3c

Please sign in to comment.