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

pact:can-i-deploy retryInterval/retriesWhenUnknown not working as expected #1405

Closed
bawoodruff opened this issue Jul 20, 2021 · 7 comments
Closed

Comments

@bawoodruff
Copy link
Contributor

Per the Slack channel conversation:

When I have an unknown version of the pact pushed to the pact broker, I expect that the retry process would occur with the maven plugin until a result is posted or the retry period has expired. Instead, the plugin returns a failure case immediately. Our system is using the OSS pactbroker 2.79.0.

The pact CLI works as expected in this scenario but maven is better suited for our CI configuration. Logging from -X for pact:can-i-deploy is below.

01:15:25 [DEBUG] -----------------------------------------------------------------------
01:15:25 [DEBUG] Goal: au.com.dius.pact.provider:maven:4.2.7:can-i-deploy (default-cli)
01:15:25 [DEBUG] Style: Regular
01:15:25 [DEBUG] Configuration:
01:15:25
01:15:25 true
01:15:25 basic
01:15:25 ${pactbroker.auth.password}
01:15:25 ${pact.broker.serverId}
01:15:25 ${pact.broker.token}
01:15:25 https://redacted
01:15:25 ${pactbroker.auth.username}
01:15:25 PetstoreService
01:15:25 ${pacticipantVersion}
01:15:25 10
01:15:25 300
01:15:25
01:15:25 ${pact.tag}
01:15:25
01:15:25 [DEBUG] =======================================================================
01:15:25 [INFO]
01:15:25 [INFO] --- maven:4.2.7:can-i-deploy (default-cli) @ bryanwconsumer01 ---
...
01:15:26 [DEBUG] Configuring mojo au.com.dius.pact.provider:maven:4.2.7:can-i-deploy from plugin realm ClassRealm[plugin>au.com.dius.pact.provider:maven:4.2.7, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@4b85612c]
01:15:26 [DEBUG] Configuring mojo 'au.com.dius.pact.provider:maven:4.2.7:can-i-deploy' with basic configurator -->
01:15:26 [DEBUG] (f) latest = true
01:15:26 [DEBUG] (f) pactBrokerAuthenticationScheme = basic
01:15:26 [DEBUG] (f) pactBrokerUrl = https://redacted
01:15:26 [DEBUG] (f) pacticipant = PetstoreService
01:15:26 [DEBUG] (f) retriesWhenUnknown = 10
01:15:26 [DEBUG] (f) retryInterval = 300
01:15:26 [DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@4a50d04a
01:15:26 [DEBUG] -- end configuration --
01:15:26 Computer says no ¯_(?)_/¯
01:15:26
01:15:26 There is no verified pact between the latest version of PetstoreConsumer (5b926da) and the latest version of PetstoreService (fec1397)

@bawoodruff
Copy link
Contributor Author

Added some tracing and deployed locally:

[DEBUG] Matrix Query: /matrix?q[][pacticipant]=PetstoreService&latestby=cvp&q[][latest]=true&latest=true [DEBUG] result = Ok({"matrix":[{"consumer":{"_links":{"self":{"href":"https://redacted/pacticipants/PetstoreConsumer"}},"name":"PetstoreConsumer","version":{"_links":{"self":{"href":"https://redacted/pacticipants/PetstoreConsumer/versions/5b926da"}},"branch":null,"number":"5b926da","tags":[]}},"pact":{"_links":{"self":{"href":"https://redacted/pacts/provider/PetstoreService/consumer/PetstoreConsumer/version/5b926da"}},"createdAt":"2021-07-20T01:14:02+00:00"},"provider":{"_links":{"self":{"href":"https://redacted/pacticipants/PetstoreService"}},"name":"PetstoreService","version":null},"verificationResult":null}],"summary":{"deployable":null,"failed":0,"reason":"There is no verified pact between the latest version of PetstoreConsumer (5b926da) and the latest version of PetstoreService (fec1397)","success":0,"unknown":1}})

@bawoodruff
Copy link
Contributor Author

Tracked this down, submitting a PR

@bawoodruff
Copy link
Contributor Author

#1406

uglyog added a commit that referenced this issue Jul 21, 2021
fix: retry condition for the pactbroker unknown response #1405
@uglyog
Copy link
Member

uglyog commented Jul 21, 2021

4.2.8 is released

@bawoodruff
Copy link
Contributor Author

Verified. Thanks!

@bawoodruff
Copy link
Contributor Author

CI is not progressing when the pact is verified.

@bawoodruff bawoodruff reopened this Jul 22, 2021
@bawoodruff
Copy link
Contributor Author

bawoodruff commented Jul 22, 2021

Re-verified that the 4.2.8 version was handling the unverified case correctly and progressed when a result was posted. The issue I ran into was that the verification was not completed for all versions and the plugin retried as it should. When the verification was posted correctly, the plugin worked as expected.

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

No branches or pull requests

2 participants