Skip to content

Fix web links for tests and plans hosted on Forgejo - #34

Open
thrix wants to merge 1 commit into
mainfrom
fix-forgejo-web-links
Open

thrix wants to merge 1 commit into
mainfrom
fix-forgejo-web-links

Conversation

@thrix

@thrix thrix commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #33

tmt's web_git_url() rewrites only GitHub and GitLab URLs. For any other host it appends the file path to the clone URL, so a test on forge.fedoraproject.org links to a 404:

https://forge.fedoraproject.org/freeipa/ahdapa.git/contrib/tmt/tests/demo-ipaldap/main.fmf

A new _web_link() helper in converters.py rewrites links for Forgejo hosts (forge.fedoraproject.org, codeberg.org) to /src/<ref>/<path>:

https://forge.fedoraproject.org/freeipa/ahdapa/src/89405f9d21c854b508fcd225c899a40bb7a1c654/contrib/tmt/tests/demo-ipaldap/main.fmf

Forgejo redirects that form to /src/commit/<sha>/... for a commit and /src/branch/<name>/... for a branch. For all other hosts the helper returns tmt's link unchanged.

tmt itself has the same gap in web_git_url() on main. Fixing it there would let us drop this helper later.

Generated-by: Claude Code

tmt's `web_git_url()` rewrites only GitHub and GitLab URLs. For other
hosts it appends the file path to the clone URL, which gives a 404 on
Forgejo instances such as forge.fedoraproject.org and codeberg.org.

Rewrite links for these hosts to the `/src/<ref>/<path>` form. Forgejo
redirects it to the matching commit or branch view.

Fixes #33

Assisted-by: Claude Code
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
@thrix

thrix commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@thrix please submit to tmt, should be there rather

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken web links for tests and plans hosted on Forgejo

1 participant