Fix issue with Username being required for Shared server import config#9971
Fix issue with Username being required for Shared server import config#9971KijongHan wants to merge 2 commits into
Conversation
validate_json_data required Username for all non-Service connections, rejecting legitimate JSON that only carried SharedUsername. Accept either attribute when Shared is true; keep Username required for non-shared servers. Extract is_shared as a local while we're here — it's now referenced twice in the loop body. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…d servers When loading database servers from an import file, fall back to SharedUsername for the underlying server.username when the server is shared and no explicit Username is provided. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughChanges to server import validation and loading logic in ChangesShared Server Configuration and Validation
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolves issue #9226
What does this PR do?
This PR resolves
Username attribute not found for server 'shared_server'errors where server json import validation logic had a hard constraint onUsernamebeing required even whenSharedwas set to true. This PR introduces more coherent constraint validation logic for shared servers so that you are required to either provideSharedUsernameorUsername(for backwards compatibility). Furthermore, the underlying data model 'Username' property is set to 'SharedUsername' (for shared servers only) to align with UI behaviour for setting this fallback.The UX also feels better as when after registering shared servers with only the
SharedUsernameset, when trying to connect to the server for the first time it prompts for the password (instead of showing an infinite loading spinner because the underlyingUsernameis not set)Summary of changes
add separate
Usernameconstraint validation logic for shared servers when importingservers.jsonadd fallback to set
UsernametoSharedUsernamefor shared servers so that the UX flow matches the manual UI creation flow for registering new shared serversSummary by CodeRabbit