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

feat: add endpoint to create pacts, pacticipant, version, tags in one request #420

Merged
merged 25 commits into from
Apr 27, 2021

Conversation

bethesque
Copy link
Member

No description provided.

@bethesque bethesque marked this pull request as draft April 17, 2021 05:03
@@ -0,0 +1,38 @@
RSpec.describe "publishing a pact using the all in one endpoint" do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of how it will work here.

:buildUrl => "http://ci/builds/1234",
:contracts => [
{
:role => "consumer",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the field "role". We need some way of saying "is this a consumer defined contract or a provider defined contract". "Type" is such an overloaded, non-descriptive term. "contractAuthor" sounds like it's a person. "contractSpecifier" also. "contractSource"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role made sense to me, it was clear was what it was when I saw the value for it

:buildUrl => "http://ci/builds/1234",
:contracts => [
{
:role => "consumer",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role made sense to me, it was clear was what it was when I saw the value for it

@bethesque
Copy link
Member Author

After chatting with Tim, I've dropped the "role" field in favour of just explicitly setting the consumer name and provider name for each contract. I prefer this because it doesn't introduce any new terminology.

It does seem redundant to set the consumer and provider names in the contract metadata as well as in the content, but this endpoint will be modified to allow publication of OAS documents and other types in the future, where the contract content will not contain the consumer and provider names.

@bethesque
Copy link
Member Author

@uglyog I've base64 encoded the content for various reasons, one of which is so that we can publish non-utf8 contracts if need be. Can you see this being useful? Or is that covered by encoding the interaction/message contents in the contract itself?

@uglyog
Copy link
Member

uglyog commented Apr 22, 2021

@uglyog I've base64 encoded the content for various reasons, one of which is so that we can publish non-utf8 contracts if need be. Can you see this being useful? Or is that covered by encoding the interaction/message contents in the contract itself?

I can't see a need for it, all the forms I know of will either be JSON or YAML. Even SCC is Groovy code, I think. But it doesn't hurt.

@bethesque
Copy link
Member Author

bethesque commented Apr 26, 2021

Ok. Sorry, this is another big one @uglyog, but feel free to gloss over the implementation. The important things to know are:

@bethesque bethesque requested a review from uglyog April 26, 2021 06:57
@bethesque
Copy link
Member Author

bethesque commented Apr 26, 2021

Output from Ruby client

Screen Shot 2021-04-26 at 4 59 17 pm

@bethesque bethesque marked this pull request as ready for review April 26, 2021 07:01
@bethesque bethesque merged commit df899eb into master Apr 27, 2021
@bethesque bethesque deleted the feat/all-in-one-pact-publish branch April 27, 2021 03:54
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

Successfully merging this pull request may close these issues.

2 participants