Add support for Forgejo.
Review Request #14607 — Created Sept. 10, 2025 and updated
Forgejo is a newish open-source code forge system forked from Gitea
which has been rapidly gaining popularity. This change adds hosting
service support for it.This implementation handles all of the main parts of integration for the
hosting service, including:
- Authorization with the service, creating a new API token for the user
with the correct permissions. - Basic support for getting file content (git blobs).
- Post-commit review support, fetching branches, lists of commits, commit
data, and diffs. - Bug tracker integration, including linking to issues and showing the
bug infobox. - WebHook support for closing review requests when commits are pushed.
The only hosting service feature which is not implemented is the remote
repository listing.
- Tested authorization and API token creation, including when 2FA was
enabled. - Verified pre-commit and post-commit review functionality against a
self-hosted Forgejo server. - Checked linking to bugs and the bug infobox.
- Verified that setting up a WebHook according to the instructions worked
correctly, and that pushing code to Forgejo properly closed relevant
review requests. - Ran unit tests.
Summary | ID |
---|---|
zupounommokpsrpqoprqqltlnnwoyztv |
Description | From | Last Updated |
---|---|---|
continuation line unaligned for hanging indent Column: 25 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
closing bracket does not match indentation of opening bracket's line Column: 13 Error code: E123 |
![]() |
|
closing bracket does not match indentation of opening bracket's line Column: 9 Error code: E123 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
continuation line unaligned for hanging indent Column: 13 Error code: E131 |
![]() |
|
closing bracket does not match indentation of opening bracket's line Column: 13 Error code: E123 |
![]() |
|
closing bracket does not match indentation of opening bracket's line Column: 9 Error code: E123 |
![]() |
|
continuation line under-indented for visual indent Column: 25 Error code: E128 |
![]() |
|
continuation line under-indented for visual indent Column: 25 Error code: E128 |
![]() |
|
continuation line unaligned for hanging indent Column: 20 Error code: E131 |
![]() |
|
line too long (80 > 79 characters) Column: 80 Error code: E501 |
![]() |
|
continuation line under-indented for visual indent Column: 13 Error code: E128 |
![]() |
|
continuation line under-indented for visual indent Column: 13 Error code: E128 |
![]() |
|
continuation line under-indented for visual indent Column: 25 Error code: E128 |
![]() |
|
line too long (80 > 79 characters) Column: 80 Error code: E501 |
![]() |
|
Typo: Initialie |
![]() |
|
Get rid of the "is" here. |
![]() |
|
Would should handle the potential ValidationError here as well. |
![]() |
|
We have error = data.decode() above so we can pass that to .format() instead of decoding again. Might as well … |
![]() |
|
Since we can only hit this case if a two factor auth code was already provided by the user, I … |
![]() |
|
Was this meant to say "username" instead of "login"? |
![]() |
|
Since this error is moreso user facing than just admin facing (it'd be displayed in the diff viewer, right?) maybe … |
![]() |
|
We can get rid of this text. |
![]() |
|
Can you type these as well. |
![]() |
|
What if both sha and branch are not provided, shouldn't we use the default branch? Should have a unit test … |
![]() |
|
Can you add this to the "Raises" docs as well. |
![]() |
|
Note that this is still TODO. |
![]() |
|
Is this correct syntax? Does it work for RB7.1's supported Python versions? |
![]() |
|
This can fit on one line. Or are we always meant to put the format args on the next line … |
![]() |
|
Nit: I think it'd be nice to standardize on including a trailing slash in the URLs, for methods that return … |
![]() |
|
This could also raise HostingServiceAPIError (update the docstring in the corresponding ForgejoClient method too). |
![]() |
|
This could also raise HostingServiceAPIError (update the docstring in the corresponding ForgejoClient method too). |
![]() |
|
This could also raise HostingServiceAPIError (update the docstring in the corresponding ForgejoClient method too). |
![]() |
|
Do you know if Forgejo has a limit on API token name length? If so we'll have to cap it … |
![]() |
- Commits:
-
Summary ID zupounommokpsrpqoprqqltlnnwoyztv zupounommokpsrpqoprqqltlnnwoyztv - Diff:
-
Revision 2 (+6046)
- Commits:
-
Summary ID zupounommokpsrpqoprqqltlnnwoyztv zupounommokpsrpqoprqqltlnnwoyztv - Diff:
-
Revision 3 (+6048)
Checks run (2 succeeded)

-
-
-
-
-
We have
error = data.decode()
above so we can pass that to.format()
instead of decoding again. Might as well make a variable fore.code
too and use that in the error log and here. -
Since we can only hit this case if a two factor auth code was already provided by the user, I feel like a more appropriate message would just be "Invalid two-factor authentication code."
-
-
Since this error is moreso user facing than just admin facing (it'd be displayed in the diff viewer, right?) maybe we should say something like "Please contact your administrator to review the Review Board log files ...".
-
-
-
What if both
sha
andbranch
are not provided, shouldn't we use the default branch? Should have a unit test for this case as well. -
-
-
This can fit on one line. Or are we always meant to put the format args on the next line irregardless of the length of the string? I forget.
-
Nit: I think it'd be nice to standardize on including a trailing slash in the URLs, for methods that return URLs. So that in the future if someone's using
_get_api_root
or_get_api_repo_root
, they wouldn't have to check which one has a trailing slash and which one doesn't. -
This could also raise
HostingServiceAPIError
(update the docstring in the correspondingForgejoClient
method too). -
This could also raise
HostingServiceAPIError
(update the docstring in the correspondingForgejoClient
method too). -
This could also raise
HostingServiceAPIError
(update the docstring in the correspondingForgejoClient
method too). -
Do you know if Forgejo has a limit on API token name length? If so we'll have to cap it here, in case someone's server name is super long.
- Commits:
-
Summary ID zupounommokpsrpqoprqqltlnnwoyztv zupounommokpsrpqoprqqltlnnwoyztv - Diff:
-
Revision 4 (+6106)
Checks run (2 succeeded)
- Commits:
-
Summary ID zupounommokpsrpqoprqqltlnnwoyztv zupounommokpsrpqoprqqltlnnwoyztv - Diff:
-
Revision 5 (+6112)