Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

Convert existing REST /links/distinct-dids endpoint to XRPC equivalent #8 #9

merged opened by seoul.systems targeting main from seoul.systems/microcosm-rs: xrpc_get_distinct

Simple conversion of the existing endpoint from REST to XRPC. Consecutively marked the pre-existing REST endpoint as deprecated.

Labels

None yet.

Participants 3
AT URI
at://did:plc:53wellrw53o7sw4zlpfenvuh/sh.tangled.repo.pull/3mcysjpzwwp22
+8 -7
Interdiff #2 โ†’ #3
constellation/src/server/mod.rs

This patch was likely rebased, as context lines do not match.

constellation/src/storage/mem_store.rs

This file has not been changed.

constellation/templates/hello.html.j2

This file has not been changed.

+8 -7
constellation/templates/try-it-macros.html.j2
··· 104 104 </form> 105 105 {% endmacro %} 106 106 107 - {% macro get_backlink_dids(subject, source) %} 108 - <form method="get" action="/xrpc/blue.microcosm.links.getBacklinkDids"> 109 - <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinkDids 110 - ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 111 - &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /><button type="submit">get links</button></pre> 112 - </form> 113 - {% endmacro %} 114 107 115 108 {% macro links_count(target, collection, path) %} 116 109 <form method="get" action="/links/count"> 117 110 118 111 112 + </form> 113 + {% endmacro %} 114 + 115 + {% macro get_backlink_dids(subject, source) %} 116 + <form method="get" action="/xrpc/blue.microcosm.links.getBacklinkDids"> 117 + <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinkDids 118 + ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 119 + &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> <button type="submit">get links</button></pre> 119 120 </form> 120 121 {% endmacro %} 121 122
lexicons/blue.microcosm/links/getBacklinkDids.json

This file has not been changed.

lexicons/blue.microcosm/links/getBacklinks.json

This file has not been changed.

History

6 rounds 17 comments
sign up or login to add to the discussion
4 commits
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
Rename method name to fetch backlink DIDs
Address fig's comments
Fix botched merge conflict (2d97b62) resolution
expand 0 comments
pull request successfully merged
3 commits
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
Rename method name to fetch backlink DIDs
Address fig's comments
expand 3 comments

managed to get it conflicting again after merging #7, sorry! i'm good to go with this otherwise.

i'll let you resolve and resubmit, so it says "merged" on your pr in tangled if you want. realized it wasn't doing that when i was merging manually otherwise.

(but i'm happy to resolve conflicts and merge that way if it's the same to you or if you don't have time to get the changes!)

I resolved the conflict and now things should be ready to merge again

2 commits
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
Rename method name to fetch backlink DIDs
expand 3 comments

sorry for getting the PRs mixed up! i'll do a final pass on this tomorrow, it's looking great. two clippy lints (from make check in the repo root):

  1. #[deprecated]: please put a comment instead of using the rust-level marker (which is very cool!). the deprecations in the server code are mostly notices to client using, not internal code (like the web server) :)

  2. unnecessary & on line 728 for the &collection param (just remove the &).

(i gotta get tangled CI going here!)

^^ line 728 of server/mod.rs

3 commits
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
Rename method name to fetch backlink DIDs
Replace tabs with spaces in try-it-macros.html.j2
expand 7 comments

git-merge-tree doesn't show any conflicts either. A bit lost what to do tbh

lemme have a closer look at why!

this is an issue on our end, and has been fixed in this PR: https://tangled.org/tangled.org/core/pulls/1033 . I will try to get this merged and deployed shortly, and that should automagically unblock this PR!

Sounds great!

the bug here should be fixed now! the pending conflict is because both files have been modified, sorry for the long wait!

fixed the remaining conflicts and the PR seems good to go now. Thanks for the follow up :)

2 commits
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
Rename method name to fetch backlink DIDs
expand 1 comment

The merge conflict label seems to stem from a whitespace related error even though the patch applies cleanly locally. Asking in the Tangled Discord it seems that should've been just a warning instead?

1 commit
expand
Add getDistinct XRPC equivalent to REST /links/distinct-dids
expand 3 comments

i'm getting a compilation error on this branch from the templates -- i think a couple lines got lost from #8

i think the name of this XRPC needs another iteration. it's close to getBacklinks so the name should probably be closer.

pdsls just calls the distinct dids count "repos", and i'm open to taking some inspiration from that. alksjdflkas i don't have a good suggestion right now.

Sorry for the compilation error. I started basing my own work on the new XRPC count endpoint as a reference. Rebased on main again and verified that the compilation errors are gone now.

Regarding the endpoint name, "Repos" isn't too bad either, but maybe getBacklinkDids is the option that is most self-evident. So I might go with that.

Feel free to merge if you agree. If you don't think that's a good idea, just let me know. :)

i think that's a good name. going to sleep on it before merging.

thanks!