Add optional dbname override to MicrosoftSQLServerConnector.build_uri#8017
Merged
Conversation
The MSSQL discovery monitor in fidesplus needs to target a different database per scan without mutating the connection config's secrets. Extending build_uri with an optional dbname override is cheaper than duplicating URL-construction logic (which is how read_only_connection ended up unsupported in the monitor — see fidesplus#3459). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (84.96%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8017 +/- ##
=======================================
Coverage 84.96% 84.96%
=======================================
Files 632 632
Lines 41471 41471
Branches 4836 4836
=======================================
+ Hits 35235 35237 +2
+ Misses 5136 5134 -2
Partials 1100 1100 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dsill-ethyca
approved these changes
Apr 29, 2026
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.
https://ethyca.atlassian.net/browse/ENG-3592
Description Of Changes
The fidesplus MSSQL discovery monitor needs to target a specific database on each scan iteration. Today it duplicates the URL-construction logic from
MicrosoftSQLServerConnector.build_uri(in its owncreate_enginemethod) because there's no way to parameterize the dbname through the connector. That duplication is howread_only_connectionended up silently ignored by D&D scans — see fidesplus#3459.This PR adds an optional
dbname: Optional[str] = Noneparameter toMicrosoftSQLServerConnector.build_uri. When provided, it overrides the database name from secrets; otherwise behavior is unchanged. The companion fidesplus PR (stacked on 3459) will swap the monitor's inline URL construction forconnector.build_uri(db_name).Code Changes
src/fides/api/service/connectors/microsoft_sql_server_connector.py—build_urinow accepts an optionaldbnameargument;URL.create(..., database=dbname or config.dbname, ...). No other behavior changes.tests/ops/service/connection_config/test_microsoft_sql_server_connector.py— New test module covering default behavior, dbname override (including assertion that secrets are not mutated), andread_only_connectionrouting across enabled/disabled/unset cases (parameterized).Steps to Confirm
pytest tests/ops/service/connection_config/test_microsoft_sql_server_connector.py— all 5 tests (1 default + 1 override + 3 read_only param cases) should pass.connector.build_uri()without arguments is unchanged.Pre-Merge Checklist
CHANGELOG.mdupdated🤖 Generated with Claude Code