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

Gradle: Pact Public Task fails when using Semantic Release Plugin #1228

Closed
sneufeind opened this issue Oct 15, 2020 · 2 comments
Closed

Gradle: Pact Public Task fails when using Semantic Release Plugin #1228

sneufeind opened this issue Oct 15, 2020 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@sneufeind
Copy link
Contributor

sneufeind commented Oct 15, 2020

Hey guys,

i regnozied that there is a problem when your pact -gradle-plugin and the de.gliderpilot.semantic-release-plugin are applied together.

The Problem
It leads to the following error:

No signature of method: au.com.dius.pact.core.pactbroker.PactBrokerClient.uploadPactFile() is applicable for argument types: (File, org.ajoberstar.gradle.git.release.base.ReleasePluginExtension$DelayedVersion...) values: [C:\Users
\projects\user-client\build\pacts\user-consumer-user-provider.json, ...]
Possible solutions: uploadPactFile(java.io.File, java.lang.String), uploadPactFile(java.io.File, java.lang.String, java.util.List)

Analysis
It points out that the method uploadPactFile of your PactBrokerClient.kt expects a version property from type String, but it could be any object (as the gradle Project spec says).

Look at here: https://github.com/DiUS/pact-jvm/blob/503856e9fbfc2120723475c86ccd286fb9bc9fa0/provider/gradle/src/main/groovy/au/com/dius/pact/provider/gradle/PactPublishTask.groovy#L60

A Solution
I would suggest to invoke the toString() before you put it into the upload method, like this:

Before:
result = brokerClient.uploadPactFile(pactFile, version, pactPublish.tags)

Fixed:
result = brokerClient.uploadPactFile(pactFile, version.toString(), pactPublish.tags)

Would it possible to fix that the next days?

Thank you in advance

@uglyog uglyog added the bug Indicates an unexpected problem or unintended behavior label Oct 18, 2020
@uglyog
Copy link
Member

uglyog commented Oct 18, 2020

4.1.9 released with the fix

@sneufeind
Copy link
Contributor Author

This issue should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants