Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naïve dependency negotiation API #34

Merged
merged 15 commits into from
Feb 5, 2025
Merged

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Feb 4, 2025

Overview

Deployment

  • Run SQL migrations/add new functions.

Adds a simple causal-dependencies API for UCM to determine before a pull which hashes it actually needs.

The causal-dependencies endpoint returns a stream of causals to UCM , each tagged with whether it's part of the top-level history of the root, or whether it's a lib root.

UCM can then pick out which of these dependencies it does have, then send those to the server with the pull.v2 request; where Share will cull entire subtrees based on the dependencies it knows UCM has already.

This allows us to use pull.v2 in cases where it's likely to be a small update.

Test coverage

I've tested this locally, I'll throw it up on staging and run it through its paces.

Luckily its' back-compatible with the previous syncv2 version, which simply doesn't do the pre-negotiation.

Loose ends

We may wish to recurse causal-negotiation on lib deps which have missing deps as well. Should be easy enough to include hash-jwts for those;

Or we can do this on the server and include those deps in the initial stream.

@ChrisPenner ChrisPenner merged commit 7698516 into main Feb 5, 2025
4 checks passed
@ChrisPenner ChrisPenner deleted the syncv2/causal-negotiation branch February 5, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant