Skip to content

Commit

Permalink
fix(cloudevents): fix error for case run report (#68)
Browse files Browse the repository at this point in the history
error: missing required field "ProblemCaseRun.reason"
Signed-off-by: wuhuizuo <wuhuizuo@126.com>

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo authored Jan 5, 2024
1 parent b33e8e2 commit 8e81412
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 5 deletions.
3 changes: 3 additions & 0 deletions cloudevents-server/configs/example-config-sqlite3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ lark:
app_id: cli_12345678
app_secret: s123456789
receiver: abc@test.com
tibuild:
result_sink_url: http://localhost:49244 # url of tibuild events listener.
trigger_sink_url: http://localhost:8080 # url of tekton event listener.
11 changes: 8 additions & 3 deletions cloudevents-server/ent/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

128 changes: 128 additions & 0 deletions cloudevents-server/ent/problemcaserun_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cloudevents-server/ent/runtime/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (h *Handler) addRecords(ctx context.Context, caseData map[string]ProblemCas
SetBuildURL(buildURL).
SetTimecostMs(int(timecost * 1000)).
SetReportTime(reportTime).
SetReason(reasonNA).
SetFlaky(false)
if timecost < 0 {
entry.SetReason(reasonNotFinished)
Expand Down
1 change: 1 addition & 0 deletions cloudevents-server/pkg/events/custom/testcaserun/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const (

reasonNotFinished = "not_finished"
reasonUnknown = "unknown"
reasonNA = "N/A"
)

// ProblemCasesFromBazel present case run records from bazel.
Expand Down

0 comments on commit 8e81412

Please sign in to comment.