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-jvm-provider-gradle uses project.version for both pactVerify and pactPublish tasks. #929

Closed
toastyblast opened this issue Aug 29, 2019 · 4 comments

Comments

@toastyblast
Copy link

When I set

pact {
   serviceProviders {
      'Provider-Name' {
         // Mock server host settings...

         // This is changing the project.version, not just the provider version for pact!
         version = branchName() + '-' + abbreviatedId()

         if ('pactVerify' in gradle.startParameter.taskNames) {
            hasPactsFromPactBroker('http://localhost:80/')
         }
      }
   }
}

for pactVerify or for pactPublish

pact {
   serviceProviders {
        // Again, this is changing the project.version, not just the consumer version for pact!
        version = 'PROV-TEST-' + grgit.head().abbreviatedId
        tags = [grgit.branch.current.name]

        pactDirectory = file('./test/pact/consumerPacts')
        pactBrokerUrl = 'http://localhost:80/'
   }
}

The value setting version in either one of them also changes project.version. In our team we want the consumer and provider version to be the git name and hash of the branch the pact as been sent/verified from to the broker for clarity, and not the Gradle project version. This is currently causing a breaking issue, as the jar files we generate DO use the project.version, and we do not want those jar files to change names!

Can this please be changed/fixed to allow one to set provider and consumer versions different from project.version? I understand it as a default, but if someone wants it changed, they shouldn't have to change the whole Gradle project's version.

We're using pact-jvm-provider-gradle-2.12 version 3.6.12.

@toastyblast
Copy link
Author

My excuses, the second one is incorrect. Setting version in the publish section does not change the project.version. That only makes me more surprised though, why do that and not allow the same for verify?

toastyblast pushed a commit to toastyblast/pact-jvm that referenced this issue Aug 31, 2019
toastyblast pushed a commit to toastyblast/pact-jvm that referenced this issue Aug 31, 2019
@toastyblast
Copy link
Author

I never got a response on this issue ticket either, nor was it ever closed, so I assume this is still a work in progress?

So, after this change was merged a new version was created, however, this version does not include the fix.

Now 15 days later, I still haven't seen any updates. Can I be given any idea or indication of when to expect this change to be implemented so we can make use of it?

@uglyog
Copy link
Member

uglyog commented Sep 27, 2019

Response is on the PR #931

@toastyblast
Copy link
Author

Thank you for the heads up. I've seen the release, I'll get to implementing it for my team now. Once again, many thanks for the help!

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