Monorepo for Tangled tangled.org

Add sh.tangled.repo.listPulls XRPC endpoint for querying all PRs by repository #930

closed
opened by vitorpy.com targeting master from vitorpy.com/tangled-core: feature/list-all-pulls

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 repository
  • state (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
0
by vitorpy.com 2 comments
expand 1 commit
Add XRPC endpoint to list all PRs targeting a repository

Thank you for the contribution!

About having sh.tangled.repo.listPulls xrpc 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.

Well, sure, it would be fairly easy if I maintained a specific appview for tangled-cli... I'll try to find an workaround.

I had pinged @oppi.li on bsky, happy to maintain it myself.

closed without merging
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:5rtpn23tmq5jocptcbkooj4b/sh.tangled.repo.pull/3mbomhj7crp22