Skip to content

Deprecate and ignore the user_agent parameter - #2

Merged
senid231 merged 2 commits into
didww:mainfrom
senid231:default-user-agent
Oct 1, 2026
Merged

senid231 merged 2 commits into
didww:mainfrom
senid231:default-user-agent

Conversation

@senid231

@senid231 senid231 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

The SDK always sends User-Agent: didww-verification-python/<version>.

  • user_agent on VerificationClient and AsyncVerificationClient is published API, so it stays for 1.x but is ignored and emits a DeprecationWarning. Removal is planned for the next major version.
  • The header is set after a caller-supplied http_client is adopted, so that client's own default does not replace it.

Verified with pytest (143 passed), ruff, mypy and pyright.

Summary by CodeRabbit

  • Changes
    • Verification clients now send the SDK’s standard User-Agent, regardless of any supplied user_agent value.
    • Passing user_agent emits a deprecation warning; the parameter is planned for removal in the next major version.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c72f0396-428f-4652-89da-8ba48a9b9efb

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 97906b6c-e91a-43c9-bca7-fe3e153c1d6f

📥 Commits

Reviewing files that changed from the base of the PR and between e73c7f0 and de88c4c.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/didww_verification/async_client.py
  • src/didww_verification/client.py
  • tests/test_user_agent.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Both verification clients now ignore supplied user_agent values, emit a DeprecationWarning when the parameter is set, and use DEFAULT_USER_AGENT for requests. The changelog documents the deprecation and planned removal in the next major version.

Changes

User-Agent handling

Layer / File(s) Summary
Client header behavior and coverage
src/didww_verification/client.py, src/didww_verification/async_client.py, tests/test_user_agent.py, CHANGELOG.md
Both clients make user_agent optional and emit a deprecation warning when a value is supplied. Tests check the default header, warning behavior, and override of a caller-supplied HTTP client's header. The changelog notes the planned removal.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: blurvene

Merge Risk: ⚪ Minimal · up to de88c

Both clients are described as sending the SDK User-Agent while warning when the deprecated parameter is supplied. No merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: deprecating and ignoring the user_agent parameter.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@senid231
senid231 requested a review from blurvene September 29, 2026 09:32
@senid231 senid231 self-assigned this Sep 29, 2026
@senid231
senid231 requested a balanced review from Copilot September 29, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation consistently enforces the fixed header and adequately tests the intended behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Deprecates custom User-Agent configuration while preserving 1.x API compatibility.

Changes:

  • Ignores user_agent and emits DeprecationWarning.
  • Enforces the SDK’s default header for sync and async clients.
  • Adds coverage and changelog documentation.
File Description
src/​didww_verification/​client.py Enforces User-Agent for synchronous clients.
src/​didww_verification/​async_client.py Enforces User-Agent for asynchronous clients.
tests/​test_user_agent.py Tests fixed headers and deprecation warnings.
CHANGELOG.md Documents the deprecation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

Copy link
Copy Markdown

@senid231
senid231 merged commit a5d3bb8 into didww:main Oct 1, 2026
6 checks passed
@senid231
senid231 deleted the default-user-agent branch October 1, 2026 08:34
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.

2 participants