chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues #3

Merged
HumanBean merged 1 commit from HumanBean/Longshot:forgejo-tooling into main 2026-11-12 21:34:01 +00:00
Owner

Longshot's main takes reviewed pull requests only, so people and agents need to push to their own fork here and open pull requests from it, signing in without copying passwords or tokens. And since everything on magicbean.dev signs in through Forgejo, that sign-in should be the same one as the team chat's.

One sign-in (scripts/magicbean_login.py): one trip through the browser. You Sign in with Discord on git.magicbean.dev and approve; the browser comes back to a one-time listener on 127.0.0.1 with a git token (Forgejo's built-in OAuth application for git, the one git-credential-oauth uses, PKCE: nothing secret in the repository), which renews itself. The team chat's session comes from that token, with no second trip: the team's sign-in service, matrix.magicbean.dev/_magicbean/matrix-login, asks Forgejo whose token it is and answers with a one-minute JWT that Tuwunel accepts as a login for the same account Forgejo's single sign-on gives (the Forgejo login). When the chat session is missing, team_chat.py makes a new one from the git token by itself. team_chat.py login, test_requests.py and forge.py all use it. (The service lives on the server with the rest of the team's infrastructure, not in this repository.)

scripts/forge.py, standard library only:

  • login: the sign-in above (skipped if already signed in), then makes your fork <you>/Longshot, adds the remotes forge (Longshot: fetch) and forge-fork (your fork: push), reusing a remote that already points there, and becomes git's credential helper for https://git.magicbean.dev only, so git and jj push without asking. whoami, logout.
  • pr create BRANCH --title ... [--body-file ...] [--draft] (from your fork into main), pr list [--mine], pr view N [--comments], pr comment N, pr checkout N (bookmark or branch pr/N).
  • issue list|view|create|comment.

pr create refuses a title that isn't a Conventional Commit, since the title becomes the commit on main.

Docs: docs/forge.md for people (set up, a change start to finish, the commands, and fj, the Forgejo CLI, as an option with a token), and a short section in AGENTS.md for agents. "Sign in with Discord" everywhere.

Checked: a real sign-in, a team chat session made from the git token through the sign-in service (it found the existing account), the fork made by login, this branch pushed to the fork with jj git push through the credential helper, and this pull request opened with forge.py pr create. tests/test_team_chat.py and tests/test_test_requests.py pass.

Replaces #1, which was opened from a branch on Longshot by the sync bot before anyone could sign in this way.

Longshot's main takes reviewed pull requests only, so people and agents need to push to their own fork here and open pull requests from it, signing in without copying passwords or tokens. And since everything on magicbean.dev signs in through Forgejo, that sign-in should be the same one as the team chat's. **One sign-in** (`scripts/magicbean_login.py`): one trip through the browser. You **Sign in with Discord** on git.magicbean.dev and approve; the browser comes back to a one-time listener on 127.0.0.1 with a git token (Forgejo's built-in OAuth application for git, the one git-credential-oauth uses, PKCE: nothing secret in the repository), which renews itself. The team chat's session comes from that token, with no second trip: the team's sign-in service, `matrix.magicbean.dev/_magicbean/matrix-login`, asks Forgejo whose token it is and answers with a one-minute JWT that Tuwunel accepts as a login for the same account Forgejo's single sign-on gives (the Forgejo login). When the chat session is missing, `team_chat.py` makes a new one from the git token by itself. `team_chat.py login`, `test_requests.py` and `forge.py` all use it. (The service lives on the server with the rest of the team's infrastructure, not in this repository.) **`scripts/forge.py`**, standard library only: - `login`: the sign-in above (skipped if already signed in), then makes your fork `<you>/Longshot`, adds the remotes `forge` (Longshot: fetch) and `forge-fork` (your fork: push), reusing a remote that already points there, and becomes git's credential helper for `https://git.magicbean.dev` only, so git and jj push without asking. `whoami`, `logout`. - `pr create BRANCH --title ... [--body-file ...] [--draft]` (from your fork into main), `pr list [--mine]`, `pr view N [--comments]`, `pr comment N`, `pr checkout N` (bookmark or branch `pr/N`). - `issue list|view|create|comment`. `pr create` refuses a title that isn't a Conventional Commit, since the title becomes the commit on main. **Docs:** `docs/forge.md` for people (set up, a change start to finish, the commands, and fj, the Forgejo CLI, as an option with a token), and a short section in AGENTS.md for agents. "Sign in with Discord" everywhere. **Checked:** a real sign-in, a team chat session made from the git token through the sign-in service (it found the existing account), the fork made by `login`, this branch pushed to the fork with `jj git push` through the credential helper, and this pull request opened with `forge.py pr create`. tests/test_team_chat.py and tests/test_test_requests.py pass. Replaces #1, which was opened from a branch on Longshot by the sync bot before anyone could sign in this way.
Forgejo tooling: one sign-in for the team chat and git, scripts/forge.py for forks, pull requests and issues
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
8b37445fdd
Everything on magicbean.dev signs in through Forgejo, so one trip through the browser (Sign in with Discord) now gives
both the team chat's Matrix session and a git token: scripts/magicbean_login.py, used by team_chat.py, test_requests.py
and forge.py. The git token comes from Forgejo's built-in OAuth application for git (PKCE, nothing secret in the
repository) and renews itself.

scripts/forge.py: login makes the person's fork of Longshot, adds the remotes forge (fetch) and forge-fork (push), and
serves as git's credential helper for git.magicbean.dev; pr create|list|view|comment|checkout and
issue list|view|create|comment. docs/forge.md is the guide for people (fj, the Forgejo CLI, as an option); AGENTS.md
has the steps for agents.
HumanBean changed title from Forgejo tooling: one sign-in for chat and git; forge.py for forks, PRs and issues to Forgejo tooling: one sign-in for git and chat; forge.py for forks, PRs and issues 2026-11-12 21:07:55 +00:00
HumanBean force-pushed forgejo-tooling from 8b37445fdd
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to a67703d4bc
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
2026-11-12 21:07:56 +00:00
Compare
HumanBean changed title from Forgejo tooling: one sign-in for git and chat; forge.py for forks, PRs and issues to chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues 2026-11-12 21:10:26 +00:00
HumanBean force-pushed forgejo-tooling from a67703d4bc
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to 4518e9314e
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
2026-11-12 21:10:27 +00:00
Compare
HumanBean force-pushed forgejo-tooling from 4518e9314e
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to 92d6eb5421
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
2026-11-12 21:10:44 +00:00
Compare
HumanBean force-pushed forgejo-tooling from 92d6eb5421
Some checks failed
PR title / Conventional Commit title (pull_request_target) Has been cancelled
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
to 3964f97325
Some checks failed
Linux AppImage / appimage (pull_request) Has been cancelled
Linux AppImage / Release asset (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 1/2) (pull_request) Has been cancelled
Game-free source regressions / Python source checks (windows-2022, part 2/2) (pull_request) Has been cancelled
Game-free source regressions / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
Game-free source regressions / Workflow lint (actionlint) (pull_request) Has been cancelled
Windows builder / Longshot Builder package and setup (pull_request) Has been cancelled
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Has been cancelled
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Has been cancelled
Windows builder / Release assets (pull_request) Has been cancelled
PR title / Conventional Commit title (pull_request_target) Has been cancelled
2026-11-12 21:11:18 +00:00
Compare
HumanBean changed title from chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues to WIP: chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues 2026-11-12 21:26:47 +00:00
HumanBean changed title from WIP: chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues to chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues 2026-11-12 21:26:55 +00:00
HumanBean scheduled this pull request to auto merge when all checks succeed 2026-11-12 21:32:25 +00:00
HumanBean canceled auto merging this pull request when all checks succeed 2026-11-12 21:34:01 +00:00
HumanBean deleted branch forgejo-tooling 2026-11-12 21:34:02 +00:00
Sign in to join this conversation.
No description provided.