Add IgnoredQueryParameters support to SetDefaultMatcherOptions#26347
Add IgnoredQueryParameters support to SetDefaultMatcherOptions#26347
Conversation
…-version during playback Add IgnoredQueryParameters field to SetDefaultMatcherOptions in the recording package to support ignoring specific query parameters during playback matching. Configure the resourcemanager test proxy to ignore the api-version query parameter during playback, avoiding the need to re-record tests when only the API version changes. Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
…nternal changes for follow-up PR Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Done in c98e7e5. This PR now only contains the |
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce unnecessary re-recording of ARM package tests by allowing the recording playback matcher to ignore specific query parameters (notably api-version) when matching requests during playback.
Changes:
- Adds
IgnoredQueryParameterssupport toSetDefaultMatcherOptionsand forwards it to the test-proxyCustomDefaultMatcherpayload. - Updates ARM
testutil.StartProxyto ignoreapi-versionduring playback matching. - Adds a
replacedirective insdk/resourcemanager/internalto consume the localsdk/internalchanges.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/internal/recording/matchers.go | Extends default matcher options with ignored query parameters and serializes them to the proxy matcher config. |
| sdk/resourcemanager/internal/testutil/recording.go | Configures the proxy matcher to ignore api-version to prevent playback mismatches after API version bumps. |
| sdk/resourcemanager/internal/go.mod | Adds a local replace for sdk/internal to compile against the newly added matcher option. |
| sdk/resourcemanager/internal/go.sum | Removes sums for sdk/internal consistent with using a local replace. |
Co-authored-by: tadelesh <1726438+tadelesh@users.noreply.github.com>
Changelog added in 690a29d. For the follow-up PR: I've prepared the |
When ARM packages bump API versions, all recording tests fail on the
api-versionquery parameter mismatch—even for APIs with no functional changes. This forces pointless re-recording. Mirrors .NET'sCustomDefaultMatcher.IgnoredQueryParametersapproach.Changes
sdk/internal/recording/matchers.go: AddIgnoredQueryParameters []stringtoSetDefaultMatcherOptions, serialized asignoredQueryParametersin the JSON body to the test proxy'sCustomDefaultMatchersdk/internal/CHANGELOG.md: Add changelog entry for the newIgnoredQueryParametersfieldUsage
Any consumer of the
SetDefaultMatcherAPI can now specify query parameters to ignore:The
sdk/resourcemanager/internalconsumer changes (callingSetDefaultMatcherwithapi-versionignored inStartProxy) will be in a follow-up PR after this module change is released.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.