Forgejo tooling: one sign-in for chat and git; forge.py for forks, PRs and issues #1
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1
Loading…
Reference in a new issue
No description provided.
Delete branch "agents/forge-login"
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): the link printed is Matrix's sign-in; 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, which sends it straight on to Forgejo for a git token (Forgejo knows you by then, so no second click). Both are saved in the config folder, readable by you only: the Matrix session as before, and the git token, which renews itself. The git token comes from Forgejo's built-in OAuth application for git (the one git-credential-oauth uses, PKCE), so nothing secret is in the repository.team_chat.py login,test_requests.pyandforge.pyall use it.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), 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.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: tests/test_team_chat.py and tests/test_test_requests.py pass with the new sign-in. Not run yet: a real sign-in needs a browser, so the first
forge.py loginis the test.This PR's branch is on Longshot itself, since nobody could sign in this way yet; later ones come from forks.
Add scripts/forge_login.py: sign in to git.magicbean.dev for pushingto Add scripts/forge_login.py: sign in, push to your fork, open pull requests278e536c8e59913fb111Add scripts/forge_login.py: sign in, push to your fork, open pull requeststo Forgejo tooling: one sign-in for chat and git; forge.py for forks, PRs and issues59913fb111b12bc5f180Replaced by #3, opened from my fork.
Pull request closed