Commit 7948db8
authored
feat(tibuild): add paramPluginGitRef CloudEvent extension (#531)
## Summary
Add `paramPluginGitRef` CloudEvent extension in tibuild's
`newDevBuildCloudEvents()` when `PluginGitRef` is non-empty.
## Changes
- `cloud_event_client.go`: Add conditional
`event.SetExtension("paramPluginGitRef", dev.Spec.PluginGitRef)` after
existing extensions
- `cloud_event_client_test.go`: Add 2 unit tests — non-empty (verifies
extension present) and empty (verifies extension absent)
## Testing
- `TestNewEventPluginGitRef`: PluginGitRef="release-8.5.4" → CloudEvent
includes `ce-paramPluginGitRef` header
- `TestNewEventPluginGitRefEmpty`: PluginGitRef="" → no
`paramPluginGitRef` extension
- Full package tests pass: `go test ./pkg/rest/service/`
- `go vet` clean
## Risk
Low. Additive-only change — new extension is only set when PluginGitRef
is non-empty, so existing behavior is unchanged. Tekton ignores unknown
extensions.
## Rollback
Remove the `SetExtension` line — CloudEvent reverts, Tekton falls back
to derived ref.
Refs: FLA-225 PR1
---------
Signed-off-by: wuhuizuo <wuhuizuo@126.com>1 parent e2c9b20 commit 7948db8
4 files changed
Lines changed: 73 additions & 0 deletions
File tree
- experiments/tibuild-v2/internal/service/impl
- tibuild/pkg/rest/service
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
| |||
0 commit comments