How a pull request's host picks GitHub or Forgejo

Obeya decides from a pull request's address whether it talks to GitHub (through gh) or to Forgejo/Gitea. Each case below compares Obeya's answer before and after this change, computed by running the real code of both versions.

1. The host it checks is the host it goes to

An address stored by an older version could carry text that makes it look like github.com while actually pointing somewhere else.

https://attacker.example#@github.com/acme/app/pulls/1
BeforeCounted as GitHub, but gh was sent to attacker.example, together with any GitHub Enterprise token in the environment.
AfterNot a pull request address. An address with a login, query or fragment in front of the repository is refused.

2. GitHub Enterprise Cloud counts as GitHub

A team on *.ghe.com may give gh only a GH_TOKEN and no stored login.

https://acme.ghe.com/team/app/pull/4
BeforeTreated as Forgejo: recorded as …/pulls/4 and read through the Forgejo API, which fails.
AfterGitHub, on host acme.ghe.com. Repositories there now land through pull requests by default, too.

3. gh gets the address it accepts

An Enterprise PR reported before gh was logged into that server was recorded with Forgejo's /pulls/. After gh auth login, it counts as GitHub.

https://github.example.com/team/app/pulls/7
Beforegh pr view https://github.example.com/team/app/pulls/7, which gh rejects.
Aftergh pr view https://github.example.com/team/app/pull/7

4. A failed Forgejo call says how to fix it if the host is GitHub

The same PR before gh is logged into the server: the Forgejo API there answers 404.

BeforeNot Found (GET repos/team/app/pulls/7)
AfterNot Found; if github.example.com is a GitHub Enterprise server, log gh in there: gh auth login --hostname github.example.com

5. "Review PR" finds the card a PR already has

A card's PR was stored as written, e.g. with a trailing slash or the host in capitals.

https://GitHub.com/acme/app/pull/5/
Before"Review PR #5" didn't recognise that card and created a second card for the same PR.
AfterBoth addresses are normalised before the comparison, so the existing card opens.

Each case has a test. Each of those tests fails on the previous version and passes now.