Add scripts/forgejo.py for the gaps in fj #15

Closed
opened 2026-08-06 22:24:20 +00:00 by icub3d · 0 comments
Owner

fj has no milestone support, so M1's milestones were created by a throwaway script in
a scratchpad with the seven milestone descriptions and the issue numbers hardcoded in
it. That script is gone at the end of the session, which means M2 starts by rewriting it.

Add a small, permanent scripts/forgejo.py covering only what fj cannot do.
Issues, labels, and pull requests already have a working CLI and must not be
reimplemented — a second way to do the same thing is a second thing to keep correct.

Scope

forgejo.py milestone list
forgejo.py milestone create <title> [--description-file <f>] [--due <YYYY-MM-DD>]
forgejo.py milestone assign <title-or-id> <issue>...   # accepts ranges: 2-13
  • Reads the token fj already stores, at hosts["git.marsh.gg"]["token"] in
    ~/.local/share/forgejo-cli/keys.json. No second credential to manage.
  • Repo and host default to this one; overridable by flag so the script is not
    hard-wired to a single repository.
  • Idempotent: creating a milestone that exists reports it and moves on rather than
    failing or duplicating.
  • Standard library only. This is a helper script, not a reason to grow a Python
    dependency set alongside the Rust one.

Acceptance criteria

  • Recreating the current M1–M7 state from an empty tracker is one documented
    sequence of commands, with no milestone text living inside the script.
  • A missing or malformed token fails with a message naming the file and the key,
    never by sending a bogus credential.
  • An HTTP error reports the status and the issue or milestone it was working on.
  • docs/development.md documents it in the Forgejo tooling reference, and the
    "milestones have no fj command" note points at it.

Notes

Deliberately not in scope: project boards. They have no API in this Forgejo version, so
there is nothing to wrap. See docs/development.md.

`fj` has no milestone support, so M1's milestones were created by a throwaway script in a scratchpad with the seven milestone descriptions and the issue numbers hardcoded in it. That script is gone at the end of the session, which means M2 starts by rewriting it. Add a small, permanent `scripts/forgejo.py` covering **only** what `fj` cannot do. Issues, labels, and pull requests already have a working CLI and must not be reimplemented — a second way to do the same thing is a second thing to keep correct. ## Scope forgejo.py milestone list forgejo.py milestone create <title> [--description-file <f>] [--due <YYYY-MM-DD>] forgejo.py milestone assign <title-or-id> <issue>... # accepts ranges: 2-13 - Reads the token `fj` already stores, at `hosts["git.marsh.gg"]["token"]` in `~/.local/share/forgejo-cli/keys.json`. No second credential to manage. - Repo and host default to this one; overridable by flag so the script is not hard-wired to a single repository. - Idempotent: creating a milestone that exists reports it and moves on rather than failing or duplicating. - Standard library only. This is a helper script, not a reason to grow a Python dependency set alongside the Rust one. ## Acceptance criteria - [ ] Recreating the current M1–M7 state from an empty tracker is one documented sequence of commands, with no milestone text living inside the script. - [ ] A missing or malformed token fails with a message naming the file and the key, never by sending a bogus credential. - [ ] An HTTP error reports the status and the issue or milestone it was working on. - [ ] `docs/development.md` documents it in the Forgejo tooling reference, and the "milestones have no `fj` command" note points at it. ## Notes Deliberately not in scope: project boards. They have no API in this Forgejo version, so there is nothing to wrap. See `docs/development.md`.
Sign in to join this conversation.
No description provided.