pipelines-as-code
pipelines-as-code copied to clipboard
add flag `webhook-secret` to `tkn-pac setup` provider cli
Why is this useful
- Users wouldn't know the webhook-secret created for the git provider if they don't create a Repository CR. We solve this issue by providing
--webhook-secret
flag withtkn-pac setup <provider> --webhook-secret
flag.
Fixes #908
Signed-off-by: Satyam Bhardwaj [email protected]
Changes
Submitter Checklist
- [x] β½ Run
make test lint
before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI - [x] π If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
- [x] π§ͺ 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
- [ ] π If that's something that is possible to do please ensure to check if we can add a e2e test.
- [ ] π If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).
@sm43 @chmouel if this looks good to you, specifically the part where --webhook-secret
is a flag for the tkn-pac setup <provider>
only and is not carried to child commands of it, I can go ahead and make this change visible in cli DOC as well.
2. Should there be any change in the unit-tests?
I've updated the PR. Although, not sure how to fix this error when I run make test lint
(it's visible in the CI logs as well).
Linting go files...
pkg/random/random_test.go:25: File is not `gofumpt`-ed (gofumpt)
}
pkg/cmd/tknpac/setup/root.go:15: File is not `gofumpt`-ed (gofumpt)
var (
webhookSecret string
)
I've updated the PR. Although, not sure how to fix this error when I run
make test lint
(it's visible in the CI logs as well).Linting go files... pkg/random/random_test.go:25: File is not `gofumpt`-ed (gofumpt) } pkg/cmd/tknpac/setup/root.go:15: File is not `gofumpt`-ed (gofumpt) var ( webhookSecret string )
try running make fumpt
π
Thanks @sm43, CI is passing now.
I think @savitaashture is working on some refactoring of that code, let's see if you can both sync on this..
Codecov Report
Merging #919 (f439a12) into main (c290933) will increase coverage by
0.07%
. The diff coverage is68.00%
.
@@ Coverage Diff @@
## main #919 +/- ##
==========================================
+ Coverage 63.88% 63.95% +0.07%
==========================================
Files 80 80
Lines 5203 5205 +2
==========================================
+ Hits 3324 3329 +5
+ Misses 1568 1567 -1
+ Partials 311 309 -2
Impacted Files | Coverage Ξ | |
---|---|---|
pkg/cli/webhook/webhook.go | 0.00% <ΓΈ> (ΓΈ) |
|
pkg/cli/webhook/github.go | 55.76% <62.50%> (+1.48%) |
:arrow_up: |
pkg/cli/webhook/gitlab.go | 56.66% <66.66%> (+2.22%) |
:arrow_up: |
pkg/random/random.go | 90.90% <75.00%> (-9.10%) |
:arrow_down: |
pkg/sort/repository_status.go | 72.72% <0.00%> (-2.28%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
I think @savitaashture is working on some refactoring of that code, let's see if you can both sync on this..
Discussed with @ramessesii2 about the scenario
& Yes with tkn pac webhook add
command this functionality will be taken care
Here is PR https://github.com/openshift-pipelines/pipelines-as-code/pull/949
Closing this PR in favor of #949.