Skip to content

Commit

Permalink
feat(cloudevents-server): support new events for tibuild
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed May 6, 2024
1 parent 6592f5d commit 6a033f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cloudevents-server/pkg/events/custom/tibuild/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ func (h *triggerHandler) SupportEventTypes() []string {
return []string{
EventTypeDevbuildFakeGithubCreate,
EventTypeDevbuildFakeGithubPush,
EventTypeDevbuildFakeGithubPullRequest,
EventTypeHotfixFakeGithubCreate,
EventTypeHotfixFakeGithubPush,
EventTypeHotfixFakeGithubPullRequest,
}
}

Expand Down
10 changes: 6 additions & 4 deletions cloudevents-server/pkg/events/custom/tibuild/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package tibuild

const (
EventTypeDevbuildFakeGithubPush = "net.pingcap.tibuild.devbuild.push" // Fake GitHub push events in the development build.
EventTypeDevbuildFakeGithubCreate = "net.pingcap.tibuild.devbuild.create" // Fake GitHub create events in the development build.
EventTypeHotfixFakeGithubPush = "net.pingcap.tibuild.hotfix.push" // Fake GitHub push events in the hotfix build.
EventTypeHotfixFakeGithubCreate = "net.pingcap.tibuild.hotfix.create" // Fake GitHub create events in the hotfix build.
EventTypeDevbuildFakeGithubPush = "net.pingcap.tibuild.devbuild.push" // Fake GitHub push events in the development build.
EventTypeDevbuildFakeGithubCreate = "net.pingcap.tibuild.devbuild.create" // Fake GitHub create events in the development build.
EventTypeDevbuildFakeGithubPullRequest = "net.pingcap.tibuild.devbuild.pull_request" // Fake GitHub pull request events in the development build.
EventTypeHotfixFakeGithubPush = "net.pingcap.tibuild.hotfix.push" // Fake GitHub push events in the hotfix build.
EventTypeHotfixFakeGithubCreate = "net.pingcap.tibuild.hotfix.create" // Fake GitHub create events in the hotfix build.
EventTypeHotfixFakeGithubPullRequest = "net.pingcap.tibuild.hotfix.pull_request" // Fake GitHub pull request events in the hotfix build.
)
2 changes: 1 addition & 1 deletion tibuild/pkg/rest/service/dev_build_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s DevbuildServer) Create(ctx context.Context, req DevBuild, option DevBuil
if err != nil {
slog.Error("save triggered entity failed", "reason", err)
}
return nil, fmt.Errorf("trigger jenkins fail: %w", ErrInternalError)
return nil, fmt.Errorf("trigger Tekton fail: %w", ErrInternalError)
}
}

Expand Down

0 comments on commit 6a033f9

Please sign in to comment.