-
-
Notifications
You must be signed in to change notification settings - Fork 111
Implement background service to auto-sync package operations between instances #5550
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
Conversation
07ecd6d to
95e44a3
Compare
between instances
95e44a3 to
16ae0d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, this is great. Just one notable gripe: as of this PR, the extension is the thing that's managing the sync service - and the sync service has bled a bit into the language server itself.
Rather,
- (long-term) the sync service should be managed by some broader 'dev server' that happens to serve the language server, mcp server(s), and sync. So as part of a CLI install, someone should be able to type
dark dev-server start - for now, let's just have a tiny separate CLI app that just does sync - takes a 'start' or 'stop' command/arg. Then, we can remove the LSP way of doing things, and have the extension call upon the separate CLI app rather than do things via a LSP-centric handshake
- I'm not sure what to do about the config file -- if syncing is 'separate' where would those things live? I'm open to any options, incl. push-back against it being a 'separate app' but would be happy to think through other options.
- the 'main' CLI can call upon the 'separate' syncing CLI app, or something?
- certainly, the main CLI app shouldn't have a
sync-service-loopthing exposed in the commands (in core.dark)
We're in a sort of in-between awkward stage, and will end up iterating here a few times over the next weeks and beyond, so any progress in these directions is fine / good enough.
Tangentially - do we still need vscode-extension/client/src/commands/instanceCommands.ts? (Seems empty)
4cad828 to
9090a1f
Compare
7d9375e to
b497ea0
Compare
caa5ff9 to
09e5b6e
Compare
This PR adds a background sync service that automatically synchronises package ops between Darklang instances. The sync service auto-starts when you launch either the CLI or the VS Code extension.
Test:
http://dark-packages.dlio.localhost:11003/statsmatcheshttp://dark-packages.dlio.localhost:11001/stats)DARK_CONFIG_DB_NAME=data-instance2.db ./scripts/run-cli val Stachu.Test.syncTestValue "\"Created in instance2\"", verify they appear on local instance (by checking logs or stats)