Skip to content

Commit

Permalink
fix: attach metadata to build graph response (#1003)
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Nov 7, 2023
1 parent 31dd3f7 commit 65c06b5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions api/build/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 65c06b5

Please sign in to comment.