Auto-install missing database driver extras on sync#1187
Open
ClaireGz wants to merge 3 commits into
Open
Conversation
`nao sync` now installs a missing database driver extra the same way `nao init` does, instead of only printing the missing-extra error and failing. The shared install/prompt logic is factored into `deps.ensure_extras_installed` and reused by both commands. Interactive sessions prompt (default yes); non-interactive/CI sessions auto-install without prompting so sync does not hang. Closes #1184 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🚀 Preview Deployment
Preview will be automatically removed when this PR is closed. |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Address Cubic P3: `_collect_databases_to_sync` was a second, independent implementation of the item selection the provider loop performs, so a future filtering change could make driver installation target different connections than the sync. Resolve each selection's filtered items once (`_filter_items_for_selection`) and reuse that list for both missing-driver-extra detection and provider execution, so the two can no longer diverge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Address Cubic P2: resolving all selections up front moved `get_items()` outside the per-provider exception handling, so a single provider's resolution failure aborted the whole sync command. Capture each selection's resolution result (items or error) into a `PlannedSync` once — preserving the single source of truth for which items are synced — and re-raise a captured resolution error inside the per-provider try/except so it is recorded as a failure, other providers still sync, and the summary prints. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #1184
Implemented
nao syncconnects to a warehouse whose driver extra isn't installed, it now auto-installs it (or prompts to install), then continues the sync — instead of failing with a "runpip install 'nao-core[...]'" error. This matches whatnao initalready does.Tests done
make lintclean.🤖 Generated with Claude Code