Skip to content

feat: Switch gitea to forgejo provider type#2476

Merged
chmouel merged 3 commits intotektoncd:mainfrom
chmouel:srvkp10487-foregejo-alias-to-gitea
Feb 17, 2026
Merged

feat: Switch gitea to forgejo provider type#2476
chmouel merged 3 commits intotektoncd:mainfrom
chmouel:srvkp10487-foregejo-alias-to-gitea

Conversation

@chmouel
Copy link
Copy Markdown
Member

@chmouel chmouel commented Feb 12, 2026

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.

📝 Description of the Change

Add forgejo as a first-class provider type in Pipelines-as-Code. The existing gitea type is kept as a backwards-compatible alias. Both types resolve to the same Gitea/Forgejo provider internally.

What changed:

  • CRD schema (types.go, 300-repositories.yaml): added forgejo to the Enum validation alongside gitea
  • Provider resolution (event.go, incoming.go, cel.go): accept both "gitea" and "forgejo" in switch cases
  • Metrics (emit_metrics.go): recognise "forgejo" as a webhook provider for metric tagging
  • Spec merging (types.go Merge): treat gitea and forgejo as equivalent types so global/local Repository specs merge correctly
  • Docs: updated Forgejo install guide, CLI reference, incoming webhook, and global repo settings to recommend type: "forgejo"
  • E2E test harness (test/pkg/gitea): default provider type changed from "gitea" to "forgejo", with an option to override via ProviderType

👨🏻‍ Linked Jira

Jira: https://issues.redhat.com/browse/SRVKP-10487

🔗 Linked GitHub Issue

Fixes #

🚀 Type of Change

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

If you have used AI assistance, please provide the following details:

Which LLM was used?

  • GitHub Copilot
  • ChatGPT (OpenAI)
  • Claude (Anthropic)
  • Cursor
  • Gemini (Google)
  • Other: ____________

Extent of AI Assistance:

  • Documentation and research only
  • Unit tests or E2E tests only
  • Code generation (parts of the code)
  • Full code generation (most of the PR)
  • PR description and comments
  • Commit message(s)

Important

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer 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.sh to automatically add
these co-author trailers to your commits.

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

Copilot AI review requested due to automatic review settings February 12, 2026 16:41
@pipelines-as-code
Copy link
Copy Markdown

pipelines-as-code bot commented Feb 12, 2026

🔍 PR Lint Feedback

Note: This automated check helps ensure your PR follows our contribution guidelines.

⚠️ Items that need attention:

🤖 AI attribution

The following commits lack an explicit AI attribution footer:

  • 3e625e4 feat: Switch gitea to forgejo provider type

If no AI assistance was used for a commit, you can ignore this warning.
Otherwise add an Assisted-by: or Co-authored-by: footer referencing the AI used.


ℹ️ Next Steps

  • Review and address the items above
  • Push new commits to update this PR
  • This comment will be automatically updated when issues are resolved
🔧 Admin Tools (click to expand)

Automated Issue/Ticket Creation:

  • /issue-create - Generate a GitHub issue from this PR content using AI
  • /jira-create - Create a SRVKP Jira ticket from this PR content using AI

⚠️ Important: Always review and edit generated content before finalizing tickets/issues.
The AI-generated content should be used as a starting point and may need adjustments.

These commands are available to maintainers and will post the generated content as PR comments for review.

🤖 This feedback was generated automatically by the PR CI system

@pipelines-as-code pipelines-as-code bot added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.type to include forgejo and treat gitea/forgejo as equivalent for spec merging.
  • Update provider selection paths (adapter/reconciler/CLI/metrics) to accept forgejo.
  • Update docs and tests to reference/configure forgejo explicitly.

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.

@chmouel chmouel marked this pull request as draft February 12, 2026 16:52
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • First-Class Forgejo Support: Introduced "forgejo" as a distinct, first-class Git provider type, allowing explicit configuration for Forgejo instances.
  • Backward Compatibility: Maintained "gitea" as an alias for "forgejo" to ensure existing configurations continue to function without disruption.
  • Documentation Updates: Updated various documentation files, including CRD schemas, CLI help, and installation guides, to reflect the new "forgejo" provider type and its relationship with "gitea".
  • Internal Logic Enhancements: Modified internal code to correctly recognize and process "forgejo" as a provider, including handling equivalence during repository specification merging and metric emission.
  • Test Coverage: Expanded unit and integration tests to validate the new "forgejo" provider type, ensuring its correct behavior and interaction with existing Gitea logic.
Changelog
  • config/300-repositories.yaml
    • Added 'forgejo' to the enum of supported Git provider types in the repository CRD schema.
    • Updated the description for 'gitea' to clarify it as an alias for 'forgejo' for backward compatibility.
  • docs/content/docs/dev/_index.md
    • Updated the example configuration snippet to explicitly use 'type: "forgejo"' for Forgejo instances.
  • docs/content/docs/guide/cli.md
    • Extended the documentation for the 'tkn pac cel --provider' flag to include 'forgejo' as a supported provider option.
  • docs/content/docs/guide/incoming_webhook.md
    • Updated the incoming webhook documentation to list 'forgejo' as a provider and note 'gitea' as its alias.
  • docs/content/docs/install/forgejo.md
    • Revised the Forgejo installation guide to state that Forgejo is now a first-class provider.
    • Updated configuration examples within the guide to use 'type: "forgejo"'.
  • docs/content/docs/install/global_repositories_setting.md
    • Included 'forgejo' in the documentation for global repository settings providers.
    • Noted 'gitea' as an alias for 'forgejo' in the global repository settings documentation.
  • pkg/adapter/incoming.go
    • Modified the 'processIncoming' function to map both 'gitea' and 'forgejo' provider types to the existing Gitea provider implementation.
  • pkg/adapter/incoming_test.go
    • Added a new test case to verify that the 'forgejo' provider type is correctly processed by the system.
  • pkg/apis/pipelinesascode/v1alpha1/types.go
    • Added 'forgejo' to the GitProvider enum for validation.
    • Introduced a new function 'areEquivalentProviderTypes' to treat 'gitea' and 'forgejo' as equivalent provider types.
    • Updated the 'GitProvider.Merge' method to utilize the 'areEquivalentProviderTypes' function for merging logic.
  • pkg/apis/pipelinesascode/v1alpha1/types_test.go
    • Added test cases to confirm correct merging behavior when local 'forgejo' and global 'gitea' provider types are used.
    • Added test cases to confirm correct merging behavior when local 'gitea' and global 'forgejo' provider types are used.
  • pkg/cmd/tknpac/cel/cel.go
    • Updated the 'tkn pac cel' command's provider parsing logic to recognize 'forgejo' as a valid provider type.
    • Modified the help text for the 'tkn pac cel' command's provider flag to include 'forgejo'.
  • pkg/cmd/tknpac/cel/cel_test.go
    • Adjusted the test for the 'tkn pac cel' command's provider flag usage to reflect the inclusion of 'forgejo'.
  • pkg/reconciler/emit_metrics.go
    • Extended the 'countPipelineRun' function to include 'forgejo' when emitting metrics for webhook providers.
  • pkg/reconciler/emit_metrics_test.go
    • Added a test case to ensure metrics are correctly emitted for the 'forgejo' provider type.
  • pkg/reconciler/event.go
    • Updated comments to explicitly list 'forgejo (gitea)' as a supported provider.
    • Modified the 'detectProvider' function to recognize 'forgejo' and map it to the Gitea provider implementation.
  • pkg/reconciler/event_test.go
    • Added a test case to confirm that the 'forgejo' provider type is correctly resolved during provider detection.
  • test/pkg/gitea/scm.go
    • Changed the default webhook type to 'forgejo' when creating Gitea repository hooks in test utilities.
  • test/pkg/gitea/test.go
    • Introduced a 'ProviderType' field in 'TestOpts' to allow specifying the provider type for tests.
    • Updated 'TestPR' to use the new 'ProviderType' field, defaulting to 'forgejo' if not specified.
Activity
  • No human activity has occurred on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chmouel chmouel force-pushed the srvkp10487-foregejo-alias-to-gitea branch from d47680b to 019c789 Compare February 12, 2026 22:01
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
@chmouel chmouel force-pushed the srvkp10487-foregejo-alias-to-gitea branch from 019c789 to 3e625e4 Compare February 12, 2026 22:12
@chmouel chmouel marked this pull request as ready for review February 13, 2026 07:06
@pipelines-as-code pipelines-as-code bot added the feature New feature or request label Feb 13, 2026
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)")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it does not matter but when "auto" is selected, would the provider be listed as gitea or forgejo?

@chmouel chmouel merged commit 10866f3 into tektoncd:main Feb 17, 2026
10 checks passed
@chmouel chmouel deleted the srvkp10487-foregejo-alias-to-gitea branch February 17, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants