question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build passes when provider is removed

See original GitHub issue

We are facing an issue in our pipelines when removing a Provider java class, as it stands we should be validating that the consumers are not affected when the provider is deleted or changed. But the pipeline is passing. At the moment, we are creating a branch where we remove Provider classes, expecting the pipeline to fail when tested with all current consumers. To run the pipeline we are using a multiple step approach, starting with a mvn call with the following mvn arguments

mvn -B -Dpactbroker.consumerversionselectors.tags=master -Dpactbroker.providerTags=master -Dpactbroker.host=${PACT_BROKER_HOST} -Dpactbroker.auth.token=${PACT_BROKER_TOKEN} -Dpact.verifier.publishResults=true -Dpact.provider.version=$PACT_PROJECT_VERSION -Dpact.provider.tag=$BITBUCKET_BRANCH verify

In the logs we are able to see that we are checking against the consumers, but the following appears

Not all of the 6 were verified. The following were missing:

xxxxCommand

yyyyCommand

But it still passes. And a second step where we call can-i-deploy in a docker command

mvn pact:publish -Dpact.broker.token=$PACT_BROKER_TOKEN -Dpact.broker.url=https://$PACT_BROKER_HOST -Dpact.projectVersion=$PACT_PROJECT_VERSION -Dpact.consumer.tags=$BITBUCKET_BRANCH
docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL=https://$PACT_BROKER_HOST -e $PACT_BROKER_TOKEN pactfoundation/pact-cli:latest broker can-i-deploy --broker-base-url $PACT_BROKER_HOST --broker-token $PACT_BROKER_TOKEN --pacticipant ${BITBUCKET_REPO_SLUG} --version $PACT_PROJECT_VERSION --to master --retry-while-unknown 60 --retry-interval 10

I assume that the first step of the pipeline, the maven call, should fail as the contract will be broken.

  • Are we wrongly configuring pact? We have filtering enabled.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mefellowscommented, Jul 1, 2021

OK so this makes a bit more sense.

Note the warning:

Screen Shot 2021-07-01 at 10 17 27 pm

Unless I’m mistaken about a JVM specific feature, filtering is intended for isolating one or more tests for dev reasons. It’s not designed for integrating back to the broker, because it wouldn’t receive a transactional, binary true/false response, to be able to determine compatibility etc.

This also explains why your contracts are pending, because verification results haven’t been published to prove you’re compatible. The contract is still pending, regardless of whether or not it can satisfy the needs of the consumer.

So your can-i-deploy still works, presumably, because as far as its concerned, your provider hasn’t changed and the version that works still satisfies the contract.

0reactions
mefellowscommented, Jul 1, 2021

Good to hear (and thank goodness) - thanks for clarifying @mcarn .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tried to listen to a value exposed with provider, from outside of ...
I am getting this error after updating to latest version.
Read more >
provider | Flutter Package - Pub.dev
A wrapper around InheritedWidget to make them easier to use and more reusable.
Read more >
Simple app state management - Flutter documentation
A simple form of state management.
Read more >
Data not updating with Provider, Flutter - Stack Overflow
The way it is set now (or at least I think so), I pass the user object to the changeUserInfo method, where the...
Read more >
How to Use the Provider Pattern in Flutter - freeCodeCamp
Create a new Flutter project and name it whatever you want. First we need to remove all the comments so that we have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found