airtasker / proxay

Proxay is a record/replay proxy server that helps you write faster and more reliable tests.
Other
76 stars 6 forks source link

Adding match as command line arguement for strict request matching #556

Closed karishma-kasliwal closed 10 months ago

karishma-kasliwal commented 11 months ago

Adding --match where we can pass boolean value for strict request matching while running proxay in 'Replay' mode. Skipping --match will consider strict matching false, and proxay will behave as before. Passing --match as true would enable strict request matching, that is zero differences between current request and recorded one.

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

timdawborn commented 11 months ago

Hi @karishma-kasliwal, I don't fully understand the purpose of the proposed changes. Could you help me understand what you're trying to achieve here?

Reading the changeset, you're adding a command line argument to be able to change the minimum number of differences needed to consider a tape as matching. The default value for this is +Infinity, meaning that any tape that has any notion of similarity will be considered as a match.

Passing a value of 0 to this argument would mean that proxay would only return tapes with a 100% match (0 differences).

Am I correct that, in practice, no value other than +Infinity and 0 would be provided here? I can't immediately think of any other values that would make sense here. If so, I would suggest that this new CLI argument makes more sense as a flag rather than as a number?

karishma-kasliwal commented 11 months ago

Hi @karishma-kasliwal, I don't fully understand the purpose of the proposed changes. Could you help me understand what you're trying to achieve here?

Reading the changeset, you're adding a command line argument to be able to change the minimum number of differences needed to consider a tape as matching. The default value for this is +Infinity, meaning that any tape that has any notion of similarity will be considered as a match.

Passing a value of 0 to this argument would mean that proxay would only return tapes with a 100% match (0 differences).

Am I correct that, in practice, no value other than +Infinity and 0 would be provided here? I can't immediately think of any other values that would make sense here. If so, I would suggest that this new CLI argument makes more sense as a flag rather than as a number?

I have made changes as requested.

timdawborn commented 11 months ago

@karishma-kasliwal feel free to merge this PR whenever you're ready. We'll do a release for you once it's merged.

karishma-kasliwal commented 10 months ago

elease for you once it's merge

@timdawborn I dont see an option to merge this PR. It could be possible that I dont have the required permissions. Could you please help me by merging this PR.

timdawborn commented 10 months ago

@karishma-kasliwal This functionality has been included in the newly published 1.7.0 release: https://github.com/airtasker/proxay/releases/tag/v1.7.0

Thanks again for contributing!