feat(webhook): add Forgejo CLI setup#2764
Conversation
|
|
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring Forgejo webhooks via the CLI, including updated documentation, a new forgejoConfig implementation, and corresponding unit tests. Feedback points out that parsing SSH repository URLs in forgejoInstanceURL can cause an error that blocks the setup process, and suggests ignoring the error to gracefully fall back to an empty default URL.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
2fe600d to
ffd287b
Compare
|
/ok-to-test |
ffd287b to
d0cd587
Compare
4eef949 to
a6e6012
Compare
|
/ok-to-test |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2764 +/- ##
==========================================
+ Coverage 61.01% 61.23% +0.22%
==========================================
Files 211 212 +1
Lines 17228 17352 +124
==========================================
+ Hits 10511 10626 +115
+ Misses 5917 5916 -1
- Partials 800 810 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a6e6012 to
9e5f6dd
Compare
|
Updated the unit tests to cover more branches. |
|
@SecKatie E2E tests has some issues this they are failing always. We will fix and do review it. Thanks |
9e5f6dd to
e4816ab
Compare
|
@SecKatie hope you don't mind but to speed up the merge of this PR I have amended your commit and force-pushed the reviewed changes in commit e4816ab to your PR (adding myself as co-author). Summary:
I also replied to and resolved the remaining review threads with the corresponding changes or rationale. |
|
/ok-to-test |
There was a problem hiding this comment.
Pull request overview
Adds Forgejo support to the CLI webhook setup flow (tkn pac create repo / tkn pac webhook add) by introducing a Forgejo-specific webhook installer, extending provider selection/detection, adding unit tests, and updating Forgejo provider documentation.
Changes:
- Add
forgejoto webhook provider selection/detection in the CLI flow. - Implement Forgejo webhook creation via the vendored Forgejo SDK.
- Add unit tests for provider detection and Forgejo webhook setup logic; update Forgejo docs for CLI setup and token requirements.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/webhook/webhook.go | Adds forgejo as a supported provider option for CLI webhook setup and selection. |
| pkg/cli/webhook/webhook_test.go | Adds unit tests for GetProviderName including Forgejo. |
| pkg/cli/webhook/forgejo.go | Implements Forgejo CLI webhook configuration prompts and webhook creation via Forgejo SDK. |
| pkg/cli/webhook/forgejo_test.go | Adds unit tests for Forgejo config prompting, instance URL parsing, webhook creation, and token usage. |
| docs/content/docs/providers/forgejo.md | Documents CLI-based Forgejo webhook setup and required token access/scopes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e4816ab to
9c235c6
Compare
|
/ok-to-test |
9c235c6 to
9934077
Compare
|
/ok-to-test |
|
/ok-to-test |
|
/retest |
|
/ok-to-test |
theakshaypant
left a comment
There was a problem hiding this comment.
Overall LGTM!
Just need to confirm if we want to "retain" the gitea support while adding this CLI setup for forgejo
Add Forgejo to the webhook setup used by `tkn pac create repo` and `tkn pac webhook add`. Create the repository webhook and store the token and webhook secret for runtime use. Handle repository URLs with `.git` suffixes, trailing slashes, instance subpaths, and SSH forms without blocking manual setup. Use the Forgejo event groups that cover push, pull request lifecycle, sync, label, and comment events. Document why each token permission is needed and clarify when the CLI creates the provider secret. Fixes tektoncd#2755. Co-authored-by: Chmouel Boudjnah <chmouel@redhat.com> Signed-off-by: Katie Mulliken <mulliken@redhat.com>
61330ed to
d8fdce9
Compare
✅ Manual validation report (kind cluster) — Forgejo CLI setupI ran a full end-to-end manual validation of this PR on a live Environment
Flows validated
Issue found during validation (environment/config), then resolved
Confidence for mergeHigh confidence this PR is ready to merge. The CLI enhancement works interactively in real conditions across all targeted flows ( |
|
/ok-to-test |
📝 Description of the Change
Adds Forgejo to the CLI webhook setup path used by
tkn pac create repoandtkn pac webhook add.This PR:
forgejoto webhook provider selection and detectionpush,pull_request, andissue_comment🔗 Linked GitHub Issue
Fixes #2755
🧪 Testing Strategy
Ran:
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Used AI assistance to help implement the Forgejo CLI webhook setup, tests, docs, and PR preparation. I reviewed the generated code and ran the local checks listed above.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:orfeat:, matches the Type of Change I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.