From 65c06b572236685a9bf3abc043d6d21efa2f2e09 Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:21:45 -0600 Subject: [PATCH] fix: attach metadata to build graph response (#1003) --- api/build/graph.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/api/build/graph.go b/api/build/graph.go index 40eeabf70..bc1c26319 100644 --- a/api/build/graph.go +++ b/api/build/graph.go @@ -30,9 +30,12 @@ import ( // // swagger:model Graph type Graph struct { - BuildID int64 `json:"build_id"` - Nodes map[int]*node `json:"nodes"` - Edges []*edge `json:"edges"` + BuildID int64 `json:"build_id"` + BuildNumber int `json:"build_number"` + Org string `json:"org"` + Repo string `json:"repo"` + Nodes map[int]*node `json:"nodes"` + Edges []*edge `json:"edges"` } // node represents a pipeline stage and its relevant steps. @@ -539,9 +542,12 @@ func GetBuildGraph(c *gin.Context) { // construct the response graph := Graph{ - BuildID: b.GetID(), - Nodes: nodes, - Edges: edges, + BuildID: b.GetID(), + BuildNumber: b.GetNumber(), + Org: r.GetOrg(), + Repo: r.GetName(), + Nodes: nodes, + Edges: edges, } c.JSON(http.StatusOK, graph)