-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Filtering by Consumers when loading from PactBroker is broken #1193
Comments
Same for me
It will work even if change to |
@uglyog please take a look at the created PR for this |
I think I've hit exactly the same problem when I upgraded the pact broker earlier today, and it's down to which api is used to retrieve the pacts, with the old api removed when pact for verifications came out of beta. @artemptushkin and @marcos-scholtz - just to confirm, with which version of the broker you run into this? |
@anto-ac I think the latest |
I've updated the pact broker loader to send the consumer names in the selectors if using the new endpoint. The pact broker should do the filtering. When using the old end-point, it works as before. |
Has anyone had a chance to verify the changes? @artemptushkin maybe? If they work as expected, I'd be happy to release. |
@artemptushkin the latest version of the broker has the new for-verification endpoint enabled by default. It also has a feature flag to use the old endpoint. I guess we'd have to make sure the changes work with both. |
I can release any time - I would just feel safer if we were certain this change works with both endpoints. |
@anto-ac I tested it with 2.66.0 broker and this env variable, there wasn't |
Amazing @artemptushkin ! Thank you so much for testing. I'll try and release a new version when I get a chance, unless @rholshausen gets there before me. |
@artemptushkin 4.1.8 is out. I am going to close this based on your testing. |
When loading pacts from the PactBroker, one can filter them by consumer(s) using the system-property:
When doing this however, it always results in a "NoPactsFoundException". Without this parameter, it does find the pact correctly for this consumer.
The reason seems to be in the PactBrokerLoader class, in line 195:
According to my tests, "consumers" is a List of "PactBrokerResult" instances. The PactBrokerResult has a "name" field, but it contains the following text:
This text does NOT match the "consumerInclusions", they merely contain "my-consumer-name".
One solution could be to simply check that "my-consumer-name" is contained in the result's name field in any position, but this sounds hacky, it would probably be better to load the specific pact from the broker and check the real consumer name, but that's one call more for each consumer.
The text was updated successfully, but these errors were encountered: