Open fitzoh opened 7 years ago
I would prefer to remove this check from the broker, related issue is https://github.com/pact-foundation/pact_broker/issues/35
Ah, I was wondering if that issue existed. Assuming that's made configurable by a query param or something, there should probably be a corresponding flag on the maven/gradle side as well.
I like the idea of manual confirmation when you're creating a "similar" pacticipant, but the cognitive overhead should be lower, such as rerunning the command with -DforceCreation (or something like that) instead of opening confluence, finding the pact page, and updating the curl command with the new pacticipant name (which is what I currently do every time there's a new service).
Is the publish task not outputing the error text from the response body? The error text has the exact command to run.
Just tested it, this is the relevant output I'm seeing
Publishing consumer-producer.json ... FAILED! 409 Conflict - This is the first time a pact has been published for "consumer".
[ERROR] Failed to execute goal au.com.dius:pact-jvm-provider-maven_2.11:3.4.0:publish (default-cli) on project consumer: One or more of the pact files were rejected by the pact broker -> [Help 1]
Found the error text... That doesn't address auth, does it? https://github.com/pact-foundation/pact_broker/blob/554c2c6da50f808f3504023c384fae6f35aad229/lib/pact_broker/locale/en.yml#L21
It looks like the maven code is only outputting the first line of the response body.
No, it doesn't include the basic auth credentials in the curl line (we wouldn't want to put the actual credentials in there), but I can add in an example of what it would look like if you think that would be useful?
regarding basic auth: pact-foundation/pact_broker#125
As mentioned in #403, when you publish a pact it will fail if either the consumer or producer have not yet been published, and share a name similar to an existing pacticipant.
You can get around this by manually creating a pacticipant with the given name.
A maven task should be added which can perform this pacticipant creation, and the error message should reference this new task when the aforementioned error occurs.