Summary#
Adds a new XRPC endpoint sh.tangled.repo.listPulls that allows listing all pull requests targeting a specific repository, regardless of author. This enables the CLI to show all PRs for a repo instead of only the user's own PRs.
Changes#
- appview/pulls/pulls.go: Add
ListPulls()handler that queries the database for all PRs targeting a given repository AT-URI, with optional state filtering (open/closed/merged) - appview/state/router.go: Register the new XRPC endpoint at
/xrpc/sh.tangled.repo.listPulls - appview/state/xrpc.go: Add delegation method to route requests to the pulls handler
- lexicons/repo/listPulls.json: Define the lexicon schema for the new XRPC method
API#
Endpoint: GET /xrpc/sh.tangled.repo.listPulls
Parameters:
repo(required): AT-URI of the target repositorystate(optional): Filter by state - "open", "closed", or "merged" Response: JSON array of pull request summaries with owner DID, pull ID, title, state, target branch, and creation timestamp
Use Case#
This enables CLI commands like:
tangled pr list --repo tangled-cli --state open
To show all open PRs targeting the repository, not just those created by the current user.
Backwards Compatibility
✅ No breaking changes - this is a new additive endpoint