CHORE: use Server=localhost in dummy test/benchmark connection strings - #703
Merged
Merged
Conversation
The 1ES SQL-credential push-protection detector (SEC101/037) flags dummy UID/PWD connection strings whose Server points at a non-local host, blocking the GitHub->ADO mirror. Change only the flagged occurrences to Server=localhost (repo convention for committed dummy credentials); the affected assertions do not depend on the server value.
gargsaumya
approved these changes
Aug 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates committed dummy SQL authentication connection strings (those containing UID/PWD) to use Server=localhost, aligning with the repo’s credential-scanning convention and avoiding SEC101/037 SqlLegacyCredentials push-protection blocks during GitHub → ADO mirror sync. The changes are confined to mocked tests and a benchmark docstring example, so runtime behavior should be unchanged.
Changes:
- Replace
Server=<non-local>withServer=localhostin mocked test connection strings in auth and bulkcopy-arrow test suites. - Update the benchmark usage example connection string to use
Server=localhost.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_008_auth.py | Adjusts dummy SQL-auth connection strings in unit tests to use Server=localhost. |
| tests/test_024_bulkcopy_arrow.py | Adjusts mocked bulkcopy-arrow unit-test connection strings to use Server=localhost. |
| benchmarks/bench_bulkcopy_arrow.py | Updates the PowerShell usage example connection string to use Server=localhost. |
Gaurav Sharma (bewithgaurav)
approved these changes
Aug 5, 2026
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 59.9%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 76.2%
mssql_python.__init__.py: 77.6%
mssql_python.row.py: 77.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 81.4%
mssql_python.pybind.connection.connection.cpp: 83.7%
mssql_python.logging.py: 85.5%🔗 Quick Links
|
Jahnvi Thakkar (jahnvi480)
added a commit
that referenced
this pull request
Aug 5, 2026
#704) ### Summary Follow-up to #703. When the GitHub → ADO mirror re-pushes the modified test blobs, the 1ES SQL-credential push-protection detector (`SEC101/037 SqlLegacyCredentials`) re-scans the whole file and flags the **remaining** dummy `UID`/`PWD` connection strings whose `Server` points at a non-local host — not just the 7 lines fixed in #703. This sanitizes all such strings in the two affected test files to `Server=localhost`, which is the repo convention for committed dummy credentials (`.github/copilot-instructions.md`). No behavior change: every affected test is fully mocked (`@patch(...ddbc_bindings.Connection)` / `mssql_python.cursor`) and none of the assertions depend on the server value — they assert on pool keys, token factories, `connection_str` sanitization, and cleanup. Scope (15 lines, `Server=<host>` → `Server=localhost`): - `tests/test_008_auth.py` — 11 strings (`Server=test` / `Server=s`) - `tests/test_024_bulkcopy_arrow.py` — 4 strings (`Server=testhost`) Intentionally left unchanged: - UID-only AD/MSI lines (no password → not a `SqlLegacyCredentials` match). - `tests/test_010_*` / `tests/test_012_*` connection-string-parser tests, where the `tcp:server.database.windows.net` value is integral to what the parser test exercises. - Pipeline YAMLs, which use variables (`$(DB_PASSWORD)`, `$SQL_IP`) or `localhost`/`(localdb)`/`127.0.0.1`. [AB#46836](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/46836)
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.
Summary
The 1ES SQL-credential push-protection detector (
SEC101/037 SqlLegacyCredentials) flags dummyUID/PWDconnection strings whoseServerpoints at a non-local host, blocking the GitHub → ADO mirror sync. This changes only the flagged occurrences toServer=localhost, which is the repo convention for committed dummy credentials (see.github/copilot-instructions.md).No behavior change: the affected tests are fully mocked and none of their assertions depend on the server value; the benchmark line is a docstring usage example.
Changed lines (7 total,
Server=<host>→Server=localhost):tests/test_008_auth.py— 3 lines (1666, 2935, 3339)tests/test_024_bulkcopy_arrow.py— 3 lines (239, 364, 400)benchmarks/bench_bulkcopy_arrow.py— 1 line (23, docstring example)Identical but unflagged connection strings elsewhere in these files were intentionally left untouched to keep the diff minimal.
AB#46836