Skip to content

CHORE: sanitize remaining dummy connection strings to Server=localhost - #704

Merged
Jahnvi Thakkar (jahnvi480) merged 1 commit into
mainfrom
jahnvi/sanitize-remaining-connstr
Aug 5, 2026
Merged

CHORE: sanitize remaining dummy connection strings to Server=localhost#704
Jahnvi Thakkar (jahnvi480) merged 1 commit into
mainfrom
jahnvi/sanitize-remaining-connstr

Conversation

@jahnvi480

@jahnvi480 Jahnvi Thakkar (jahnvi480) commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

Follow-up to #703. The 1ES SQL-credential push-protection detector (SEC101/037) re-scans the modified test blobs during the GitHub->ADO mirror and flags the remaining dummy UID/PWD connection strings whose Server points at a non-local host. Change all such strings in test_008_auth.py and test_024_bulkcopy_arrow.py to Server=localhost (repo convention). These are fully mocked tests; no assertion depends on the server value. UID-only AD/MSI lines and the connection-string-parser tests are intentionally left unchanged.
Copilot AI lite review requested due to automatic review settings August 5, 2026 13:02
@github-actions github-actions Bot added the pr-size: small Minimal code update label Aug 5, 2026
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_008_auth.py Dismissed
Comment thread tests/test_024_bulkcopy_arrow.py Dismissed
Comment thread tests/test_024_bulkcopy_arrow.py Dismissed
Comment thread tests/test_024_bulkcopy_arrow.py Dismissed
Comment thread tests/test_024_bulkcopy_arrow.py Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a follow-up sanitation pass on test-only dummy connection strings to align with the repo’s committed-credential convention (Server=localhost) and avoid GitHub → ADO mirror push-protection false positives.

Changes:

  • Updated multiple dummy UID/PWD connection strings in tests/test_008_auth.py to use Server=localhost.
  • Updated four dummy UID/PWD connection strings in tests/test_024_bulkcopy_arrow.py to use Server=localhost.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_008_auth.py Replaces remaining dummy Server=test / Server=s SQL-auth connection strings (with UID/PWD) to Server=localhost.
tests/test_024_bulkcopy_arrow.py Replaces remaining dummy Server=testhost SQL-auth connection strings (with UID/PWD) to Server=localhost.

Comment thread tests/test_024_bulkcopy_arrow.py
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

81%


📈 Total Lines Covered: 7357 out of 8973
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No 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

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@jahnvi480
Jahnvi Thakkar (jahnvi480) merged commit 217a63f into main Aug 5, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: small Minimal code update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants