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
Thank you for the contribution!
About having
sh.tangled.repo.listPullsxrpc method...I agree that can be useful, but I don't think it is a necessary api to have. All repo/PR records are public and it is pretty easy to get backlinked records via services like constellation.
So for now, in current state, I think maintaining an extra endpoint for that is not worth doing.
We can definitely have this kind of endpoints for convenience in future, but not now as long as they are doable with constellation.