WIP: A simple cli for daily tangled use cases and AI integration. This is for my personal use right now, but happy if others get mileage from it! :)

Update all queries to use constellation indexing #20

closed opened by markbennett.ca

Motivation#

Right now the cli assumes that all issues, etc are associated and available on the PDS of the current user. This doesn't actually make sense as soon as there are multiple collaborators, as they will be using different PDSs hosted on different services.

Instead we need to update to use an indexing service. For now constellation.microcosm.blue works.

This is an example of a web request that retrieves the first 100 records of type "sh.tangled.repo.issue" that match the repo DID "at://did:plc:b2mcbcamkwyznc5fkplwlxbf/sh.tangled.repo/3mef23waqwq22" which is stored in the issue records ".repo" path.

https://constellation.microcosm.blue/links?target=at%3A%2F%2Fdid%3Aplc%3Ab2mcbcamkwyznc5fkplwlxbf%2Fsh.tangled.repo%2F3mef23waqwq22&collection=sh.tangled.repo.issue&path=.repo&limit=100

Enhancement#

Update the issue code to query constellation for all "sh.tangled.repo.issue" when listing repo issues. For each issue, also query for comment records (type "sh.tangled.repo.issue.comment") with ". issue" path matching the issues DID, and status updates (not sure of the type)

Acceptance Criteria#

  1. Update functions in /src/lib/issues-api.ts to use constellation when querying for issues, comments, and status. This must be done in all places we're currently getting the set of records associated with a record including retrieving sets of issues associated with a repo, comments, issue status messages.
  2. Confirm that retrieving a specific record will work when the record is not hosted on the users PDS. Issues created by other collaborators will be on their PDSs.
  3. Create a /src/lib/constellation.ts file to collect functions making constellation calls in one place.

Example records#

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:b2mcbcamkwyznc5fkplwlxbf/sh.tangled.repo.issue/3mem6uzr2cb22