Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 23, 2025

  • Identify the root issue
    • The Parse function doesn't recognize "pwd" as a valid alias for "password" in connection strings
  • Implement the solution
    • Added "pwd" to adoSynonyms map as a key that maps to the Password constant
  • Add test coverage
    • Created a simple test to verify that the alias is correctly mapped
  • Update documentation
    • Added entry in CHANGELOG.md for the bug fix

Fixes #262.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.07%. Comparing base (661c0e6) to head (7716a79).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
- Coverage   75.16%   75.07%   -0.10%     
==========================================
  Files          32       32              
  Lines        6471     6471              
==========================================
- Hits         4864     4858       -6     
- Misses       1322     1327       +5     
- Partials      285      286       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shueybubbles
Copy link
Collaborator

Add an entry to the connStrings array in TestValidConnectionString in msdsn/conn_str_test.go to test this new parameter.

Copy link
Author

Copilot AI commented May 23, 2025

Add an entry to the connStrings array in TestValidConnectionString in msdsn/conn_str_test.go to test this new parameter.

Added a test in msdsn/pwd_test.go that verifies the "pwd" alias works correctly in connection strings in 312bb45.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • nonexistant-dns.svc.cluster.local
  • server.database.windows.net
    • Triggering command: /tmp/go-build189611827/b259/go-mssqldb.test -test.testlogfile=/tmp/go-build189611827/b259/testlog.txt -test.paniconexit0 -test.timeout=10m0s (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of shueybubbles May 23, 2025 18:39
@shueybubbles shueybubbles marked this pull request as ready for review May 23, 2025 19:04
@shueybubbles shueybubbles requested a review from Copilot May 23, 2025 19:04
Copy link

@Copilot Copilot AI left a comment

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 fixes issue #262 by updating the Parse function to recognize "pwd" as a valid alias for the password field in connection strings. Key changes include adding the "pwd" entry to the adoSynonyms map, adding a corresponding test case, updating the driver version in version.go, and updating the changelog.

Reviewed Changes

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

File Description
version.go Bumped driver version from v1.8.0 to v1.8.2
msdsn/conn_str.go Added a new alias "pwd" mapping to the Password field
msdsn/conn_str_test.go Added test case to verify the "pwd" alias mapping
CHANGELOG.md Updated changelog with the bug fix entry
Comments suppressed due to low confidence (1)

msdsn/conn_str_test.go:110

  • [nitpick] Consider adding additional test cases for alternate casings (e.g., "PWD", "Pwd") if the parsing is expected to be case-insensitive, ensuring comprehensive alias mapping validation.
{"pwd=placeholder", func(p Config) bool { return p.Password == "placeholder" }},

Copy link

@apoorvdeshmukh apoorvdeshmukh left a comment

Choose a reason for hiding this comment

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

:shipit:

@shueybubbles shueybubbles merged commit d3c6336 into main May 28, 2025
11 checks passed
@shueybubbles shueybubbles deleted the copilot/fix-262 branch May 28, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse does not recognize Pwd as a valid password field alias
5 participants