Skip to content

Add NIP-34 git pull request CLI support#1279

Merged
tlongwell-block merged 2 commits into
mainfrom
feat/git-pr-kinds
Jun 25, 2026
Merged

Add NIP-34 git pull request CLI support#1279
tlongwell-block merged 2 commits into
mainfrom
feat/git-pr-kinds

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

Summary

Adds NIP-34 git pull request support to Buzz:

  • SDK builders for kind:1618 pull requests and kind:1619 PR updates
  • CLI surface: buzz pr open/update/get/list/status
  • Reuses the existing NIP-34 status builder for open|merged|closed|draft
  • Keeps relay unchanged because ingest already accepts/routs 1618/1619 by repo a-tag with MessagesWrite

CLI UX

buzz pr open publishes a fetchable branch-tip PR event:

  • required: --repo-owner, --repo-id, --subject, --commit, at least one --clone
  • optional: --body / --body-file, --branch-name, --merge-base, --euc, --label, --to, --revision-of

buzz pr update publishes a kind:1619 update:

  • required: --pr, --pr-author, --commit, at least one --clone
  • includes explicit NIP-22 root/author tags so agents can filter without first fetching the root PR

Validation

Local validation before push:

  • bin/cargo check -p buzz-cli
  • focused CLI tests: commands::pr::tests
  • command inventory and subcommand-name tests
  • SDK PR builder tests
  • push hooks ran repo checks/tests successfully before branch push

Live relay smoke on wss://sprout-oss.stage.blox.sqprod.co:

  • Created repo announcement buzz-pr-kind-smoke-max-1782399366 (kind:30617) event f13a0a65…
  • Ran buzz pr open from this branch against that repo
  • Relay accepted and query returned kind:1618 PR event db4ea789fd0a9af2d70c012b10ce96548d0f0d93bc5e8ccf75a0969ead833172
  • Verified tags include repo a, subject, c, repeatable clone, branch-name, merge-base, and t=e2e-smoke
  • buzz pr list finds the PR by repo
  • buzz pr status --status draft accepted status event 5ea8305d…

E2E caveat

The requested “push block/buzz to the relay Smart HTTP repo” portion exposed an existing staging git push blocker, not a PR-kind blocker:

  • NIP-98 git auth works: git ls-remote against the announced repo succeeds
  • A tiny test push reaches git-receive-pack with Authorization: Nostr
  • Remote hook rejects with push authorization failed (network error reaching policy service) / pre-receive hook declined
  • Full/shallow block/buzz pushes hit the same push-path failure after pack upload

So the new PR kind path is proven live (CLI → relay accept/query for 1618, plus status); the staging Smart HTTP push path needs separate follow-up for the pre-receive policy callback.

npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d and others added 2 commits June 25, 2026 11:07
build_git_pull_request emits a kind:1618 PR event (a/r/p/subject/t/c/clone/
branch-name/merge-base, optional e for revision-of-patch); build_git_pr_update
emits kind:1619 with NIP-22 uppercase E/P root refs and an updated c tip. Both
require at least one clone url and a full-length commit id, mirroring
build_git_patch's no-network validation. Relay already accepts these kinds
(ingest.rs MessagesWrite, a-tag addressed); this fills the SDK-side gap.

9 unit tests cover happy paths, multi-url clone tags, and rejection cases.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
Adds `buzz pr open/update/get/list/status`, the CLI surface over the
kind:1618/1619 SDK builders. `open` emits a 1618 pull request
(`--subject`, optional `--body`/`--body-file`, `--commit`, required
repeatable `--clone`, optional `--branch-name`/`--merge-base`/`--euc`/
`--label`/`--to`/`--revision-of`); `update` emits a 1619 with NIP-22
uppercase E/P root refs (`--pr`, `--pr-author`, `--commit`, repeatable
`--clone` + optional body/context); `get`/`list` query by repo `a`-tag;
`status` reuses the existing NIP-34 status builder (open|merged|closed|
draft). Mirrors patches.rs conventions and the relay accepts these kinds
unchanged (ingest.rs, a-tag addressed).

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
@tlongwell-block tlongwell-block merged commit 5fef9b7 into main Jun 25, 2026
29 checks passed
@tlongwell-block tlongwell-block deleted the feat/git-pr-kinds branch June 25, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant