Add NIP-34 git pull request CLI support#1279
Merged
Merged
Conversation
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>
01cf9ed to
f71fbed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds NIP-34 git pull request support to Buzz:
kind:1618pull requests andkind:1619PR updatesbuzz pr open/update/get/list/statusopen|merged|closed|draft1618/1619by repoa-tag withMessagesWriteCLI UX
buzz pr openpublishes a fetchable branch-tip PR event:--repo-owner,--repo-id,--subject,--commit, at least one--clone--body/--body-file,--branch-name,--merge-base,--euc,--label,--to,--revision-ofbuzz pr updatepublishes akind:1619update:--pr,--pr-author,--commit, at least one--cloneValidation
Local validation before push:
bin/cargo check -p buzz-clicommands::pr::testsLive relay smoke on
wss://sprout-oss.stage.blox.sqprod.co:buzz-pr-kind-smoke-max-1782399366(kind:30617) eventf13a0a65…buzz pr openfrom this branch against that repokind:1618PR eventdb4ea789fd0a9af2d70c012b10ce96548d0f0d93bc5e8ccf75a0969ead833172a,subject,c, repeatableclone,branch-name,merge-base, andt=e2e-smokebuzz pr listfinds the PR by repobuzz pr status --status draftaccepted status event5ea8305d…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:
git ls-remoteagainst the announced repo succeedsgit-receive-packwithAuthorization: Nostrpush authorization failed (network error reaching policy service)/pre-receive hook declinedSo 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.