feat: Switch gitea to forgejo provider type#2476
Conversation
🔍 PR Lint Feedback
|
There was a problem hiding this comment.
Pull request overview
Adds Forgejo as a first-class Git provider type across the controller, CLI, tests, and docs, while keeping gitea as a backwards-compatible alias.
Changes:
- Extend
GitProvider.typeto includeforgejoand treatgitea/forgejoas equivalent for spec merging. - Update provider selection paths (adapter/reconciler/CLI/metrics) to accept
forgejo. - Update docs and tests to reference/configure
forgejoexplicitly.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/pkg/gitea/test.go |
Allows configuring provider type in e2e helper; defaults to forgejo. |
test/pkg/gitea/scm.go |
Switches created repo webhook type to forgejo. |
pkg/reconciler/event_test.go |
Adds test coverage for forgejo annotation acceptance. |
pkg/reconciler/event.go |
Accepts forgejo in provider detection (aliasing to gitea provider implementation). |
pkg/reconciler/emit_metrics_test.go |
Adds metrics tag expectation for forgejo-webhook. |
pkg/reconciler/emit_metrics.go |
Includes forgejo in supported provider set for metrics tagging. |
pkg/cmd/tknpac/cel/cel_test.go |
Updates CLI flag usage string to include forgejo. |
pkg/cmd/tknpac/cel/cel.go |
Accepts forgejo as an explicit provider for payload parsing and updates help text. |
pkg/apis/pipelinesascode/v1alpha1/types_test.go |
Adds merge tests ensuring gitea/forgejo equivalence. |
pkg/apis/pipelinesascode/v1alpha1/types.go |
Adds forgejo to enum + merges gitea/forgejo as equivalent types. |
pkg/adapter/incoming_test.go |
Adds incoming provider selection test for forgejo. |
pkg/adapter/incoming.go |
Accepts forgejo in incoming provider selection. |
docs/content/docs/install/global_repositories_setting.md |
Documents forgejo and clarifies gitea as alias. |
docs/content/docs/install/forgejo.md |
Updates Forgejo install/config examples to use type: "forgejo". |
docs/content/docs/guide/incoming_webhook.md |
Documents forgejo as supported provider type (and gitea alias). |
docs/content/docs/guide/cli.md |
Updates CLI docs to include forgejo. |
docs/content/docs/dev/_index.md |
Updates dev example to use type: "forgejo". |
config/300-repositories.yaml |
Updates CRD schema enum/docs to include forgejo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary of ChangesHello @chmouel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request formally integrates Forgejo as a distinct Git provider, enhancing clarity and direct support for Forgejo instances. Previously, Forgejo was implicitly handled through the Gitea provider due to API compatibility. The change establishes "forgejo" as a primary type while retaining "gitea" as an alias for seamless backward compatibility. This update involves comprehensive modifications across documentation, core logic for provider detection and merging, and test suites, ensuring robust and explicit support for Forgejo within the system. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces forgejo as a first-class Git provider, maintaining gitea as an alias for backward compatibility. No security vulnerabilities were found. However, a potential issue was identified in the test setup where an invalid webhook type is used, which could lead to test failures.
d47680b to
019c789
Compare
Introduced native support for Forgejo as a first-class Git provider. Previously, Forgejo was supported indirectly by using the Gitea provider type due to API compatibility. This change adds "forgejo" as a distinct provider type, allowing explicit configuration. The "gitea" provider type is maintained as an alias for backwards compatibility and will continue to function, but the preference is to use "forgejo" for new configurations. Key updates include: - Updated documentation to reflect Forgejo as a separate provider. - Modified internal logic to recognize and handle "forgejo" as a distinct type. - Ensured that merging repository specifications correctly handles the equivalence between "gitea" and "forgejo". - Updated tests to accommodate the new provider type. Jira: https://issues.redhat.com/browse/SRVKP-10487
019c789 to
3e625e4
Compare
| cmd.Flags().StringVarP(&bodyFile, bodyFileFlag, "b", "", "path to JSON body file (required)") | ||
| cmd.Flags().StringVarP(&headersFile, headersFileFlag, "H", "", "path to headers file (required, JSON, HTTP format, or gosmee-generated shell script)") | ||
| cmd.Flags().StringVarP(&provider, providerFlag, "p", "auto", "payload provider (auto, github, gitlab, bitbucket-cloud, bitbucket-datacenter, gitea)") | ||
| cmd.Flags().StringVarP(&provider, providerFlag, "p", "auto", "payload provider (auto, github, gitlab, bitbucket-cloud, bitbucket-datacenter, gitea, forgejo)") |
There was a problem hiding this comment.
I know it does not matter but when "auto" is selected, would the provider be listed as gitea or forgejo?
Introduced native support for Forgejo as a first-class Git provider. Previously, Forgejo was supported indirectly by using the Gitea provider type due to API compatibility. This change adds "forgejo" as a distinct provider type, allowing explicit configuration. The "gitea" provider type is maintained as an alias for backwards compatibility and will continue to function, but the preference is to use "forgejo" for new configurations.
Key updates include:
📝 Description of the Change
Add
forgejoas a first-class provider type in Pipelines-as-Code. The existinggiteatype is kept as a backwards-compatible alias. Both types resolve to the same Gitea/Forgejo provider internally.What changed:
types.go,300-repositories.yaml): addedforgejoto theEnumvalidation alongsidegiteaevent.go,incoming.go,cel.go): accept both"gitea"and"forgejo"in switch casesemit_metrics.go): recognise"forgejo"as a webhook provider for metric taggingtypes.goMerge): treatgiteaandforgejoas equivalent types so global/local Repository specs merge correctlytype: "forgejo"test/pkg/gitea): default provider type changed from"gitea"to"forgejo", with an option to override viaProviderType👨🏻 Linked Jira
Jira: https://issues.redhat.com/browse/SRVKP-10487
🔗 Linked GitHub Issue
Fixes #
🚀 Type of Change
fix:)feat:)feat!:,fix!:)docs:)chore:)refactor:)enhance:)deps:)🧪 Testing Strategy
🤖 AI Assistance
If you have used AI assistance, please provide the following details:
Which LLM was used?
Extent of AI Assistance:
Important
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: Gemini gemini@google.com
Co-authored-by: ChatGPT noreply@chatgpt.com
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: Cursor noreply@cursor.com
Co-authored-by: Copilot Copilot@users.noreply.github.com
**💡You can use the script
./hack/add-llm-coauthor.shto automatically addthese co-author trailers to your commits.
✅ Submitter Checklist
fix:,feat:) 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.