Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attach metadata to build graph response #1003

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading