Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add consumer version selectors and pending pacts to verification #217

Merged
merged 3 commits into from Mar 26, 2020

Conversation

mefellows
Copy link
Member

Implements consumer version selectors (see pact-foundation/pact_broker#307) and pending pacts (see ).

The biggest complication here is that the selectors are specified as JSON strings on the CLI - not something we're well prepared for.

In terms of design options I had a few, most notably:

  1. Modify verifier.ts to do the JSON marshaling, but that then meant I needed to do nasty things to hide the true option that is passed to the Arguments class.
  2. Enhance the SpawnArguments type to signal that certain properties were basic "string" values vs "JSON" values - but decided against that large refactor.
  3. Detect an argument value - if it is an object, marshal to JSON, otherwise fall back to existing behaviour. This is the path I chose, because it was so simple to implement.

I also updated the types in Arguments because the values were set as strings, but that is actually an illusion - in reality they are an interface type (SpawnArguments), that could have values as primitives (strings, numbers etc.) or in this new case - an interface.

This was a fairly simple change, but I was concerned about making that class any more complicated, so we may want to revert it.

- add support for Pending Pacts flag
- add support for consumer version selectors

See pact-foundation/pact_broker#320 for background
Copy link
Member

@bethesque bethesque left a comment

Choose a reason for hiding this comment

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

@mefellows there's a short link https://docs.pact.io/pending that you can use in the docs

@bethesque
Copy link
Member

Also docs.pact.io/selectors

@mefellows
Copy link
Member Author

Thanks Beth - updated the links.

@TimothyJones TimothyJones merged commit 2e2475a into master Mar 26, 2020
@TimothyJones
Copy link
Contributor

Nice work, @mefellows !

@mefellows mefellows deleted the feat/consumer-version-selectors branch March 26, 2020 00:43
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.

None yet

3 participants