Skip to content

fix: add the dogstatsd url validator call in dd url tests#143

Merged
shreyamalpani merged 1 commit into
mainfrom
shreya.malpani/add-dd-url-tests
Jul 7, 2026
Merged

fix: add the dogstatsd url validator call in dd url tests#143
shreyamalpani merged 1 commit into
mainfrom
shreya.malpani/add-dd-url-tests

Conversation

@shreyamalpani

Copy link
Copy Markdown
Contributor

Follow-up to #142, which trimmed trailing slashes from dd_url/url because dogstatsd's DdUrl/DdDdUrl reject a trailing slash with UrlPrefixError. The tests asserted that the trimmed string matched the expected value. This adds dogstatsd::datadog::DdDdUrl::new(...)/DdUrl::new(...) calls to the earlier unit tests, so the tests fail if trim_url ever regresses in a way that still gets rejected by the prefix validator, instead of only checking the trim behavior.

Copilot AI review requested due to automatic review settings July 7, 2026 19:32
@shreyamalpani shreyamalpani requested review from a team as code owners July 7, 2026 19:32
@shreyamalpani shreyamalpani requested review from kathiehuang and lym953 and removed request for a team July 7, 2026 19:32

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 strengthens the existing DD_URL / DD_DD_URL trailing-slash trimming unit tests by additionally validating that the trimmed URLs are accepted by dogstatsd’s strict prefix validators (DdUrl / DdDdUrl). This ensures the tests catch regressions where trimming behavior might still leave a value that the downstream validator rejects.

Changes:

  • In the DD_DD_URL trailing-slash test, add a dogstatsd::datadog::DdDdUrl::new(...) assertion to ensure the trimmed value passes strict URL-prefix validation.
  • In the DD_URL trailing-slash test, add a dogstatsd::datadog::DdUrl::new(...) assertion for the same reason.

@shreyamalpani shreyamalpani merged commit ddb4378 into main Jul 7, 2026
28 checks passed
@shreyamalpani shreyamalpani deleted the shreya.malpani/add-dd-url-tests branch July 7, 2026 19:48
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.

3 participants