chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues #3
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:forgejo-tooling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.pymakes a new one from the git token by itself.team_chat.py login,test_requests.pyandforge.pyall 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 remotesforge(Longshot: fetch) andforge-fork(your fork: push), reusing a remote that already points there, and becomes git's credential helper forhttps://git.magicbean.devonly, 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 branchpr/N).issue list|view|create|comment.pr createrefuses a title that isn't a Conventional Commit, since the title becomes the commit on main.Docs:
docs/forge.mdfor 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 withjj git pushthrough the credential helper, and this pull request opened withforge.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 chat and git; forge.py for forks, PRs and issuesto Forgejo tooling: one sign-in for git and chat; forge.py for forks, PRs and issues8b37445fdda67703d4bcForgejo tooling: one sign-in for git and chat; forge.py for forks, PRs and issuesto chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issuesa67703d4bc4518e9314e4518e9314e92d6eb542192d6eb54213964f97325chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issuesto WIP: chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issuesWIP: chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issuesto chore(tools): one Discord sign-in for git and the team chat; forge.py for forks, PRs and issues