Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Mar 15, 2024
1 parent 7a32259 commit 1a36a05
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
10 changes: 6 additions & 4 deletions pkg/dashboard/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,11 @@ type CommitEventResult struct {
Status string `json:"status"`
StatusDesc string `json:"statusDesc"`

GitopsRef string `json:"gitopsRef"`
GitopsRepo string `json:"gitopsRepo"`
GitopsRef string `json:"gitopsRef,omitempty"`
GitopsRepo string `json:"gitopsRepo,omitempty"`

TriggeredBy string `json:"triggeredBy"`
Log string `json:"log"`
TriggeredImageBuildId string `json:"triggeredImageBuildId,omitempty"`
TriggeredDeployRequestId string `json:"triggeredDeployRequestId,omitempty"`
TriggeredBy string `json:"triggeredBy"`
Log string `json:"log,omitempty"`
}
23 changes: 13 additions & 10 deletions pkg/dashboard/server/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ func AsCommitEvent(event *model.Event) *api.CommitEvent {
releaseRequest = &r
} else if event.Type == model.ImageBuildRequestedEvent {
var r dx.ImageBuildRequest
err := json.Unmarshal([]byte(event.Blob), imageBuildRequest)
err := json.Unmarshal([]byte(event.Blob), &r)
if err != nil {
logrus.Warnf("could not unmarshal blob for: %s - %s", event.ID, err)
}
imageBuildRequest = &r
} else if event.Type == model.RollbackRequestedEvent {
var r dx.RollbackRequest
err := json.Unmarshal([]byte(event.Blob), rollbackRequest)
err := json.Unmarshal([]byte(event.Blob), &r)
if err != nil {
logrus.Warnf("could not unmarshal blob for: %s - %s", event.ID, err)
}
Expand All @@ -345,14 +345,17 @@ func AsCommitEvent(event *model.Event) *api.CommitEvent {
}

results = append(results, api.CommitEventResult{
App: app,
Env: env,
Status: r.Status.String(),
StatusDesc: r.StatusDesc,
GitopsRef: r.GitopsRef,
GitopsRepo: r.GitopsRepo,
TriggeredBy: r.TriggeredBy,
Log: r.Log,
App: app,
Env: env,
Status: r.Status.String(),
StatusDesc: r.StatusDesc,
GitopsRef: r.GitopsRef,
GitopsRepo: r.GitopsRepo,

TriggeredImageBuildId: r.TriggeredImageBuildRequestID,
TriggeredDeployRequestId: r.TriggeredDeployRequestID,
TriggeredBy: r.TriggeredBy,
Log: r.Log,
})
}

Expand Down

0 comments on commit 1a36a05

Please sign in to comment.