bethskurrie
2018-03-26 01:16
has joined #pact-broker

bethskurrie
2018-03-29 19:57
/github subscribe pact-foundation/pact_broker issues

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker pulls

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker commits

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker statuses

bethskurrie
2018-03-29 20:22
/github unsubscribe pact-foundation/pact_broker public

bethskurrie
2018-03-29 22:13
added an integration to this channel: https://pact-foundation.slack.com/services/B9YEJCV19

bethskurrie
2018-03-29 22:14
removed an integration from this channel: https://pact-foundation.slack.com/services/B9YEJCV19

uglyog
2018-04-03 23:40
has joined #pact-broker

bethskurrie
2018-04-05 04:09
/github subscribe dius/pact_broker-docker

bethskurrie
2018-04-05 04:19
/github subscribe pact-foundation/pact_broker-client

bethskurrie
2018-04-05 04:28
added an integration to this channel: https://pact-foundation.slack.com/services/B9YEJPQQK

bethskurrie
2018-05-02 04:54
/github subscribe pact-foundation/pact_broker releases

bethskurrie
2018-05-02 04:55
/github unsubscribe pact-foundation/pact_broker deployments

sgleadow
2018-05-09 07:06
has joined #pact-broker

abubics
2018-05-09 07:10
has joined #pact-broker

brentbarker9
2018-05-09 20:57
has joined #pact-broker

bethskurrie
2018-05-10 03:52
/github unsubscribe DiUS/pact_broker-docker commits

bethskurrie
2018-05-10 03:52
/github unsubscribe DiUS/pact_broker-docker public

tjones
2018-05-15 01:05
has joined #pact-broker

mboudreau
2018-05-20 23:48
has joined #pact-broker

shekharsp27
2018-05-23 05:20
has joined #pact-broker

gopinathlangote11
2018-05-23 13:31
has joined #pact-broker

gnewitt
2018-05-29 22:48
has joined #pact-broker

matt.fellows
2018-06-02 12:19
has joined #pact-broker

hstene
2018-06-02 13:09
has joined #pact-broker

dlucas
2018-06-05 09:33
has joined #pact-broker

richard.peckett
2018-06-07 08:22
has joined #pact-broker

mr.matt.r.long
2018-06-08 14:03
has joined #pact-broker

gonzalogarcia243
2018-06-08 14:59
has joined #pact-broker

matt
2018-06-11 01:39
has joined #pact-broker

bethskurrie
2018-06-11 11:28
/github subscribe pact-foundation/pact_broker releases

mr.matt.r.long
2018-06-11 15:18
@bethskurrie would you be able to point me out how to add authentication to my broker? Probably being blind, but can't see anything in the docs

bethskurrie
2018-06-11 21:33
There's no built in auth @mr.matt.r.long, but you can wrap basic auth around it. I'd recommend using the docker image. Proper auth is the first item on our DiUS hosted broker roadmap, but we haven't had time to pick it up (it's a bit of a background project).


matt.fellows
2018-06-11 21:54
One simple strategy is to add another docker container (e.g. nginx) as a proxy to the broker, and add auth there. Then you only expose the broker port to the proxy container.

mr.matt.r.long
2018-06-12 07:55
Righto, thanks for the help @bethskurrie & @matt.fellows I'll look into it. We're already using the Docker images, so shouldn't be too much effort

mr.matt.r.long
2018-06-12 09:11
Do either of you @bethskurrie or @matt.fellows know the best approach to handling executions from dev machines vs CI. Mainly how to prevent dev builds from populating results on the broker. Was thinking that potentially the basic auth itself on the broker would be able to handle this, in that it the creds are not available on the local builds then the results publishing wouldn't be successful. My only concern here would be if the provider builds remains successful with the 400 responses from the broker. Do you guys have any experience resolving this, or an alternative approach?

bethskurrie
2018-06-12 10:04
Funny @mr.matt.r.long, I was just talking to @uglyog about this yesterday. How you handle this depends on which implementation you're using. Which language are you on?

mr.matt.r.long
2018-06-12 10:05
I'm in process of introducing Pact to my new team. They're largely JVM based, but there's one Go client too

bethskurrie
2018-06-12 10:05
The high level theory is that the pact tests should run as part of your standard build, but the pact publication should be a separate task that only runs on your CI. The pact verification should run as part of your standard provider build, but the publication should be turned off by default, and only turned on in your CI environment, generally by checking for some environment variable.

bethskurrie
2018-06-12 10:06
Unfortunately, pact-jvm has a bug whereby it publishes verifications automatically. I've just raised an issue to have that changed.

bethskurrie
2018-06-12 10:07
You'll need to work out if there's a way you can configure it to be off by default, and only on when you set a certain property or environment variable.

bethskurrie
2018-06-12 10:07
(Sorry, I'm not a java person, so I'm not sure how the configs work)


bethskurrie
2018-06-12 10:09
It only publishes contracts when the tests pass, and the publish is only called on the CI.


bethskurrie
2018-06-12 10:10
(Sorry they're in Ruby, not java, but you'll get the general picture)


bethskurrie
2018-06-12 10:14
I think I'll add a bit on only publishing from CI, thanks to your question.

mr.matt.r.long
2018-06-12 10:26
Awesome thanks for the help. I'll look into what options that I have using the JVM plugins that we're currently trialling, on the consumer side there's a MVN cmd to publish the pact so we can make sure that's only run from CI although I'd like to look into a programatic way to ensure that a developer can't accidentally run it, I'm thinking the broker Auth should handle that. On the Spring Provider plugin it does automatically publish the verification results, there is a workaround in that it won't if the Provider version isn't supplied, so this is an option I can look. Thanks again :thumbsup:

abhilash.hanumanth
2018-06-12 14:26
has joined #pact-broker

mmonson
2018-06-12 20:02
has joined #pact-broker

gbeckmann
2018-06-12 20:43
has joined #pact-broker

richard.peckett
2018-06-13 17:05
peeps is there a quick way to delete a pact from the broker?


bethskurrie
2018-06-13 21:07
There's a open issue for someone to add a button to the UI.

richard.peckett
2018-06-14 09:16
Cheers Beth :thumbsup: :star: as always

slack1
2018-06-16 06:31
has joined #pact-broker

abhilash.hanumanth
2018-06-16 10:08
I ran the pact-jvm consumer tests and published the pact file to a pact broker hosted locally in my system. Now, I am running the pact-jvm provider tests and Last verified column is empty but the provider test is successful. Can someone tell me what could be the reason ?

abhilash.hanumanth
2018-06-16 10:20
My provider code is like this : ``` import au.com.dius.pact.provider.junit.PactRunner; import au.com.dius.pact.provider.junit.Provider; import au.com.dius.pact.provider.junit.VerificationReports; import au.com.dius.pact.provider.junit.loader.PactBroker; import au.com.dius.pact.provider.junit.target.HttpTarget; import au.com.dius.pact.provider.junit.target.Target; import au.com.dius.pact.provider.junit.target.TestTarget; import lombok.extern.slf4j.Slf4j; import org.junit.runner.RunWith; @Slf4j @RunWith(PactRunner.class) @Provider("controllerProvider") @PactBroker(host = "localhost", port = "2001") @VerificationReports(value = {"console", "markdown"}, reportDir = "target/reports") public class JavaAgentControllerProvider { private static final String HOST = "localhost"; private static final int PORT = 8777; @TestTarget public final Target target = new HttpTarget("http", HOST, PORT); } ```

matt.fellows
2018-06-16 10:34
What version of Pact JVM are you using @abhilash.hanumanth?


matt.fellows
2018-06-16 10:39
Could you also please post any relevant logs?

abhilash.hanumanth
2018-06-16 10:49
@matt.fellows: I am using this version of pact-jvm-provider-junit in provider tests : ```testCompile 'au.com.dius:pact-jvm-provider-junit_2.12:3.5.17'```

abhilash.hanumanth
2018-06-16 12:52
@matt.fellows: For some reason, my provider version is empty in the Matrix.

abhilash.hanumanth
2018-06-16 13:30
can someone tell me how to set provider version ? In docs, it says using `pact.provider.version` system property. How and where do I set this system property in provider junit test ?

thomas.heilbronner
2018-06-16 14:56
has joined #pact-broker

abhilash.hanumanth
2018-06-16 15:19
@abhilash.hanumanth shared a file: https://pact-foundation.slack.com/files/UAT4VE1UK/FB8810ASD/image.png and commented: @matt.fellows: For some reason, my provider version is empty in the Matrix.

2018-06-16 15:19
A file, which can't be shown because your team is past the free storage limit, was commented on.

abhilash.hanumanth
2018-06-16 15:28
The same is working till pact jvm 3.5.16

abhilash.hanumanth
2018-06-16 15:30
Last verified column is not populated in pact jvm 3.5.17 but gets populated in 3.5.16 pact jvm.

matt.fellows
2018-06-16 21:35
You could use `System.setProperty(...)` or, more appropriately during CI builds, use the standard `-D` flags to the java command running it

uglyog
2018-06-17 00:19
@abhilash.hanumanth there is a defect in 3.5.17, see https://github.com/DiUS/pact-jvm/issues/694

mngau
2018-06-17 01:27
has joined #pact-broker

thadir
2018-06-17 20:02
has joined #pact-broker

abhilash.hanumanth
2018-06-18 06:06
Thanks @matt.fellows

kevin.meiresonne
2018-06-19 06:56
has joined #pact-broker

rlamb
2018-06-19 21:10
has joined #pact-broker

rlamb
2018-06-19 21:10
Where do I find the doc on how to add users with basic auth to the pact-broker-docker?


rlamb
2018-06-19 21:25
Thanks, @matt.fellows!

matt.fellows
2018-06-19 22:07
no probs!

shekharsp27
2018-06-20 13:46
Hi, while creating a webhook I am getting an error { "errors": { "request.http_method": [ "must be POST. See /doc/webhooks#whitelist for more information." ], "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } } I have observed that there is a hint to add this in "whitelist" could you please help me how to add. As for Jenkins webhook it works only with "GET" method (This is what I have observed). Also to test the webhook locally I need scheme as "http"

bethskurrie
2018-06-21 03:13
@shekharsp27 Did you look at the URL that it told you to read for more information?

bethskurrie
2018-06-21 03:24
Have you tried looking at the documentation for the Pact Broker? https://github.com/pact-foundation/pact_broker/wiki

bethskurrie
2018-06-21 03:36
I'd recommend reading the Configuration page.

shekharsp27
2018-06-21 05:26
@bethskurrie Thanks, looks like I have missed that :disappointed:

bethskurrie
2018-06-21 23:47
Hi all. One of the main things people don't like about the current implementation of CDC that Pact provides is the ability of a consumer to break a provider's build by pushing new or incorrect expectations to the Pact Broker. I've been thinking of a fairly simple solution to "protect" the provider build, by allowing a configuration option that basically says "you can't tag a pact as `master` (configurable tag name) until it has been verified by the `master` (configurable tag name) version of the provider". The way this would work is that the consumer team would publish a new pact with a non-master tag name, and once the provider had implemented the new feature, and published a verification for that pact content from the `master` branch of the provider, then that feature pact would be allowed to be tagged with master. This all pivots around the fact that the verifications belong to the pact *content* rather than the consumer version.

bethskurrie
2018-06-22 00:04
The only problem I see with this solution is that at some stage, a verification will have to be published from the master provider branch for the new content, and this should come from the CI - we don't want to have to have a developer manually verifying the feature pact from the master branch from their developer machine. So I'm thinking of introducing the concept of "wip" pacts - verifications that can run that are expected to fail, and won't fail the build if they fail. We could use tags for this, and if it works, perhaps introduce it as a higher level concept. I imagine the provider build verifying the `master` and `prod` pacts (fetched dynamically from the broker) and failing if the pacts fail, and also, verifying any `wip` pacts that do not already have a successful verification from master (again, fetched dynamically from the broker) but NOT failing if the verification fails.

bethskurrie
2018-06-22 00:06
If you're using webhooks to send git commit statuses for your pacts, this means that the "pact verification status" for a commit on a branch will go green automatically once the provider has successfully verified the new pact.

bethskurrie
2018-06-22 00:07
I'd love some feedback on this design from our Pact Broker users, new and old. I'm pretty sure you'll have some thoughts @cfmack @kevin.meiresonne @matt.fellows @uglyog

cfmack
2018-06-22 00:08
has joined #pact-broker

uglyog
2018-06-22 00:23
This is a good idea, but the main concern would be the complexity in the process. Let's not re-use the tags for this purpose. A higher level concept would be better, maybe a status associated with the pacts and verifications defined a workflow that would allow it to be easy to understand why things are happening.

bethskurrie
2018-06-22 01:05
@uglyog you're right about not re-using tags. I'd like to use it to prove the concept with some of our users, before I invest in making it a higher level concept however. We could do it with almost no coding change.

ragarwal
2018-06-22 01:22
has joined #pact-broker

ragarwal
2018-06-22 01:34
if verifications are not verified at provider side, it should stop consumer from deploying the code to master.

ragarwal
2018-06-22 01:35
we have similar situation in our project. We use git branches and want to make sure we can?t commit breaking changes to either consumer or provider side.

ragarwal
2018-06-22 01:39
Our consumers are publishing pacts tagged by branch name. ex `wip` if that is my branch. When we push the code changes on consumer branch build, it publishes new pact with tag `wip` and verify it against provider `master`. If build passes, it means provider is still full-filling all the consumer expectations and good to deploy the consumer code.

ragarwal
2018-06-22 01:39
else, it will fail the consumer build. We are not doing anything with provider build in this case.

ragarwal
2018-06-22 01:41
to implement consumer?s new expectations, we create `wip` branch at provider side and add the code. When we push the provider code, it will search for pacts tagged with `wip` and verify them. If everything is good, we merge the provider branch to master. Now we have new changes in provider master branch.

ragarwal
2018-06-22 01:42
if consumer build will run now, it will pass and can be merged to master.

bethskurrie
2018-06-22 01:42
@kevin.meiresonne I think this is pretty much what you're doing.


bethskurrie
2018-06-22 06:17
I've released consumer only/provider only/global webhooks in the latest version of the Pact Broker 2.23.0 (and the docker version 2.23.0-1). I've also released an update to the pact broker client that allows you to take a curl command to trigger a build (eg `curl https://ci.foo.org/builds -X POST -d {"foo": "bar"}`) and add a few params to save it as a webhook (eg `pact-broker create-webhook https://ci.foo.org/builds -X POST -d {"foo": "bar"}' --provider Foo --contract-content-changed`)

bethskurrie
2018-06-22 06:19
The following template variables are available now: ``` ${pactbroker.consumerName} ${pactbroker.providerName} ${pactbroker.consumerVersionNumber} ${pactbroker.providerVersionNumber} ${pactbroker.consumerVersionTags} ${pactbroker.providerVersionTags} ${pactbroker.githubVerificationStatus} ${pactbroker.pactUrl} ${pactbroker.verificationResultUrl} ``` Just a reminder that you can send pact verification commit statuses to github now. You can find a template for the request here: https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library

bethskurrie
2018-06-22 06:21
@jonas.lergell the official release is out now

jonas.lergell
2018-06-22 06:21
has joined #pact-broker

bethskurrie
2018-06-22 06:24
@richard.jones ^^ regarding consumer only/provider only/global webhooks

richard.jones
2018-06-22 06:24
has joined #pact-broker

kevin.meiresonne
2018-06-22 06:51
That's indeed very close to what we're doing as well

kevin.meiresonne
2018-06-22 06:56
Are these new variables already available on the hosted broker?

bethskurrie
2018-06-22 07:33
Yes

kevin.meiresonne
2018-06-22 08:20
Still processing this idea in my head, but it sounds interesting. In our case our "master" is not called "master" though, so we'd have to change that in order to benefit from this.

kevin.meiresonne
2018-06-22 08:22
Just a bit concerned if it would break our own workflow, which is already in place and very close to what @ragarwal describes in the blog post.

bethskurrie
2018-06-22 08:23
Master == configurable tag name.

bethskurrie
2018-06-22 08:24
It was just my example.

kevin.meiresonne
2018-06-22 08:24
Tbh, I don't mind having to implement this workflow ourselves, since I can imagine it differs from case to case

bethskurrie
2018-06-22 08:24
I see this as supporting the branch workflow quite well.

kevin.meiresonne
2018-06-22 08:25
yeah, I think it does, just a bit concerned about the "not being allowed to tag a pact as "master""-bit

kevin.meiresonne
2018-06-22 08:26
so if you'd decide to implement this logic, I'd keep it optional

bethskurrie
2018-06-22 08:26
It would enforce what you already do manually, which is to ensure the provider can successfully verify a pact on a branch before you tag a pact as master.

kevin.meiresonne
2018-06-22 08:27
the learning curve of pact and the broker is already quite steep, and you don't want people to pull their hairs out trying to figure out why they can't tag a pact

kevin.meiresonne
2018-06-22 08:27
well, actually we don't stop the provider nor consumer to be already tagged as master

bethskurrie
2018-06-22 08:28
Yes, it is. There would obviously have to be very clear feedback built in.

kevin.meiresonne
2018-06-22 08:28
we use the badges as a verification tool

kevin.meiresonne
2018-06-22 08:28
(and the matrix)

bethskurrie
2018-06-22 08:28
Most people are quite upset about consumers breaking provider builds. This would turn that around.

bethskurrie
2018-06-22 08:29
While giving the consumer a mechanism to make proposed changes.

kevin.meiresonne
2018-06-22 08:31
true


kevin.meiresonne
2018-06-22 08:31
but it could cause issues when a CI is setup differently and it does allow consumers to push to master before provider

kevin.meiresonne
2018-06-22 08:32
which might sound weird, but it could just be their way of working

kevin.meiresonne
2018-06-22 08:32
I mean, its often the chicken or the egg

bethskurrie
2018-06-22 08:33
Every ci is different!

kevin.meiresonne
2018-06-22 08:34
we have for instance a BFF pattern (backend-for-frontend). Now, if we need to make a breaking change for the consumer of the backend, it doesn't really matter which one is pushed first to master

kevin.meiresonne
2018-06-22 08:34
if you push provider first, the latest master of the consumer won't work until it's pushed to master as well

kevin.meiresonne
2018-06-22 08:34
and vice versa

thadir
2018-06-22 08:35
This could work, but the WIP should then be implemented in the PACT clients (as in I need to tell pact-jvm on the publish step and on the verify step trough a parameter that its in a branch.) (now ill start reading the whoel thread :wink:

bethskurrie
2018-06-22 08:35
My recommended workflow is to always push new changes to a non master tag, wait til the provider has verified it successfully on master then merge the consumer branch in.

kevin.meiresonne
2018-06-22 08:35
it's different for a provider functioning as a general purpose api for instance, that needs to guarantee backwards compat

kevin.meiresonne
2018-06-22 08:36
Yeah, that's indeed what we are moving to as well Beth

kevin.meiresonne
2018-06-22 08:36
makes more sense

kevin.meiresonne
2018-06-22 08:38
what would you consider a "wip" pact? Is this any pact not tagged with "master" or "prod"?

bethskurrie
2018-06-22 08:39
Yes @thadir we'd need to add the ability to say "try verifying all the wip pacts that don't have a successful verification already, but don't fail the build if they fail" to the verification configuration code.

thadir
2018-06-22 08:42
I think this could work prity wel. Am at the point that I wanna revisit the pact configuration and pact steps in our CI so that I can actealy start tagging pacts at versions. And Also wana remove pact versions thats are stale. I atm dont tacg the provider that verifies the consumer. Bc it will always break if it doesnt setifies them all. And with WIP I can actealy use the matrix to also see what is in porduction and not. (seeing when its build it will go to production). So im in for this one

bethskurrie
2018-06-22 08:48
@thadir what do you mean about not tagging, because will always break?

bethskurrie
2018-06-22 08:49
You should be able to see what is in production already.

thadir
2018-06-22 08:51
Hmm, atm any contract change from the consumer will break the provider. And not vise versa witch can be somtimes a problem. Its on my 2 do list to have some sort fo flow working that when a consumer builds on master it should be aible to check if the provider can verify there contract. And yes I can see it but (im a bit behind using all the features i am aible to version tag consumers in my ci but the provider part is messed up).

matt.fellows
2018-06-22 08:55
@matt.fellows pinned a message to this channel.

bethskurrie
2018-06-22 09:16
Yeah, the provider tags need to be used to get the real value from the matrix.

bethskurrie
2018-06-22 09:17
You can use the can-i-deploy tool to check the verification status of a pact from the consumer build. That's exactly what it's for.

bethskurrie
2018-06-22 09:18
If the contract hasn't changed since the last successful verification, it will come back true.

bethskurrie
2018-06-22 09:20
If you haven't read the Pact Nirvana document, this should help clarify how to use set up the tags in conjunction with can-i-deploy https://docs.google.com/document/d/e/2PACX-1vRf1kSDccImNipOOm1G-bjcSs-ifbZjf1v54K-dIcq8BLKeFPAAm_bf_p71UKqkRMIx30QWWL-kN8TI/pub

bethskurrie
2018-06-22 09:20
The doc is pretty ugly because it's still a WIP, and I've just published it from my google doc.

kevin.meiresonne
2018-06-22 09:31
@bethskurrie, if these changes would be implemented, if I understand correctly, then the following workflow would no longer break the provider build

kevin.meiresonne
2018-06-22 09:31
ah shoot, I can't paste images here


abubics
2018-06-22 10:15
I love the idea of wip pacts... A problem I've hit recently is feature branches that forgot to update the version number on their first commit breaking the previous pact version

abubics
2018-06-22 10:15
Totally, tags are a very flexible workaround tool ;D

bethskurrie
2018-06-22 10:33
Latest best practise is to always use or include the git sha dynamically in the version number. That should help you avoid that situation.

bethskurrie
2018-06-23 11:02
Actually, the more I think about the wip feature, the more I think, we don't need any change on the consumer side - we just need to add a "pb:wip-pacts-for-provider" relation/resource to the broker, and add code into the verification clients to say "don't fail the task if these verifications fail".

bethskurrie
2018-06-23 11:04
A "wip pact" would be a "latest tagged" pact that didn't yet have a successful verification.

bethskurrie
2018-06-23 11:05
This means the consumer team can push *any* new pact with a non-master tag, and get a verification result without breaking the provider build. If the new pact happens to pass without any changes being made to the codebase, then they can merge/promote (whatever their workflow is) that pact to "master" (or equivalent name), without the provider team having to do any work. This means that when the pact does become a "master" pact, it will be pre-verified, and the consumer can go straight into prod.

bethskurrie
2018-06-23 11:07
@matt.fellows I think this might achieve that no-waiting pipeline you were thinking of.

bethskurrie
2018-06-23 11:08
@uglyog ^^

bethskurrie
2018-06-23 11:09
This would involve almost no action on either the consumer/provider team's behalf, which should address @kevin.meiresonne?s concern that we need to keep it simple.

richard.jones
2018-06-24 22:45
ty!

kevin.meiresonne
2018-06-25 07:21
What's the format of the consumerVersionTags/providerVersionTags variables?

bethskurrie
2018-06-25 07:30
It's in the HAL docs

bethskurrie
2018-06-25 07:30
Click on the doc icon for the pb:webhooks relation in the HAL browser

bethskurrie
2018-06-25 07:31
I'm open to adding other formats too.

kevin.meiresonne
2018-06-25 07:39
that's fine for me. Just a question: I currently resolve the tags by calling describe-version from within our build pipeline. If I understand correctly, this is now redundant and I can just use this variable instead?

bethskurrie
2018-06-25 07:54
It will give you the tags, but it won't tell you if it is the latest of that tag. I should make another var that only has the names of the tags for which this pact is the latest.

kevin.meiresonne
2018-06-25 07:56
so describe-version will give the latest?

bethskurrie
2018-06-25 07:59
I think it's got a flag on the tag to say whether or not it's the latest.

bethskurrie
2018-06-25 08:00
Look at the JSON view of the response

kevin.meiresonne
2018-06-25 08:01
Hmm, don't see that flag

kevin.meiresonne
2018-06-25 08:01
just get a name and href

bethskurrie
2018-06-25 08:12
OK, it must be the matrix JSON I'm thinking of

kevin.meiresonne
2018-06-25 11:28
Hi, I have a rather urgent issue with the hosted broker. It looks like our webhooks no longer work. Pact broker returns a statuscode 500 now. I've tested and verified the http request using postman to be sure it's not related to our build server. Recreating the webhook in the broker also didn't help. Can somebody from DIUS have a look at it? @matt.fellows @bethskurrie

bethskurrie
2018-06-25 11:30
Hello

bethskurrie
2018-06-25 11:31
Looking at it now

bethskurrie
2018-06-25 11:37
@kevin.meiresonne click on the webhook status cell in the menu

bethskurrie
2018-06-25 12:41
if you are using webhooks with headers, please upgrade to 2.23.2 (docker tag 2.23.2-1) as there was a bug found in 2.23.1 where the configured headers weren't being used when executing the webhook.

bethskurrie
2018-06-25 12:44
Thanks to @kevin.meiresonne for identifying it!

kevin.meiresonne
2018-06-25 12:45
Thanks to @bethskurrie for fixing it ! :slightly_smiling_face:

kevin.meiresonne
2018-06-25 15:52
Anyone else having issues with the hosted pact broker being unavailable atm?


kevin.meiresonne
2018-06-25 15:52
We're getting this on the matrix, and 504's on the broker home page

bethskurrie
2018-06-25 22:02
Hi @kevin.meiresonne I'll look into that.

bethskurrie
2018-06-25 22:04
It seems to be up again. I think it was temporarily down while the kubernetes pods were rebalanced

bethskurrie
2018-06-25 22:04
There is work in progress already to improve our deployment process.

matt.fellows
2018-06-25 22:04
There was definitely a scaling even that seems to be over about 2am AEST

bethskurrie
2018-06-25 22:08
The quickest way is to open the URL in the HAL API browser and sent it a DELETE request.

kevin.meiresonne
2018-06-26 05:45
A delete request to where?

bethskurrie
2018-06-26 05:52
Sorry @kevin.meiresonne I replied on the wrong thread.

liran.tal
2018-07-05 05:23
has joined #pact-broker

matt.fellows
2018-07-05 07:25
Please let us know if you?re experiencing issues with your broker

mr.matt.r.long
2018-07-05 13:38
Hi all, I have a question regarding the best practise use of the can-I-deploy cli cmd. If the Pact's have not been verified yet (perhaps they've just been published during the build), should the can-i-deploy *fail* the deploy step within the CI process? I would prefer that the deploy waits until it is verified, then either pass/fail the build appropriately. Anyone else overcome this? I'm primarily thinking of deploys to an integration environment, rather than production (at the minute). Also worth pointing out Im using Teamcity.

bethskurrie
2018-07-05 21:36
This is a really good question. If you're expecting the verification to happen within a few minutes, you could try polling with a time out to wait until the result comes back.

bethskurrie
2018-07-05 21:38
You should only have to do this when the pact content has changed - most of the time it will be pre-verified.

bethskurrie
2018-07-05 21:40
Did we chat about this on github? If we didn't, there's a new feature in the latest broker that will allow you to determine if you're waiting for a result still, or if it has failed.


bethskurrie
2018-07-05 21:44
I'd recommend that you write a little script that would poll for a given amount of time while there was an unknown result, and then pass or fail, based on the verification result. If this works for you, I might add it into the command itself.

gaurav
2018-07-08 22:41
has joined #pact-broker

bethskurrie
2018-07-09 11:20
@mr.matt.r.long I've added retries to the can-i-deploy for unknown results. Can you please try it and tell me how it goes? https://github.com/pact-foundation/pact_broker-client#can-i-deploy


bethskurrie
2018-07-09 11:29
@bethskurrie pinned a message to this channel.

mr.matt.r.long
2018-07-09 11:37
Sorry Ive been away for a while. Thanks for the help on that, I'll let you know when I've had a chance to look into it.

bethskurrie
2018-07-09 11:38
Ta!

bsayers
2018-07-11 08:01
has joined #pact-broker

bethskurrie
2018-07-11 22:49
Hi all. I've added a Set up checklist for setting up a new integration to be tested using the Pact Broker. You can find it on the Pact Broker wiki (along with a heap of other useful info on the Pact Broker): https://github.com/pact-foundation/pact_broker/wiki/Set-up-checklist

matt.fellows
2018-07-11 22:52
This is great Beth!

bethskurrie
2018-07-11 22:53
Ta. Just adding a link to it in http://docs.pact.io

matt.fellows
2018-07-11 22:54
The only comment I have is that I thought you were about to demo how to integrate other things to it. E.g. web hooks

matt.fellows
2018-07-11 22:54
It's really the pipeline getting started, or best practices guide

bethskurrie
2018-07-11 22:55
Oh, right. Yeah, I meant consumer/provider.

bethskurrie
2018-07-11 23:37
The time limit for allowing a post to be edited is really short!

matt.fellows
2018-07-12 23:12
@mouser @andrewcfitzgerald I?m going to close down the other slack workspace now in favour of this - goodbye and hello :smile:

mouser
2018-07-12 23:12
has joined #pact-broker

andrewcfitzgerald
2018-07-12 23:12
has joined #pact-broker

ssn899
2018-07-17 17:09
has joined #pact-broker

ssn899
2018-07-17 17:13
~Does the docker version of pact-broker require UID or GID root(0) access? I am trying to run it on my company's servers, and they disallow such access. Is there anyway to get around that?~

ssn899
2018-07-17 18:07
I am trying to write a dockerfile from the pact-broker image. How might I go about that? Also what are the permissions needed by the broker?


ssn899
2018-07-17 21:35
I did just after I posted that question. It seems that the broker needs greater permission than 7447 (as mandated by security).

matt.fellows
2018-07-17 21:44
Permission on what? If you like, it's just a regular Ruby app so you can just create your own image and start it however you like. Or you could look at using http://pact.dius.com.au

bethskurrie
2018-07-18 00:48
@ssn899 can you explain that more? What permissions does it need?

bethskurrie
2018-07-18 00:58
I run it in my local machine without any special permissions, so I'm not sure what you're talking about. If there is something that needs changing, I'm happy to do it.

bethskurrie
2018-07-18 00:58
We run a modified version of the broker image on a kube stack without any special permissions too.

ssn899
2018-07-18 19:21
When I asked, I did not totally know what I needed. Sorry about that! So let me start again. What I am trying to accomplish is to host the Pact broker internally. (Security is here is pretty strict so http://pact.dius.com.au/ would not work. ) So to host in our own data center, root can not be used within the container. So I am creating a dockerfile based on dius/pact-broker to meet these security requirements. It seems that when starting the container, the broker runs `/sbin/my_init`, which I believe requires root. So I get the following error ``` Traceback (most recent call last): File "/sbin/my_init", line 414, in <module> main(args) File "/sbin/my_init", line 331, in main export_envvars() File "/sbin/my_init", line 114, in export_envvars with open("/etc/container_environment.sh", "w") as f: PermissionError: [Errno 13] Permission denied: '/etc/container_environment.sh' ``` (Ignore the whole 7447 thing, I was confused lol)

ssn899
2018-07-18 20:27
Wait ignore above, I think I fixed it. Sorry about that! :slightly_smiling_face:

bethskurrie
2018-07-19 02:25
:+1:

bethskurrie
2018-07-20 04:43
I just had a talk with an ex workmate who refused to use pact because of the ability of the consumer team to break the provider builds. I'm even more convinced of the usefulness of the wip pacts and the "build protection" features now.

bethskurrie
2018-07-20 04:44
I've been musing on whether I'd done the right design, but I think I just need to ship it and find out.

mboudreau
2018-07-20 04:47
build protection, yeah, I can see that

mboudreau
2018-07-20 04:47
but I think the main thing is changing the vision/mentality. It's not consumer driven anymore, it's collaborative

mboudreau
2018-07-20 04:47
I think there needs to be a healthy tension between the two, and both should be in agreement to be in compliance

matt.fellows
2018-07-20 07:03
I?ll catch up on the rest of notifications over the course of the next couple of days.

matt.fellows
2018-07-20 07:03
But one thing I will say from talking to clients today - that is a challenge. How do we orchestrate the sequence of adding new features in the contract without breaking the builds in a seamless way

liran.tal
2018-07-21 00:14
we?ve raised the same concerns internally too, although not to the point of refusing to use it. instead we thought we can come up with a process that solves it.

mboudreau
2018-07-21 02:07
I think it's mostly a UX issue. I believe we need to adhere to a more "github style" approach: create a branch for a new contract for both consumer and provider, once they both work, both are merged into "master" and deployed

mboudreau
2018-07-21 02:07
unless I'm not understanding the problem

bethskurrie
2018-07-21 03:19
That the way I always recommend.

liran.tal
2018-07-21 07:48
@mboudreau thing is that with that suggestion you are coupling the github branching methodology with how pact works

mboudreau
2018-07-21 07:57
And that's a bad thing?

liran.tal
2018-07-21 08:13
in my opinion yes.

liran.tal
2018-07-21 08:15
real world scenario in our webapps group (~30 devs) - there are a couple of teams working on a legacy system which is basically a monolith on the frontend and on the backend and they can?t move fast for different reasons like code quality, tests coverage etc. so they release once a sprint. on the other hand, there are also a couple of other teams which built their microservices systems as greenfield projects and can enjoy from trunk based development and CI/CD. So completely different git workflows employed by teams working on the same platform that eventually integrate with one another.

matt.fellows
2018-07-21 08:22
I'm with Liran on this. After all we're a set of tools, which need to be able to work in different contexts

matt.fellows
2018-07-21 08:23
Some contexts just won't be suited to CDC at all, but contract tests against legacy systems I see as a huge opportunity to solve

matt.fellows
2018-07-21 08:23
Every customer seems to be migrating away from their previous arch/approach and struggle to meet in the middle

mboudreau
2018-07-21 13:07
Interesting. I still don't exactly see how branching/versioning via contract would break that approach, let it be greenfield or monolith

matt.fellows
2018-07-21 13:40
If we're allowing people to define their own workflows, then yes. I think we're just saying we shouldn't be too prescriptive

abubics
2018-07-23 08:11
hello :wave: support issues here :slightly_smiling_face: - the pact icon links (when viewing the front page with tags) all take me to latest on our hosted broker, - also seems to be running pretty slow (but that might just be the internet in this building)

fergusstrange764
2018-07-23 13:51
has joined #pact-broker

fergusstrange764
2018-07-23 13:56
Seeing a fair few 503/4s from broker right now

fergusstrange764
2018-07-23 13:56
Anyone else experiencing issues?

matt.fellows
2018-07-23 20:46
Nothing from our monitoring folks

matt.fellows
2018-07-23 20:55
Everything looked pretty normal that time for us across the system, will take a look at your individual cluster this morning @fergusstrange764

slack1
2018-07-23 20:56
i saw a failed publish from a provider ci job around that time as well. seemed to clear up after a few minutes though

matt.fellows
2018-07-23 21:25
Thanks, will dig into that a bit more.

bethskurrie
2018-07-23 22:47
@abubics the first one is a genuine bug. Can you raise it in the pact_broker OSS repo please?

abubics
2018-07-23 23:07
Will do :)

arne.zelasko
2018-07-24 07:06
has joined #pact-broker

sguisado
2018-07-25 10:56
has joined #pact-broker

vinod.baradwaj
2018-07-25 12:38
has joined #pact-broker

richard.jones
2018-07-25 22:44
Hi folks, I might be missing something but I can?t seem to find a JSON to poke at in the broker to retrieve the latest verification results for a provider (I can do so for a consumer which is super awesome!). I can get a list of pacts from /pacts/provider/[name] pb:pacts but then the individual pact fetch doesn?t include the verification result (it?d be super nice if that first JSON listing the name had the verification result in the pb:pacts entries :smile: )

richard.jones
2018-07-25 22:47
I *could* fetch all consumer results for each consumer and match the name back to the provider but that?d be potentially much more expensive :slightly_smiling_face:

bethskurrie
2018-07-25 22:47
Hey @richard.jones I just haven't added it yet because I didn't have a use case driving it. You can get to it through the UI though.

bethskurrie
2018-07-25 22:47
I can easily add it to the API.

bethskurrie
2018-07-25 22:47
Can you tell me what you're trying to achieve?

richard.jones
2018-07-25 22:47
I?d prefer not to scrape the HTML :slightly_smiling_face:

bethskurrie
2018-07-25 22:47
HA. No.

bethskurrie
2018-07-25 22:48
If you use the can-i-deploy tool and turn it to JSON, you'll find the link to the relevant verification result.

bethskurrie
2018-07-25 22:48
`--format json` I think. Or `--output json`

richard.jones
2018-07-25 22:49
I?ve got a monitoring dashboard (grafana) that displays a bunch of information about our systems, including pact verification results. Now that we have verification results in the broker I can stop asking Bamboo whether a pact verification job failed, and instead ask the broker :slightly_smiling_face:

richard.jones
2018-07-25 22:49
Hmm, I?ve not used can-i-deploy - I?ll look into it, thanks

bethskurrie
2018-07-25 22:49
There are also the build badges

bethskurrie
2018-07-25 22:49
That would be an easy way to display the information.

richard.jones
2018-07-25 22:50
This data goes into a database which we can then query by team and use in a number of ways


bethskurrie
2018-07-25 22:51
Let me know if that doesn't get you what you want.

richard.jones
2018-07-25 22:51
I don?t have ruby stuffs installed on the VM I?m running this on so I?ll have to figure that stuff out :slightly_smiling_face:

bethskurrie
2018-07-25 22:52
You don't need ruby

bethskurrie
2018-07-25 22:52
it's a standalone cli

richard.jones
2018-07-25 22:52
ooh, nice, thanks!


bethskurrie
2018-07-25 22:53
If you're using the broker without can-i-deploy, you're not really getting the full benefit of contracts. I highly recommend learning about it.


bethskurrie
2018-07-25 22:54
Step 7.

richard.jones
2018-07-25 22:54
We?re still working on fixing a lot of the fundamentals which we didn?t get right in our implementation a long while back, and practises are embedded now, so we there?s a lot of momentum to shift. There?s a lot of interest from folks here in the dashboard work I?m doing in terms of visibility of pact information.

richard.jones
2018-07-25 22:55
(for example, we?re not using tagging, we?ve still got two separate pact broker installs for ?dev? and ?master?)

bethskurrie
2018-07-25 22:55
:cry:

richard.jones
2018-07-25 22:55
yah

bethskurrie
2018-07-25 22:56
Did the course with Ron help?

richard.jones
2018-07-25 22:56
Definitely! It?s cleared a whole lot of confusion up here ? slowly :wink:

richard.jones
2018-07-25 22:56
Things are much better post-Ron :slightly_smiling_face:

bethskurrie
2018-07-25 22:57
Ha. I'll have to quote that to him.

bethskurrie
2018-07-25 22:57
I'm itching to come out and be allowed to sort out the workflow!

richard.jones
2018-07-25 22:58
We could probably use another visit (to have some weight of authority added to our plannig), but I think we?ve got a pretty good idea what we need to fix

bethskurrie
2018-07-25 22:59
It all takes time and $$!

richard.jones
2018-07-25 23:04
Poking at can-i-deploy it still seems to be the consumer-oriented results whereas I?m after the provider view (all consumers of a provider)

richard.jones
2018-07-25 23:11
I have a solution for now, can proceed.

bethskurrie
2018-07-26 00:50
Richard, you should be able to give either a consumer or provider name - it makes no difference.

richard.jones
2018-07-26 01:56
Yep, but it only gives me the consumer results (the service in question is both consumer and provider)

richard.jones
2018-07-26 01:56
ie. ```$ ~/Downloads/pact/bin/pact-broker can-i-deploy --pacticipant PriceServicePython --latest --broker-base-url ... Computer says no \_(?)_/ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? -------------------|---------------|-----------------------|---------------|--------- PriceServicePython | 2.3.0-1f6e135 | ProductService | 0.1 | true PriceServicePython | 2.3.0-1f6e135 | BranchService | 0.0.0 | true PriceServicePython | 2.3.0-1f6e135 | CustomerPythonService | ??? | ??? PriceServicePython | 2.3.0-1f6e135 | GSTService | ??? | ??? PriceServicePython | 2.3.0-1f6e135 | PriceLikesService | 2.1.0-cd077c7 | true PriceServicePython | 2.3.0-1f6e135 | StateService | ??? | ??? ```

richard.jones
2018-07-26 01:58
(you can get a small glimpse there into the progress we?re making cleaning up a whole lot of things to make this work well :slightly_smiling_face: - only one participant has meaningful versioning and only 1/2 of them even register verification results)

richard.jones
2018-07-26 01:58
well, two participants have versions

richard.jones
2018-07-26 01:59
(as for the varying naming of participants, file that under ?please, don?t ask? :smile: )

bethskurrie
2018-07-26 04:41
if it only gives you the consumer results @richard.jones there is a bug

richard.jones
2018-07-26 04:41
Ah, ok

bethskurrie
2018-07-26 04:42
If it is a provider and consumer, you should get both rows

bethskurrie
2018-07-26 04:42
I'm sure I have test cases for that, but I often find that real world data has corner cases that I haven't thought of.

bethskurrie
2018-07-26 04:43
Did you find the json switch for it?

bethskurrie
2018-07-26 04:43
Also, can you raise an issue in the pact_broker repository and I'll look at it as soon as I can.

bethskurrie
2018-07-26 12:47
@richard.jones is the version number that's used for the verifications exactly the same as the version number that's used when the pacts are published? ie. is its consumer version number the same as its provider number? If they're different, whichever one was published most recently will be considered the latest, and the other one won't be included in that query.

richard.jones
2018-07-26 22:03
@bethskurrie Indeed, the versions do not match

ssn899
2018-07-27 16:02
I am not sure if I will get an answer, but I hope to start a discussion. A couple days ago I (very incoherently) posted about permissions within the `dius/pact-broker` image. Upon close examination, I see that the image is `FROM phusion/passenger-ruby24:0.9.26`. Phusion puts stuff in /sbin/my_init as root, and there is no way to change that (https://github.com/phusion/baseimage-docker/issues/264). From my understanding, it is not a good idea to run root in docker images. See http://blog.dscpl.com.au/2015/12/don-run-as-root-inside-of-docker.html and https://github.com/docker/docker-bench-security. My company mandates that docker containers run without write or execute permission. Is there any other way to get a docker version of the broker such that it runs without need of root (or one that builds `FROM` a different image)? I know that Matt said that it is possible to create my own image, but how can I do that while satisfying the permission restrictions? (I am also pretty new to docker)

matt.fellows
2018-07-27 19:18
It's a ruby app, you don't need phusion passenger to run it at all. It can be run in a pure Ruby image with `rackup` to start it

matt.fellows
2018-07-27 19:19
If you can run it locally first without docker your hand way there

ssn899
2018-07-27 19:21
But to deploy on our infrastructure, it needs to be a docker image.

matt.fellows
2018-07-27 19:21
So run it in a Ruby docker image, not a phusion passenger one

ssn899
2018-07-27 19:38
Wait, so I could just replace `FROM phusion/passenger-ruby24:0.9.26` with `FROM ruby`?

matt.fellows
2018-07-27 19:39
Pretty much. And then you start the Ruby process like you would on your desktop. Nothing special about it!

matt.fellows
2018-07-27 19:39
No tricks :laughing:

matt.fellows
2018-07-27 19:39
So you'll need to change `CMD`

ssn899
2018-07-27 19:41
What would I need to change `CMD` to?

ssn899
2018-07-27 19:42
Does it have to be anything specific?

matt.fellows
2018-07-27 19:49
Well atm phusion manages the process its own way. If you just look at the broker code base itself you just need to replicate the steps to running on your desktop in Ruby. So example https://github.com/pact-foundation/pact_broker/blob/master/example/README.md

matt.fellows
2018-07-27 19:50
Something like `bundle exec rackup -p 1234`

ssn899
2018-07-27 20:43
I get the following error when I run `bundle exec rackup`: ``` bundler: failed to load command: rackup (/home/app/pact_broker/vendor/bundle/ruby/2.5.0/bin/rackup) ```

ssn899
2018-07-27 21:35
So when I run with docker-compose, I get the following logs: ``` broker_app_1 | [2018-07-27 21:33:26] INFO WEBrick 1.4.2 broker_app_1 | [2018-07-27 21:33:26] INFO ruby 2.5.1 (2018-03-29) [x86_64-linux] broker_app_1 | [2018-07-27 21:33:26] INFO WEBrick::HTTPServer#start: pid=7 port=9292 ``` when I navigate to `localhost:9292`, I get localhost refused to connect.

uglyog
2018-07-27 22:27
@ssn899 make sure port 9292 is exported. Passenger runs on port 80, so the passenger based image will expose port 80

ssn899
2018-07-27 22:34
Thanks! When I navigate to localhost, I get `localhost didn?t send any data.`

bethskurrie
2018-07-29 21:36
@ssn899 you'll need to pass in `-p 80` when you start the process (if your permissions allow that) because you will have problems if you try to bind 80 on the host to 9292 in the Ruby process (the issues comes because the URLs don't get rewritten correctly, and Rack rejects requests that are not sent to the port that it's bound on.)

bethskurrie
2018-07-29 21:37
You'll hit problems if you try to run the current ruby app without any sort of web server in front of it. For starters, the default ruby app server (webrick) is single threaded, so at the very least, you'll need to add the `puma` gem.

bethskurrie
2018-07-29 21:40
Actually, having read that thread about the sudo permissions, you're not going to be able to run it on port 80 (or 443 if you're using ssl), so you'll need to pick a higher port to run and bind it to.

matt.fellows
2018-07-29 21:48
That's one approach, you could also scale the number of containers you run and have them all single threaded anyway. Also running as a root user in container is not necessary a security issue, it depends on how the underlying docker daemon is setup and maps users to the host

bethskurrie
2018-07-29 23:08
I agree. But that decision is out of our hands!

abubics
2018-07-30 06:33
fwiw, this is fixed as I check it this minute :slightly_smiling_face: I never got around to raising the issue, though :thinking_face:

bethskurrie
2018-07-30 06:37
Yeah, I fixed it.

bethskurrie
2018-07-30 06:38
I was going to @ you in the commit, but I couldn't remember your github username.

antonello
2018-07-30 14:27
has joined #pact-broker

antonello
2018-07-31 07:33
Where can I see an example of what `${pactbroker.githubVerificationStatus}` looks like?

bethskurrie
2018-07-31 07:36
Google "github commit api"

antonello
2018-07-31 07:37
I meant, does it contain any verification metadata?

bethskurrie
2018-07-31 07:38
No it's the string

bethskurrie
2018-07-31 07:39
Have a look at the webhook template library in the pact broker wiki

bethskurrie
2018-07-31 07:41
error, failure, pending, or success


antonello
2018-07-31 07:42
Ok, gotcha. Through `${pactbroker.verificationResultUrl}` you can then get to the details of the verification result.

bethskurrie
2018-07-31 07:42
I think we only use success, failure and pending

bethskurrie
2018-07-31 07:42
Yes.

antonello
2018-07-31 08:44
In the presence of a webhook for `contract_content_changed`, if a consumer publishes multiple pacts, and more than one pact changes, would the webhook be invoked multiple times?

bethskurrie
2018-07-31 09:36
If you created a webhook with a specific consumer and provider, then it would only be invoked once if that pact had changed. If you created a webhook for a particular provider (recommended) then that webhook would only be invoked once if that pact had changed, as each pact belongs to a different provider. If you created a webhook for a particular consumer, then the webhook would fire once for each pact that had changed.

antonello
2018-07-31 10:16
Thanks again :slightly_smiling_face: Can you create multiple webhooks for the same provider? For example if you want to trigger verification on two different branches for the provider.

bethskurrie
2018-07-31 10:17
Yes

antonello
2018-07-31 10:17
Fantastic! Thank you!

bethskurrie
2018-07-31 10:17
np

shashidesai
2018-07-31 20:21
has joined #pact-broker

antonello
2018-08-01 07:54
I?m trying to set up the pact-broker for local development

antonello
2018-08-01 07:54
but I?m encountering issues when running `bundle install`

antonello
2018-08-01 07:54
I?m on Mac

antonello
2018-08-01 07:55
What version of `mysql` should I have installed?

bethskurrie
2018-08-01 08:11
Postgres :-P

bethskurrie
2018-08-01 08:12
Just comment out the gem.

bethskurrie
2018-08-01 08:12
You won't need it.

bethskurrie
2018-08-01 08:13
When you say, local development, do you mean you want to run it, or work on it?

bethskurrie
2018-08-01 08:13
If you just want to run it, follow the instructions on the readme for setting up the example. You shouldn't need mysql.


antonello
2018-08-01 08:15
I am no ruby developer, but I wanted to look into how easy it would be to contribute

bethskurrie
2018-08-01 08:15
In that case, comment out mysql

bethskurrie
2018-08-01 08:16
You only need it on Travis.

bethskurrie
2018-08-01 08:17
The entire test suite runs against mysql, postgres and sqlite, but when you run it locally, they'll just use mysql by default.

antonello
2018-08-01 08:20
Is there anything else I have to do before I can run `bundle exec pact_broker:dev:setup` besides - `gem install bundler` - clone - `bundle install` ?

bethskurrie
2018-08-01 08:20
I don't think so, but I've probably not run it for ages.

bethskurrie
2018-08-01 08:20
What problem are you facing ml

bethskurrie
2018-08-01 08:20
?

antonello
2018-08-01 08:20
``` bundler: command not found: pact_broker:dev:setup Install missing gem executables with `bundle install` ```

bethskurrie
2018-08-01 08:21
Ha. You probably need rake.

bethskurrie
2018-08-01 08:21
It was a silly idea of mine to make a rake task to install things.

bethskurrie
2018-08-01 08:21
I should have made a shell script.

bethskurrie
2018-08-01 08:22
Just look at what it does and run it manually

bethskurrie
2018-08-01 08:22
It's just copying the example dir from memory

antonello
2018-08-01 08:25
`rake pact_broker:dev:setup` worked fine

antonello
2018-08-01 08:26
And I have a pact broker running locally

bethskurrie
2018-08-01 08:26
Oh! Yes. I didn't realise the command was missing the "rake'.

bethskurrie
2018-08-01 08:26
First PR?

antonello
2018-08-01 08:27
Maybe! I will see if I can get my head around it.

antonello
2018-08-01 08:27
:slightly_smiling_face:

bethskurrie
2018-08-01 08:28
If I get a moment, I'll try to add a bit more description to the developer docs.

matt.fellows
2018-08-01 09:21
mysql or postgres?

bethskurrie
2018-08-01 09:21
Gah! I meant sqlite.

matt.fellows
2018-08-01 09:21
:slightly_smiling_face:

bethskurrie
2018-08-01 09:55
@antonello I pushed a bit more documentation that might help you find your way around

antonello
2018-08-01 10:11
thanks @bethskurrie!

antonello
2018-08-03 16:21
@bethskurrie and everyone else here, I have a question, which may also be partly related to new WIP feature. It?s a bit long and perhaps a convoluted, but stick with me. Let?s say that - aside from feature branches - *Provider* has 3 branches at any single time: `master`, `release_candidate` and `production`. *Consumer* follows the same branching structure, so at any given time - apart from feature branches - it will have `master`, `release_candidate` and `production`. You have 3 webhooks for Provider, one for each of the 3 provider branches. All 3 provider branches, when built, verify pacts tagged with consumer tags `master`, `release_candidate` and `production`. This is because you want to know if a change made to Consumer and pushed to either `master`, `release_candidate` or `production` is compatible with all 3 provider branches. If you DID NOT do the above, the following could happen: - a field is added to Provider?s API response - the change is pushed into the `master` branch of Provider - Consumer starts consuming the new field and modifies the pact interaction - the change above is pushed to the `master` branch of Consumer - the webhook is fired and this will build Provider?s `master` branch - the verification succeeds (the pact won?t be a WIP pact anymore) - the Consumer team promotes the change to Consumer?s `release_candidate` branch - no webhook is fired because the pact has not changed - the Consumer releases the release candidate - Consumer is broken in production because in production the new field is not present in Provider?s response Conversely, by having the 3 webhooks I mentioned above, you will know whether the Consumer change you are promoting is compatible not only with Provider?s `master` but also with its release candidate and production versions. However you would end up with Provider?s `release_candidate` and `production` pipelines being red. On the one hand, I think that this may be a desirable side effect, because you want something that would stop you from promoting Consumer when it is incompatible with the Provider version that is in production or that may be about to go to production. On the other hand, how do you deal with Provider being red if you want to release it? Would the Provider team (which obviously may be the same team) say: ?Consumer, before you can push that change to master, we need to have released our change first. So revert you change please and let?s make a plan together?. Any thoughts on this? Is there something I am getting terribly wrong or that I?m missing?

cparrish
2018-08-03 18:42
has joined #pact-broker

bethskurrie
2018-08-05 21:53
can-i-deploy will stop the consumer deploying or promoting when it shouldn't.

bethskurrie
2018-08-05 21:55
The consumer won't be able to deploy the release candidate because there is no corresponding verification by the provider with the release candidate tag.

bethskurrie
2018-08-05 21:58
Yes, this workflow forces the provider to deploy to production before the consumer can be released to production, but you shouldn't need to have red builds on the provider. Let me get my head around it.

bethskurrie
2018-08-05 22:04
I think the key is "the consumer promotes the pact to the release candidate branch". At this stage, the broker will compare the pact content to the previous latest pact content (regardless of tags). Perhaps I need to make it tag aware. Let me ponder.

bethskurrie
2018-08-05 22:08
One of the features that I don't think you've included in the above plan is the "build protection" (which I haven't yet implemented). It's the ability to say, "consumer can't tag a version with a tag that could break our build until it's already been verified as a wip pact by the corresponding branch". Eg. If master branch of the provider verifies the master branch of the consumer, then a particular pact content must have been verified as a wip pact by the master provider before it can be published or tagged as a master pact by the consumer.

bethskurrie
2018-08-05 22:09
It's a bit convoluted, sorry!

bethskurrie
2018-08-05 22:10
Basically the pact has to have gone through the wip verification before it can be allowed to go through the real verification.

antonello
2018-08-05 22:36
Thanks @bethskurrie. I think I get it. I?ll re-read it tomorrow morning. I?m half asleep now. :sweat_smile: I think I?ve overlooked can-I-deploy, so that?s some reading for tomorrow and I will have to get my head around how to use it in a way that encourages ?shifting left?.

bethskurrie
2018-08-05 23:13
can-i-deploy is an absolute requirement for a workflow as sophisticated as yours. The consumer has to check the verification results, otherwise there's no feedback loop to let them know when they've got an invalid contract.

antonello
2018-08-06 06:57
I was thinking that the feedback loop could be provided by the webhook for the publication of the verification results.

bethskurrie
2018-08-06 07:22
I'd rely on can I deploy more than the webhook results.

bethskurrie
2018-08-06 07:23
Callbacks can be missed, or requests fail, or interleave.

bethskurrie
2018-08-06 07:23
Fetching the latest results is the most reliable method.

bethskurrie
2018-08-06 07:24
It's the pattern of "allow things to subscribe to change notifications, and then let them fetch and decide what to do with the data" pattern. I can't remember the short name!

antonello
2018-08-06 08:40
Yes, it makes complete sense. So, another thing related to this conversation. In the example I?ve given, you?d have the `release_candidate` branch for Provider verify only Consumer contracts tagged as `release_candidate`, and the `production` branch for Provider verify only Consumer contracts tagged as `production`.

antonello
2018-08-06 08:42
Actually, no - I don?t think that would work.

antonello
2018-08-06 09:10
?the broker will compare the pact content to the previous latest pact content (regardless of tags)? -> this means that if a new pact published by Consumer `master` (and then verified by Provider `master` following a webhook), when Consumer is then promoted to `release_candidate`, the webhook won?t be fired, because the pact content won?t have changed from the previous one.

antonello
2018-08-06 09:15
Clearly can-i-deploy could stop you from deploying `release_candidate` Consumer, because there is no corresponding verification by the provider with the release candidate tag. But then you?d have to manually trigger a Provider `release_candidate` pipeline. And how do you get around the fact that not only do you want to verify pact changes against `master` and `release_candidate` but also against the `production` version of Provider?

bethskurrie
2018-08-06 09:33
I would have each branch of the provider verify each branch of the consumer.

bethskurrie
2018-08-06 09:34
And I think I'll have to modify the logic for webhook firing.

bethskurrie
2018-08-06 09:34
It will need to check the tags as well.

antonello
2018-08-06 09:42
?I would have each branch of the provider verify each branch of the consumer? -> This would do, but it comes with two problems, I think. 1) Your feedback loop suffers from a potentially painful delay. In order to know if your Consumer release candidate is compatible with the Provider release candidate, you have to wait until you?ve cut release candidate branches. 2) You won?t be able to verify the Consumer release candidate with the Provider production version.

bethskurrie
2018-08-06 09:43
Not unless you check out the prod provider codebase and run the verifications against it.

bethskurrie
2018-08-06 09:43
How long do your verification tests take?

bethskurrie
2018-08-06 09:44
Do you use swagger by any chance in this codebase?

antonello
2018-08-06 09:45
I can?t say yet as we currently only a few tests that have been written as PoCs. The client is unwilling to move forward unless it?s clear how it?ll all fit in in terms of CI.

antonello
2018-08-06 09:45
There is some swagger documentation for some of the services, but not all.

bethskurrie
2018-08-06 09:45
If your verification tests take more than a few minutes, something is not right.

antonello
2018-08-06 09:46
When you say ?checkout the prod provider?, do you mean as a manual step?

bethskurrie
2018-08-06 09:46
It could be an automated step.

bethskurrie
2018-08-06 09:46
Have you read the pact nirvana doc?

bethskurrie
2018-08-06 09:46
It's the last step in there.

bethskurrie
2018-08-06 09:47
I don't generally think it should be necessary if you deploy the provider often though.

antonello
2018-08-06 09:48
I hadn?t read it, will read it today.

bethskurrie
2018-08-06 09:48
I think it will answer some questions

bethskurrie
2018-08-06 09:48
You've already worked most of it out.

bethskurrie
2018-08-06 09:49
I don't understand what you mean by "cut release candidate branch"

bethskurrie
2018-08-06 09:50
If it's all seeming too hard, one alternative is to use the swagger workflow

bethskurrie
2018-08-06 09:50
It's not fully supported by the broker yet though.

bethskurrie
2018-08-06 09:52
Basically, provider publishes a swagger doc with each build, and when it deploys, it marks that version as the prod/release candidate etc. It needs to use dredd to make sure it matches its own spec.

antonello
2018-08-06 09:52
Currently everything gets released together, and pact is seen as one of the tools that is going to enable them to start breaking things up and move towards releasing services independently. The workflow is that feature branches are merged into master and when they want to release (usually twice a week), a release branch is created from master for all the services/applications.

bethskurrie
2018-08-06 09:52
The consumer uses the atlassian pact swagger validator to check its pact against the swagger doc.

antonello
2018-08-06 09:53
That branch is used for regression testing and it?s then released to production. Once the release is successful, it?s merged down to the production mirror branch and to master.

bethskurrie
2018-08-06 09:53
Something that makes that workflow a bit trickier is that your shas will change every time you merge, right?

antonello
2018-08-06 09:54
Yes.

bethskurrie
2018-08-06 09:54
So you can't reuse a verification result from the previous branch.

bethskurrie
2018-08-06 09:54
Tricky.

bethskurrie
2018-08-06 09:55
If you could get people to commit to swagger/dredd (or some other way to keep swagger in sync with your code) the swagger method might simplify your workflow.

sgarvey
2018-08-06 11:23
has joined #pact-broker

antonello
2018-08-06 14:18
?The steps to reaching Pact Nirvana? guide is really well written. It all makes sense and it is - after all - along the lines what was already in my head. I have some questions, though. ?To reach Pact Nirvana, the final step is to have a CI build that checks out the code for the production version of your provider, and have it verify the same pacts that the head version does?. This makes complete sense and it could be triggered by a webhook, but it obviously means that that CI build will go red if a verification fails. Also, when it says ?If you have followed the recommended strategy of tagging provider versions in the broker on deployment to production?, is it referring to using `pact-broker describe-version`?

bethskurrie
2018-08-07 00:46
Yes.

bethskurrie
2018-08-07 00:48
> it obviously means that that CI build will go red if a verification fails. I would imagine this would be a side build, outside of the master build pipeline. Wouldn't you want it to go red?

bethskurrie
2018-08-07 00:49
You have such a complex set up, I'm really quite wary of using the pact only flow. It's sounding really complicated. Did the swagger workflow I described make sense? Would it be an option for you?

antonello
2018-08-07 06:37
I haven?t done any reading on it yet. I only remember a talk from Atlassian that I watched on YouTube some time ago.

antonello
2018-08-07 06:38
I think we can find a way to make a pact only flow work, with some compromises.

antonello
2018-08-07 06:48
Million dollar question... when do you think the WIP feature will be released?

bethskurrie
2018-08-07 08:32
The code is actually done, I was just trying to work out what to call it.

bethskurrie
2018-08-07 08:33
I think I've decided to call it "pending" instead of "wip". I can have it out as soon as I get the time to do a release. I'll try and do that in the next few days.

antonello
2018-08-07 08:40
By the way, because for each service we have a branch that is always inline with prod, we can do without having to tag provider versions

antonello
2018-08-07 11:53
I think I can find a way to make it work, the only thing that?s missing really is having the `contract_content_changed` logic tag based.

tcanascimento
2018-08-07 14:28
has joined #pact-broker

bethskurrie
2018-08-07 21:33
What languages are you doing your verifications in @antonello?

bethskurrie
2018-08-07 21:33
I'll see if I can do the tag thing.

antonello
2018-08-07 21:56
@bethskurrie Verifications in Java. (Consumers are more varied)

antonello
2018-08-07 21:59
I?ve started looking into the tag thing and I have an initial implementation. I?m not sure if it?s right though. I?ve added some tests for the repository, but haven?t finished the service tests.

antonello
2018-08-07 22:01
I was in the process of pushing the changes to a fork but didn?t get a chance to finish.

antonello
2018-08-07 22:05
I can see if I manage to do that before going to bed (it?s 11 pm here) so that you could review the changes?

bethskurrie
2018-08-07 22:06
I'm doing parenting work today, so I may or may not get a chance. I'll be doing Pact work tomorrow (actual job) so I can review them tomorrow.

bethskurrie
2018-08-07 22:06
I think that means you can go to bed...

conallbennett
2018-08-07 22:12
has joined #pact-broker

conallbennett
2018-08-07 22:46
Hey all, question on the docker pact broker. I know i found the answer to this before in the docs but I can't for the life of me find it again. To persist the data in the postgres th it needs to have a mounted volume, which postgres tables or store should that mount be against?

bethskurrie
2018-08-07 22:53
I would look in the docs for the postgres docker image

matt.fellows
2018-08-07 23:01
It will be something configurable like `PG_DATA`

matt.fellows
2018-08-07 23:01
You'll need to explicitly set it probably

antonios.klimis
2018-08-08 09:46
has joined #pact-broker

antonello
2018-08-08 16:16
After some conversations with @bethskurrie, I?ve just created a PR: https://github.com/pact-foundation/pact_broker/pull/226 Hopefully Beth will get a chance to review it later tomorrow (or today, depending on timezones!), but if anyone would like to have a look and provide feedback, they?ll be more than welcome. Also, if anyone could help me understand whey my PR would fall below the Codeclimate diff-coverage threshold, I would appreciate it. I?ve heavily tested my changes, so I?m struggling to get what?s happening there.

richard.hulm
2018-08-09 09:13
has joined #pact-broker

richard.hulm
2018-08-09 09:13
Hi, I'm getting a 504 trying to access my pact broker - is this the right place to report issues?

uglyog
2018-08-09 09:15
what is the URL for your broker?

richard.hulm
2018-08-09 09:16
DM'd you

richard.hulm
2018-08-09 09:41
Sorted - thanks!

codypumper
2018-08-09 20:19
has joined #pact-broker

bethskurrie
2018-08-10 02:22
if you are using the OSS docker pact broker, and you have been having problems with slowness or large database size, please upgrade to the latest version, as I have made some significant optimizations to the "index with tags" queries, and removed the massive pre-cached matrix table. This should make your broker run faster and cheaper!

lindblad.n
2018-08-13 07:30
has joined #pact-broker

amitojduggal
2018-08-13 14:48
has joined #pact-broker

amitojduggal
2018-08-13 14:50
Hello Guys, i have a basic question about the pact broker. in case of a failure in pact verification, how can i know from the pact broker, what was the cause of the error. Example, expected statusCode 200 and got 201. I see that from the maven console, when mvn:pactVerify is run, but is there a way to track it from the pact broker?

bethskurrie
2018-08-13 22:01
@amitojduggal it depends which language you're using. JVM does not have this yet, but the shared library that js, python, net and go use have this capability if they are on the latest version of what we call the "standalone".

bethskurrie
2018-08-13 22:01
Which language are you using?

richard.jones
2018-08-13 22:49
@bethskurrie - a general question about the broker: which APIs could be considered reasonably settled for now - is something like /pacts/provider/ProviderName/latest very unlikely to change, or should I be wary of making that assumption?

bethskurrie
2018-08-13 22:49
Always use the HAL relations.

bethskurrie
2018-08-13 22:50
If there's something you can't get to, let me know.

bethskurrie
2018-08-13 22:50
Most of the API is stable, but I make no promises for the future!

bethskurrie
2018-08-13 22:51
I've been planning a v2 where I want to standardise the naming a bit better, but I have no timeline for that yet.

richard.jones
2018-08-13 22:51
HAL is ? a pain to work with, but I will do so. So I should use pb:latest-provider-pacts from the root HAL, gotcha!

bethskurrie
2018-08-13 22:51
Why are you finding it a pain?

matt.fellows
2018-08-13 22:51
it?s just? meh

bethskurrie
2018-08-13 22:51
Do you have a client library?

bethskurrie
2018-08-13 22:52
It would suck doing it manually, but there should be a HAL client for all languages.

richard.jones
2018-08-13 22:52
It?s very ?well, JSON is all nice, but it really needs more SOAP? :smile: But more seriously, I think it?s that the current HAL client library for Python isn?t very user-friendly, and involves a lot of guesswork to make things work.

bethskurrie
2018-08-13 22:53
I wrote my own for the pact ruby, because I don't like to add dependencies that might clash with the user's ones.

bethskurrie
2018-08-13 22:53
It was quite simple, and simplified my code greatly.

matt.fellows
2018-08-13 22:53
we did the same for Pact Node, sorta. Depending on what you do, you don?t really need a lib

richard.jones
2018-08-13 22:53
For example, this code from pactman to publish results: ``` params = dict(success=self.result.success, providerApplicationVersion=version) overrides = dict(action='POST', encoding='application/json', fields=[coreapi.Field(name='success'), coreapi.Field(name='providerApplicationVersion')]) coreapi_client.action(self.hal, ['publish-verification-results'], params=params, overrides=overrides, validate=False) ``` vs the requests version: ``` http://requests.post(self.hal['publish-verification-results'].url, json=params) ```

richard.jones
2018-08-13 22:54
and it took me ? far too long to figure out that arcane hal_client version :confused:

bethskurrie
2018-08-13 22:55
That does look verbose.

richard.jones
2018-08-13 22:56
anyhoo, thanks for the tip, will not hard code that URL

bethskurrie
2018-08-13 22:56
My code does not look like that!

richard.jones
2018-08-13 22:57
I?m looking around for a nicer client

bethskurrie
2018-08-13 22:58
I just did a bare minimum impl in 4 classes

bethskurrie
2018-08-13 22:58
Entity, link, http client, response

richard.jones
2018-08-13 22:58
I?d prefer not to have to write my own HAL implementation, plenty of Pact-related code to write :slightly_smiling_face:

bethskurrie
2018-08-13 22:59
Fair enough

richard.jones
2018-08-13 23:00
https://github.com/deontologician/restnavigator looks like a much nicer interface, I?ll experiment with it

bethskurrie
2018-08-13 23:24
`http://pact_entity.post(PUBLISH_RELATION, verification_result)` is the Ruby code.

bethskurrie
2018-08-13 23:24
For tagging `provider_entity._link(VERSION_TAG_RELATION).expand(version: provider_version, tag: tag).put`

richard.jones
2018-08-13 23:28
yep, this library looks similar

bethskurrie
2018-08-13 23:29
just having a look at the readme. looks much better than that first example.

richard.jones
2018-08-14 00:02
way, way simpler :smile:

richard.jones
2018-08-14 01:40
Right, that?s all fixed :smile:

amitojduggal
2018-08-14 04:32
@bethskurrie Thanks, i am using JVM.

amitojduggal
2018-08-14 05:10
So this capability has to be build on the pact-jvm side, i can work on it; give me some pointers. :slightly_smiling_face:

richard.hulm
2018-08-14 08:13
:wave: I seem to be having issues DNS resolving `http://pact.dius.au`

matt.fellows
2018-08-14 08:15
Did you mean `http://pact.dius.com.au`?

richard.hulm
2018-08-14 08:15
....Ha yes

richard.hulm
2018-08-14 08:15
Thanks. My mistake.

matt.fellows
2018-08-14 08:16
:ok_hand:

matt.fellows
2018-08-14 08:16
Freaked me out!

vinod.baradwaj
2018-08-14 10:48
can we download pact file from broker ? is there any API available for that ?

bethskurrie
2018-08-14 10:50
Yes of course.

bethskurrie
2018-08-14 10:50
Have you looked at the documentation?



vinod.baradwaj
2018-08-14 10:53
i am making use of pact stub server to bring up the mocked provider(https://github.com/uglyog/pact-stub-server), for this can i link the pact files that are in pact broker ?

vinod.baradwaj
2018-08-14 10:53
wiki for pact broker says like, this is the endpoint for retrieving the pacts, http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/latest

bethskurrie
2018-08-14 10:54
I think so.

bethskurrie
2018-08-14 10:54
Have you tried it?

vinod.baradwaj
2018-08-14 10:55
yeah, when i tried to pass that URL as the pact file location, stub server was not able to recognise it as a pact file

bethskurrie
2018-08-14 10:59
Are you using basic auth?

bethskurrie
2018-08-14 10:59
I'm pretty sure the URL feature is supported.


vinod.baradwaj
2018-08-14 11:01
it says -U is for url resource, can we pass on that broker endpoint here ?

bethskurrie
2018-08-14 11:01
If the -u doesn't work, then please create an executable code example demonstrating the problem and raise an issue in the repo

bethskurrie
2018-08-14 11:01
Yes.

vinod.baradwaj
2018-08-14 11:02
sure, thanks Beth :slightly_smiling_face:

bethskurrie
2018-08-14 11:02
If you're using basic auth, you'll need to include the credentials in URL form I would expect.

vinod.baradwaj
2018-08-14 11:02
no, broker is open, its not having any auth

antonello
2018-08-14 11:21
Does the broker do anything ?magic? if it receives a pact that is identical in content, for the same consumer version and with exactly the same tags as the previous one?

antonello
2018-08-14 11:22
In other words, should it show up as a new version?

bethskurrie
2018-08-14 11:22
Yes

bethskurrie
2018-08-14 11:22
It ignores it

bethskurrie
2018-08-14 11:22
Yes, it is magic. No, it is not a new version.

antonello
2018-08-14 11:22
I should?ve asked 2 hours ago.

antonello
2018-08-14 11:22
It makes sense

antonello
2018-08-14 11:23
Is the magic based on all those 3 criteria?


bethskurrie
2018-08-14 11:24
The tags are irrelevant

bethskurrie
2018-08-14 11:24
They belong to the version resource

bethskurrie
2018-08-14 11:24
It's just based on the content and the consumer version number

bethskurrie
2018-08-14 11:24
Ordering of interactions and keys is ignored.

antonello
2018-08-14 11:25
Thanks @bethskurrie

antonello
2018-08-14 11:26
Does the broker just return a 200 regardless?

antonello
2018-08-14 11:26
Actually, I could check the code myself

bethskurrie
2018-08-14 11:27
I think it returns a 201 if a new resource was created, and a 200 otherwise

bethskurrie
2018-08-14 11:27
Why?

antonello
2018-08-14 11:32
Just curious. I was using the maven plugin which used the jvm broker client and it spits out the status code after publishing. It just says published (obviously), I?ll check later if I was getting a 200 rather than a 201.

bethskurrie
2018-08-14 11:34
That versioning page in the docs is really good, I recommend reading it if you haven't.

bethskurrie
2018-08-14 11:34
Someone else wrote it better than I could have!

antonello
2018-08-14 11:53
I read it last week when I was making the change to the broker, but I?d forgotten!

amitojduggal
2018-08-15 14:51
Hello ! with pact broker new deployment i am getting Publishing 'A-B.json' ... FAILED! 302 Moved Temporarily - <html> <head><title>302 Found</title></head> <body bgcolor="white"> <center><h1>302 Found</h1></center> </body> </html>

amitojduggal
2018-08-15 14:51
any pointers around this?

matt.fellows
2018-08-15 21:04
Where is it redirecting you to? How are you publishing it?

vinod.baradwaj
2018-08-16 06:08
Hi @bethskurrie from the endpoints will i be able to get the details like whether that pact file has been verified or not ?

bethskurrie
2018-08-16 06:09
Use the can-i-deploy tool


vinod.baradwaj
2018-08-16 06:10
i saw that broker client/can-i-deploy tool, but there are some restrictions in our environment to use such tools. Thats the reason i am planning to get those details by querying the broker

bethskurrie
2018-08-16 06:11
Turn on verbose to see the queries it makes.

vinod.baradwaj
2018-08-16 06:11
sure, thank you :slightly_smiling_face:

antonello
2018-08-16 09:21
Hi! It would be nice to pick your brain on something. The current git flow that my client uses is like this: - development is done on feature branches of `master` - branches are merged into `master` after testing - a `release-1.x.x` branch is taken from `master` for regression testing/fixing - once a release is ready to go live, it gets merged into a branch called `maint` from which the production artifacts are built - if a hotfix (or unplanned release) is required, a `hotfix-1.x.x` branch is created from `maint` - once the hotifix goes live, the branch is merged into `maint` from which the production artifacts are built All these branches publish pacts with a matching tag (`a-feature-branch-name`, `master`, `release_candidate`, `hotfix`, `maint`). Once a release has gone live, the appropriate pacticipant(s) versions and tags are tagged as `prod`. We want to make sure (among other things) that the `master` and `release_candidate` branches of the providers verify the latest pacts (among other tags) published with a `release_candidate` branch. Now, the issue is that once a hotfix release has gone live, any pacts tagged as `release_candidate` may be ?out of date?, as a new release may have gone live. How could we address the problem?

amitojduggal
2018-08-16 12:02
Hey, thanks, we were able to figure it out, it was because of redirection of the apis to a single sign on page internally.

matt.fellows
2018-08-16 12:19
Ahh :+1:

bethskurrie
2018-08-16 21:44
Is this because the hot fix never went through the release candidate branch?

bethskurrie
2018-08-16 21:44
As long as you're verifying the production pacts as well, I don't think it's a problem.

bethskurrie
2018-08-16 21:45
If you have a specific release process for the hot fix release, you could tag the same version as release candidate when you deploy.

antonello
2018-08-17 05:28
There may be a main release candidate and a hotfix branch going on at the same time.

bethskurrie
2018-08-17 05:45
I'll go back to, what is the problem if you're verifying the prod version as well?

antonello
2018-08-17 05:52
Yes. Prod will be the definitive one. Once prod has gone live we wouldn?t want to verify Any previous versions tagged as release candidate or hotfix.

antonello
2018-08-17 05:54
I just had a though though. All consumer are versioned with a release number (1.123.0, 1.123.1 and so on) + a sha. We could only verify pacts tagged with release and hotfix if the release number is > than that?s in prod.

antonello
2018-08-17 05:55
I?m not sure if the provider verification we use (mvn plugin) would allow that or if it?s even sensible.

bethskurrie
2018-08-17 06:04
I'm going to go back to my theory that using the swagger workflow would be simpler for you.

bethskurrie
2018-08-17 06:04
This is just feeling crazy complicated.

antonello
2018-08-17 06:26
There is a desire to make it simpler in the future

bethskurrie
2018-08-17 06:28
I wonder if you could just skip all the checks except for the prod and main line of development.

bethskurrie
2018-08-17 06:28
Maybe checking for each environment isn't necessary

bethskurrie
2018-08-17 06:30
If you imagine that prod has interactions 1 and 2, the latest dev has 1,2, 3, 4, and 5, and the intermediate branches have somewhere in between, maybe you only need to check each end of that spectrum.

antonello
2018-08-17 07:36
That is exactly what I think we may end up doing

antonello
2018-08-17 07:37
There is a risk of a bit of a delay in feedback but can_i_deploy will tell us

kristine.jetzke
2018-08-20 18:46
has joined #pact-broker

kristine.jetzke
2018-08-20 18:47
Hi, I recently noticed that env variable `PACT_BROKER_BASE_EQUALITY_ONLY_ON_CONTENT_THAT_AFFECTS_VERIFICATION_RESULTS` exists for the docker image. The doc states that the default is true but I can only find this place where it is set in the code: https://github.com/pact-foundation/pact_broker/blob/fa827c4122e742e13d5432da3dc24c3bec2423f1/lib/pact_broker/configuration.rb#L76 Am I missing something?

mmonson
2018-08-20 21:11
Is there a way to set the broker to use pactSpecification version 3.0? My provider states aren't showing up and I think it's because the broker is expecting V2, but I'm using V3. I didn't see anything about it here https://github.com/pact-foundation/pact_broker/wiki/Configuration

matt.fellows
2018-08-20 21:11
It supports them for publishing etc, it just doesn't render them yet

mmonson
2018-08-20 21:14
Thanks, do you know when rendering is coming?

matt.fellows
2018-08-20 21:32
Nope. It's not hard, just needs some time

komalahluwalia06
2018-08-23 07:23
has joined #pact-broker

ayodaiken
2018-08-24 19:11
has joined #pact-broker

rsaccoll
2018-08-27 13:27
has joined #pact-broker

slack1
2018-09-04 21:15
ive been running a personal broker on a free heroku instance and just got a notification that i'm close to the row limit for the free tier. ? do i remember there being something that was improved about the efficiency of how data was persisted? was there a command suggested to reduce the size of old data related to that? ? is there a recommended way to remove old versions that arent providing as much value anymore, or is that discouraged?

bethskurrie
2018-09-06 06:12
@slack1 grab the latest version - the data storage will be much less as I'm not storing the cached "matrix" in it's entirety any more. It will remove the data in the "materialized matrix" table in the migrations.

bethskurrie
2018-09-06 06:13
You can totally remove old versions that aren't used any more - I wrote a script to do it, but it was hard to do it in a general way, because the pacts that can be safely removed depend on how you're using it.

bethskurrie
2018-09-06 06:14
Eg. if you don't use tags, you can basically remove any pacts that aren't the latest ones. If you do use tags, you can remove any pacts that aren't your "prod" ones, or one of your "dev" ones that may be promoted to prod soon etc..

bethskurrie
2018-09-06 06:16
How's your ruby @mmonson? :wink:


slack1
2018-09-06 14:12
thank you very much for the info

culbluswan123
2018-09-06 15:06
has joined #pact-broker

culbluswan123
2018-09-06 15:11
I know that postgres is the recommended database for pact-broker. My question is that how strong recommendation is it? We have some limitations in introducing postgres at the moment as we already have mysql and mongo databases. We want to avoid adding a third database to the mix.

culbluswan123
2018-09-06 15:40
we're not so concerned about the support for json search at this moment. The major concern is around the support for mysql, I see some issues in the past around mysql migrations failing from time to time.

matt.fellows
2018-09-06 21:36
Each build is tested against MySQL so in theory it should work.

matt.fellows
2018-09-06 21:37
We run production broker systems on postgres so can speak to its stability, that's not to say you should have any issues with MySQL

bethskurrie
2018-09-07 04:20
MySQL is fully supported now, if grudgingly :wink: @culbluswan123

bethskurrie
2018-09-07 04:21
I believe that since we first made the decision (5 years ago?), MySQL now supports JSON searching. I should probably remove that comment.

culbluswan123
2018-09-07 04:22
Yes, MySQL 5.7 onwards there's support for JSON data type.

culbluswan123
2018-09-07 04:22
Thanks @matt.fellows and @bethskurrie

culbluswan123
2018-09-07 04:24
It would be helpful if the wiki and README are also updated to reflect the same. At least the fact that MySQL is fully supported

matt.fellows
2018-09-07 05:30
Beth just pushed a few changes to that repo - so should be up to date now :slightly_smiling_face:

bethskurrie
2018-09-09 21:39
Hey @antonello did you manage to work out a flow that you were happy with?

antonello
2018-09-10 06:17
Hey @bethskurrie! Not yet. I?m trying to get the team to engage so that we can make some trade offs together, but they haven?t engaged much.

mattgilbert90
2018-09-10 12:52
has joined #pact-broker

gaurav
2018-09-13 10:57
I see `Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.` with latest pact broker docker. Any suggestions? Thanks.

bethskurrie
2018-09-13 11:00
You can't do anything, unless you want to submit a PR. I just haven't gotten around to writing the code to display v3 pacts.

gaurav
2018-09-13 11:05
Not a ruby person yet. I could help with Java, react, python etc.. never used ruby. Will have to wait then :-)

gaurav
2018-09-13 11:44
Is it possible to change tag in pactbroker? *Scenario*: *1)* I run consumer tests in CI (mvn test), *2)* publish pact tagged as head: `mvn pact:publish -Dpactbroker.tags=head`.. *3)* deploy in QA environment, test software *4)* deploy in production *5)* Change latest `head` tag from `head` to `prod`. In step 5: Instead of running consumer tests again to generate pacts and then publish, I would like change latest `head` tag from `head` to `prod`. Can I achieve that? Thanks.

bethskurrie
2018-09-13 11:48
You can tag as many times as you like. Something can be latest head and latest prod.

bethskurrie
2018-09-13 11:48
Use the pact broker CLI

bethskurrie
2018-09-13 11:48
The recommend approach is to tag with the branch name and the stage name.

bethskurrie
2018-09-13 11:49
So a pact may be latest master, test and prod all at the same time.

bethskurrie
2018-09-13 11:49
Tag with the branch name when you run CI, then with the stage name every time you deploy.

bethskurrie
2018-09-13 11:50
This allows you to use can-i-deploy to make sure you can safely deploy a compatible version to a given environment.

gaurav
2018-09-13 11:51
thanks. sure. Then I can add a tag to an existing pact? Will have a look at pact broker cli.

bethskurrie
2018-09-13 11:51
Of course.

bethskurrie
2018-09-13 11:51
You actually tag a pacticipant version, not a pact.

bethskurrie
2018-09-13 11:52
But pacts can be identified by the tags on their version.

gaurav
2018-09-13 11:53
hmm okay thanks.. will check pact broker cli and do some thinking. :slightly_smiling_face:

bethskurrie
2018-09-13 11:58
Have a read of the "reaching pact nirvana" doc. There's a link to it in the pact broker wiki.

bethskurrie
2018-09-13 11:58
It explains how to get the most out of tagging.

gaurav
2018-09-13 12:18
Thanks quick q: suppose we tag a pacticipant version 1.0 as ?prod?, then we make some changes and then tag pacticipant version 2.0 as ?prod?. Now when we run provider test to validate against contracts tagged as prod (`mvn test -PproviderTests -Dpactbroker.tags=prod`), it will be run only against version 2.0 of pact, right? (although both 1.0 and 2.0 are tagged as prod)

bethskurrie
2018-09-17 02:20
Yes @gaurav it only validates the latest with the specified tag.

gaurav
2018-09-17 03:58
thanks. :slightly_smiling_face:

richard.jones
2018-09-18 23:08
Potentially weird question: say we have a new provider and we?d like to start up our automated monitoring system to check for failing pacts against it. There?s no consumers registered yet though, but AFAICT there?s no way to register a provider with the broker outside of registering a pact - so the latest-provider-pacts list will 404 rather than return an empty list. Just wondering what folks thoughts might be on this. Also relevant, I guess: the HAL libraries I have access to all handle the 404 case poorly, and barf because there?s HTML being returned instead of JSON.

bethskurrie
2018-09-18 23:54
1. You should get a JSON 404. I need to fix it if you're getting html

bethskurrie
2018-09-18 23:54
2. You can create a pacticipant with no pacts. Just post to /pacticipants with a JSON document with a name.

richard.jones
2018-09-19 05:45
1: ok, thanks! 2: ahah! I had forgotten that, thanks, that?ll solve the problem even betterer :smile:

bethskurrie
2018-09-20 02:11
Hey @richard.jones. We've fixed the content type for 404s, but just wondering if your tool cares whether you get an empty body, or if it expects a `{}`?

bethskurrie
2018-09-20 02:11
We've gone with empty body for now, but it can change.

richard.jones
2018-09-20 02:14
Hm, I honestly am not sure what the HAL libraries will do in either case. Thanks for fixing the content-type tho!

bethskurrie
2018-09-20 02:15
np. we're just pushing out the new docker image

richard.jones
2018-09-20 02:15
(sorry, my round tuits for testing such behaviour are in incredibly short supply at the moment)

bethskurrie
2018-09-20 02:15
np

bethskurrie
2018-09-20 02:15
it probably doesn't matter

slack1
2018-09-20 20:25
currently getting a 503 response when trying to push pacts to our hosted instance. any known problems right now?

slack1
2018-09-20 20:27
i can go to the instance in the browser and i do get prompted for credentials, but then get a page with just the text "Service Unavailable" (it also has the 503 status code)

slack1
2018-09-20 22:01
appears to be back

matt.fellows
2018-09-21 13:22
Hi folks, We've looked into a couple of point issues and resolved them today. if anyone else is experiencing issues don't hesitate to hit us up directly.

matt.fellows
2018-09-21 13:23
Apologies, looks like there were some intermittent issues which resolved itself, and we made some adjustments. Sorry about the interruption!

mmonson
2018-09-21 20:36
Anyone else having issues publishing to pact broker after upgrading gradle to 4.10.1? I get this response `HTTP/1.1 200 OK`, but the file on the broker hasn't changed.

uglyog
2018-09-23 22:29
Gradle version shouldn't make a difference, unless they have changed some core library. Debug logs will help (running with `-d`). Also check that the pact files have actually changed :wink:

richard.peckett
2018-09-27 09:28
Morning guys, can someone tell me if the pact broker docker image is compatible with windows?

bethskurrie
2018-09-27 09:34
I have some feeling that there has been trouble binding to port 80. But otherwise, it should be. I'm not a docker expert, but shouldn't all docker images be windows compatible?

richard.peckett
2018-09-27 09:56
Hi Beth, I wasn't sure as the readme for the docker image suggests having to set environment vars for connection strings and the like, obvs thats easy enough to do in windows but the readme seems geared toward linux so just wanted to ask the question :slightly_smiling_face:

bethskurrie
2018-09-27 09:57
Should be OK. As long as you can bind to port 80 on the host.

richard.peckett
2018-09-28 08:49
We managed to get this working and deployed in Azure Container instances yesterday, worked nicely with minimum effort! If anyone wants any help or instructions PM me!

bethskurrie
2018-09-28 09:10
Would you be interested in adding notes to the readme @richard.peckett?

richard.peckett
2018-09-28 09:12
sure thing, will do this tomorrow when I've got some free time

matt.fellows
2018-09-28 11:39
Good to know. I couldn?t understand why it wouldn?t work, but theory != practice

nnoble
2018-10-02 02:22
has joined #pact-broker

richard.peckett
2018-10-02 15:15
Still going to do this, sorry completely forgot over the weekend!

matt.fellows
2018-10-02 21:35
:grinning:

dervis4
2018-10-04 10:11
has joined #pact-broker

fraser.crichton.devel
2018-10-04 23:25
has joined #pact-broker

shekharsp27
2018-10-09 10:13
Hi, The Matrix on Pact Broker shows the high-level verification results, is there any way in Pact Broker where a user can see detailed verification result. For Example:- A detailed result which shows what was the contract and what is an execution result as well (e.g. which user gets while executing verification goal using maven).

bethskurrie
2018-10-09 10:20
Not in the JVM implementation. @uglyog is it reasonably straight forward to add an appender for the pact verification tests that would publish the results to the broker? In the ruby impl I just made another rspec formatter, it was quite easy. I'm not sure how the JVM outputs work though.

bethskurrie
2018-10-09 10:21
I could probably have a go at it myself now I'm back in the Java world, sigh.

shekharsp27
2018-10-09 10:33
:+1:

shekharsp27
2018-10-09 11:07
@bethskurrie Are there any API's which can be used to generate custom report for PACT tests

shawn
2018-10-09 15:29
has joined #pact-broker

inbox
2018-10-10 15:42
has joined #pact-broker

inbox
2018-10-10 15:45
Hi :wave: guys. Attempting to set up a pact broker via a local docker implementation using Postgres. When running test.sh step 11 fails after posting a heartbeat status url followed by `Waiting for the Pact Broker to be ready...parse error: Invalid numeric literal at line 1, column 10` I?d appreciate any help I can get on this

inbox
2018-10-10 15:53
according to the log in nginx it's having difficulty connecting to the postgres instance

inbox
2018-10-10 15:56
fixed :smile:

matt.fellows
2018-10-10 21:48
What was the issue? anything worth sharing?

liran.tal
2018-10-12 15:15
wow, great new issues :ok_hand:

matt.fellows
2018-10-14 21:54
@bethskurrie the Pending pacts feature, is that technically in the codebase now just not yet documented?

bethskurrie
2018-10-14 21:55
It needs an env var to be turned on in the verifier

bethskurrie
2018-10-14 21:55
I do need to document it.

alejandro.exequiel.ca
2018-10-17 19:49
has joined #pact-broker

antonios.klimis
2018-10-22 11:03
Any strategy on how to output the whole error stack on state setup stage? At the moment I get `Failure/Error: set_up_provider_state interaction.provider_state, options[:consumer]` which is not very helpful.

matt.fellows
2018-10-22 11:28
Hey @antonios.klimis - which language? Might be best asking there

matt.fellows
2018-10-22 11:28
it looks unrelated to the pact broker

antonios.klimis
2018-10-22 11:39
Ok @matt.fellows!

matt.fellows
2018-10-22 11:46
:thumbsup:

tarcio.saraiva
2018-10-23 23:38
has joined #pact-broker

shidhore.ajinkya
2018-10-26 11:33
has joined #pact-broker

sylvia.yap
2018-10-31 05:23
has joined #pact-broker

sylvia.yap
2018-10-31 05:27
Hi all, I have a question about the pact broker. I?ve published a pact for consumer C1 and provider P1 to the pact broker. And it is posted successfully with the correct version and listed on the matrix view as well as the pact list view. But when we trying to retrieve it, the pact was for a different consumer C2 to the same provider P1. Anyone has any idea what?s going on?

bethskurrie
2018-10-31 05:33
I've never heard of that happening. Can you look at the logs and identify which url it's publishing to, and which one it's being retrieved from?

sylvia.yap
2018-10-31 05:41
Yup, I?ve checked the log and confirmed that the url is the same

sylvia.yap
2018-10-31 05:43
Cause I can see the specific version that I?m publishing in the matrix and pact list view

bethskurrie
2018-10-31 05:47
Can you write a script to reproduce it on another broker?

sylvia.yap
2018-10-31 05:50
hmm.. let me try that

liran.tal
2018-10-31 06:13
can you share what are the two consumer names?

liran.tal
2018-10-31 06:13
I wonder if it?s some edge case with regards to lower/upper case letters or special chars being stripped off or something

matt.fellows
2018-10-31 07:32
@sylvia.yap how do you retrieve retrieve it?

sylvia.yap
2018-10-31 21:39
@liran.tal The consumers are SalespersonService and UserServicePython. The provider is EmployeeService

sylvia.yap
2018-10-31 21:41
@matt.fellows I?m retrieve the pact from the url {host}/pacts/provider/EmployeeService/consumer/SalespersonService/version/2.7.0-cd7b8710

bethskurrie
2018-10-31 21:58
@sylvia.yap I'm just getting you a test broker so you can try and replicate it against a database that I can then use to debug. Unless you can send me a copy of your database.

bethskurrie
2018-11-01 02:11
@sylvia.yap I'm going to PM you credentials to a test broker. Can you try and replicate it there, and I should be able to debug it.

bethskurrie
2018-11-01 02:12
I haven't been able to recreate it locally

liran.tal
2018-11-01 04:43
@sylvia.yap ok another idea. maybe the problem is actually on publishing the contracts to the broker and that?s why the get mixed. Is it possible you can test how you are publishing it? maybe you are using the wrong consumer name?

sylvia.yap
2018-11-01 04:44
@liran.tal Thanks for the suggestions and I think Beth found the issue, and it has been fixed now (#249 was raised for this bug)

liran.tal
2018-11-01 04:54
Ahh cool, happy to hear!

anothonyvong
2018-11-01 21:38
has joined #pact-broker

hansrd_98
2018-11-02 01:42
has joined #pact-broker

iryna.feuerst
2018-11-05 13:14
has joined #pact-broker

jbbarquero
2018-11-05 20:14
has joined #pact-broker

xcq1.defy
2018-11-06 09:28
has joined #pact-broker

nic
2018-11-06 13:09
has joined #pact-broker

hstene
2018-11-08 11:00
Is the pact-broker down? My team reports that their managed pact-broker is not responding?

hstene
2018-11-08 11:03
@bethskurrie ^

uglyog
2018-11-08 12:18
@hstene looks ok to me. What is the name of the broker instance your team use?

nihei.dev
2018-11-12 09:45
has joined #pact-broker

heymega
2018-11-13 10:32
has joined #pact-broker

kurst03
2018-11-18 00:41
has joined #pact-broker

kevin.meiresonne
2018-11-20 14:28
The hosted pact broker seems to be down... We're getting 503 responses.

mouser
2018-11-20 21:46
Yeah same here.

ravbaker
2018-11-20 22:07
has joined #pact-broker

bethskurrie
2018-11-20 22:19
@ugly is on it.

bethskurrie
2018-11-20 22:19
@uglyog!

uglyog
2018-11-20 22:20
Thanks @bethskurrie

bethskurrie
2018-11-20 22:20
We're planning to start moving customers to put our new environment tomorrow

pbanka
2018-11-20 22:24
has joined #pact-broker

jonas.natten
2018-11-21 06:42
has joined #pact-broker

sasa.milovic
2018-11-21 12:57
has joined #pact-broker

borsuk.artem034
2018-11-21 15:35
has joined #pact-broker

bernardo.guerreiro
2018-11-26 14:20
has joined #pact-broker

syed.haq
2018-11-26 14:20
has joined #pact-broker

inbox
2018-11-26 16:23
Hello, Our back broker was previously set up but not being utilized. It is now giving us a 404 `https://aramark.pact.dius.com.au/` did it get shut down?

ruben.perezg
2018-11-29 14:58
has joined #pact-broker

kamilmarkow
2018-11-29 16:57
has joined #pact-broker

dan
2018-11-30 16:06
has joined #pact-broker

thirumal.net
2018-11-30 19:26
has joined #pact-broker

antonello
2018-12-03 12:04
Hi @bethskurrie! Is it possible to customise the title or name of a webhook? Unless I?m missing something it does not seem to be possible.

sai.krishna
2018-12-03 14:33
has joined #pact-broker

sai.krishna
2018-12-03 14:55
Hi @bethskurrie trying to verify the published contract and its always getting timeout

sai.krishna
2018-12-03 14:56
``` Animal Profile Service listening on http://localhost:8081 Pact Verification [2018-12-03T14:54:07.105Z] INFO: pact-node@6.20.0/45416 on : Verifying Pacts. [2018-12-03T14:54:07.107Z] INFO: pact-node@6.20.0/45416 on : Verifying Pact Files [2018-12-03T14:54:10.336Z] INFO: pact-node@6.20.0/45416 on : Created './standalone/darwin-1.61.1/bin/pact-provider-verifier 'https://test.pact.dius.com.au/pacts/provider/Animal%20Profile%20Service/consumer/Matching%20Service/version/1.0.1543848742' --provider-base-url 'http://localhost:8081' --provider-states-setup-url 'http://localhost:8081/setup' --broker-username 'dXfltyFMgNOFZAxr8io9wJ37iUpY42M' --broker-password 'O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1' --publish-verification-results 'true' --provider-app-version '1.0.0' --custom-provider-header 'Authorization: basic e5e5e5e5e5e5e5'' process with PID: 45417 1) should validate the expectations of Matching Service 0 passing (30s) 1 failing 1) Pact Verification should validate the expectations of Matching Service: Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/test/provider.spec.js) at Test.Runnable._timeoutError (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/node_modules/mocha/lib/runnable.js:440:10) at Timeout.<anonymous> (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/node_modules/mocha/lib/runnable.js:251:24) at ontimeout (timers.js:482:11) at tryOnTimeout (timers.js:317:5) at Timer.listOnTimeout (timers.js:277:5) ```

sai.krishna
2018-12-03 14:56
any help on this ?

andrew.nicholson
2018-12-03 16:29
has joined #pact-broker

andrew.nicholson
2018-12-03 16:34
Hi! Does the pact-broker support pacts using the version 3.0.0 spec? I have uploaded an async message pact to my broker, and I see this message when navigating to the pact in the UI: `Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.`

matt.fellows
2018-12-03 21:14
@andrew.nicholson yes it supports them, it just doesn?t render them yet. There is probably an issue in the broker for this, feel free to upvote (or better yet, a PR :slightly_smiling_face: )

matt.fellows
2018-12-03 21:14
All the usual operations work on them though (publish, retrieve, verify etc.)

matt.fellows
2018-12-03 21:15
You might need to provide some more help on this. Could be a transient network issue, could be a firewall etc.

matt.fellows
2018-12-03 21:15
can you navigate to the broker in the browser?

andrew.nicholson
2018-12-03 21:32
Noted, thank you!

matt.fellows
2018-12-03 21:34
:thumbsup:

bethskurrie
2018-12-03 22:46
We're doing a deployment of the hosted pact broker that will hopefully fix the 502s during deployment. Hopefully, you won't experience a 502!

kong
2018-12-03 22:57
has joined #pact-broker

madhukar.mishra
2018-12-04 09:13
has joined #pact-broker

madhukar.mishra
2018-12-04 09:22
Possible bug with how(when?) `provider-verification-published` event is handled in webhooks. Took reference from the template library https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status to create the webhook. ``` { "request": { "method": "POST", "url": "https://api.github.com/repos/ORG/${pactbroker.consumerName}/statuses/${pactbroker.consumerVersionNumber}", "headers": { "Content-Type": "application/json", "Authorization": "**********" }, "body": { "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification Tests", "context": "${pactbroker.providerName} ${pactbroker.providerVersionTags}", "target_url": "${pactbroker.verificationResultUrl}" } }, "events": [ { "name": "contract_content_changed" }, { "name": "provider_verification_published" } ], "createdAt": "2018-12-04T06:17:26+00:00" } ``` But I guess that during creation `${pactbroker.providerVersionTags}` wasn't available, which is why two different statuses were created

jonas.natten
2018-12-04 09:43
Say i use tags for knowing which versions are deployed in which environment. So when i deploy my application i tag the deployed version `55555` with `prod`. This works fine and i can fetch the pact with `/pacts/provider/aaa/consumer/bbb/latest/prod`, but what if i deploy an old version say `44444` to prod now? The endpoint still returns the `55555` pact. Do i have to delete tags when i deploy a new version? How should i do that?

bethskurrie
2018-12-04 09:52
Yeah, that's tricky.

bethskurrie
2018-12-04 09:52
I'm afraid you would have to delete the tags from the later versions.

bethskurrie
2018-12-04 09:52
It's a bit of an unusual use case.

bethskurrie
2018-12-04 09:53
Can you explain it further?

madhukar.mishra
2018-12-04 10:14
We figured that putting tag in context doesn't help anyway, since it will keep making the status check different for each branch. Which means that we won't be able to make the status check required for the repo. Just the provider name as context works better.

jonas.natten
2018-12-04 11:00
We currently have a microservice architecture with a handful components. Before we deploy a component i want to check whether the component is compatible with the other components deployed to the environment.

jonas.natten
2018-12-04 11:08
So if one component has been deployed to `prod`, but then rollbacked to an older version. They both have the `prod` tag, but the latest endpoint returns the newest version.

richard.peckett
2018-12-04 11:35
morning peeps, does the broker support contracts for AMQP yet? (sorry if it's been asked a zillion times, I couldn't see anything about it in CHANGELOG.md on github)

jonas.natten
2018-12-04 11:37
So when i use `can-i-deploy` with `--to prod` it verifies against the wrong version (Which is no longer in the environment).

jonas.natten
2018-12-04 11:38
@bethskurrie ^

borsuk.artem034
2018-12-04 15:25
Hi, broker shows v3 specs just liker json file

yousafn
2018-12-04 20:13
has joined #pact-broker

yousafn
2018-12-04 22:06
Hey up all, I am working on a new greenfield application, integrating with some back end services. I am reasonably familiar with micro-service architecture and consumer driven contract testing. For around 5 years, I have advocated swagger use for documenting API's, especially in the initial start up phase, as it is always so hard to get people to agree to something concrete, especially in agile teams. I was recently introduced to PACT a few weeks ago, and instantly bought into the concept. I thought it would be a great asset to our team. I have built a POC which have received really great feedback. - It incorporates 4 providing API's and a single consumer. (although for demonstration, I incorporated a 2nd consumer, who hasn't followed the swagger design spec, to show PACT verification failures) - A pact broker is hosted on an ec2 instance with an rds postgres db - Consumers are publishing to the pact broker with a version number and git short commit sha `1.0.0-a43d33` and tagging with a branch name - Consumers are using `@pact-foundation/pact` written in typescript, executed with jest - Consumers are using `pactfoundation/pact-stub-server` docker with generated pact files, for component integration testing - Publishers are verifying against the hosted pacts. currently using `1.x.x` style versioning - Showed the use of can-i-deploy from the console with the pact ruby standalone app, but have mentioned that there are web hooks that can be used to trigger provider verification, when a consumer publishes a new pact. Things I am having trouble with in PACT (but haven?t investigated yet in the broker code) - Provider version numbers such as `1.0.0-a43d33` are rejected, I was only able to use <1.0.0> - branch names such as `feature/ABC-10` are not tagged Some questions that have been pitched by the client - Can we get reports that we can send round in an email? The console output from provider verification is well formatted, but only the JSON from the pact-broker looks to be visible. I need to look into report formatters. Devs were pleased to see that we could run the provider verification without publishing results to the broker (so they could get a decent report after a verification has failed) - it looks like a lot of hard work. - I am sitting on the consumer side, and we have already built it into our pipeline so we are publishing pacts to a broker. It looks to me that on the provider side, their touch points with PACT is light. They don?t need to own or provide their consumer a mock, to allow them to work in insolation. The verification is simply ensuring they have implemented their contract correctly and the clients expectations have been met. There is a point on provider states, but that isn?t PACT specific - we would always want our provider to provide test data & states to stimulate different test cases as in any other api testing framework. Things I need to investigate - provider versioning (want to include git short sha) - branch tagging (want feature/ABC-10 format branches to show up in the broker) - reporting of verifcation failures in a pretty format - provider states

yousafn
2018-12-04 22:12
PS. Thanks for the awesome work Dius crew :fist:

bethskurrie
2018-12-04 22:59
I don't have time to address all your issues right now, but I will get back to you. I've quick question, which version of the broker are you using? The date ordering should be turned on in the latest version, so the version number can be anything. Also, I've fixed the tags with slashes issue.

bethskurrie
2018-12-04 23:00
It sounds like you have an old version.

bethskurrie
2018-12-04 23:05
> - it looks like a lot of hard work

bethskurrie
2018-12-04 23:06
It's not insignificant, but compare it to the work you would do if you were trying to do everything via traditional integration tests. As the number of interactions increases, traditional integration tests scale exponentially, where as contract tests scale linearly.

bethskurrie
2018-12-04 23:07
As always, you as the developer need to make informed decisions based on the tradeoffs in your particular situation. Generally, at least some level of contract testing gets a better ROI than 1. nothing or 2. only doing traditional integration tests.

bethskurrie
2018-12-05 00:18
We're having some issues with the hosted environment at the moment, and will be pushing out a fix soon.

thirumal.net
2018-12-05 00:32
*How to Add Provider Side Tag to Pact Broker* ? i am able to run the provider verification successfully and publish the result to pact broker but not sure how to attach tag to pact broker from provider side ? using the pactNet:

bethskurrie
2018-12-05 03:13
I'm not sure if the .net impl has it yet. You can raise an issue in the pact-net repo, and in the meantime, use the pact broker client CLI


madhukar.mishra
2018-12-05 08:35
> "traditional integration tests scale exponentially, where as contract tests scale linearly" sounds like a cool concept that could strengthen my team's interest in contract testing. Would love it if you could elaborate a bit

jonas.natten
2018-12-05 11:48
@bethskurrie Could you explain to me what is unusual about my use case (or how I should do it differently) as we spoke about previously in the thread? (https://pact-foundation.slack.com/archives/C9VPNUJR2/p1543916586017400) I tried to elaborate in the thread, but i would think rollbacking is something that might be needed occasionally for everyone (?)

yousafn
2018-12-05 19:21
I have worked with a 20 microservice eco system, where we covered everything with traditional integration tests, but also ran CDC tests within the same framework, and used mocks generated with Wiremock. This has been simpler to implement as your framework is very well documented and reasonably mature. The pact-broker is a great tool to allowing a central repository for expectations, and the swagger mock validator, helping to tie the pacts (and therefore our development) up to our swagger specs will be invaluable. Our first pass of the swagger-mock-validator threw up 68 errors, where the swagger has evolved but these changes were not communicated to the consumer dev team. It will be interesting to see it play out. There are still decisions to be made on our provider side, latest news is that we are going to have an api gateway acting as a pass through to some internal services, so we may have to look at non-http based contract testing options available within PACT. @madhukar.mishra - Contract testing is an invaluable tool in API development. If your team is interested in some reading https://martinfowler.com/articles/consumerDrivenContracts.html or get some pizzas in for lunch and get them to watch this https://www.youtube.com/watch?v=-6x6XBDf9sQ

yousafn
2018-12-05 19:23
Thanks for getting back to me, there is no rush. I am currently using `x-pact-broker-version: 2.27.3` and have noted its a few versions behind so will get it updated!

thirumal.net
2018-12-05 21:08
@bethskurrie -Thank you, i will raise an issue

bethskurrie
2018-12-05 21:45
I guess I've mostly worked in "roll forward only" environments. If there's a bug, it gets fixed and a new version goes out.

bethskurrie
2018-12-05 21:46
These are environments where ci/cd is strong, and releases are quick and frequent.

bethskurrie
2018-12-05 21:46
So it's just simpler to go forward.

bethskurrie
2018-12-05 21:47
I understand that different places have different methods of working though.

bethskurrie
2018-12-06 08:55
@yousafn great, let me know if you're still having any of those problems

bethskurrie
2018-12-06 09:01
the broker supports all json documents.

bethskurrie
2018-12-06 09:01
whether or not it displays them nicely is another question!

bethskurrie
2018-12-06 09:02
:thumbsup::skin-tone-3:

bethskurrie
2018-12-06 09:05
@madhukar.mishra > "traditional integration tests scale exponentially, where as contract tests scale linearly" When you test from a "high" level, (eg traditional integration tests) you have to execute paths you have already tested before, just to get to get to the place where you can test the thing you're interested in. Eg. you have to execute login for every test, and if you have 100 tests, you have to execute login 100 times. With a contract test, you would test login once.

bethskurrie
2018-12-06 09:08
This is why it scales so much better. If there is a new endpoint, you implement and execute one (or maybe a few, if there are variations) new test. If you're using integration tests, you may have to make multiple API calls just to get to the place where you can test the new call. And then, perhaps, you want to test variations on it, so you're adding n*y new calls to the suite. It's easy to see why integration tests get out of hand so quickly.

jonas.natten
2018-12-07 06:13
I see, think i will try to write a script for deleting the tags then. Thanks for the replies! :slightly_smiling_face:

ravbaker
2018-12-07 11:31
I have an issue similar to described here: https://pact-foundation.slack.com/archives/C9VPNUJR2/p1543915335013800 with webhooks and `provider_verification_published` event.

ravbaker
2018-12-07 11:34
my webhook looks like this: ```{ "consumer": { "name": "NAME" }, "events": [ { "name": "provider_verification_published" } ], "request": { "method": "POST", "url": "https://api.github.com/repos/ORG/project/statuses/${pactbroker.consumerVersionNumber}", "headers": { "Content-Type": "application/json" }, "body": { "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification '${pactbroker.providerVersionTags}' ${pactbroker.consumerVersionTags}", "context": "PACT-${pactbroker.providerName}-${pactbroker.providerVersionNumber}", "target_url": "${pactbroker.verificationResultUrl}" }, "username": "...", "password": "...." } }``` and issue I experience is that `${pactbroker.providerVersionTags}` doesn?t show anything. Although the `${pactbroker.providerName}` and `${pactbroker.providerVersionNumber}` are present. Any idea why? I use pact-broker `v2.27.5`

ravbaker
2018-12-07 11:39
It?s crucial to us because we run two verifications every time contract changes once on `develop` and other on `master` to know where is it now ready and whether or not was it released. And we store the branch name in the provider tags.

ravbaker
2018-12-07 12:40
even when I try to test the webhook run through `pb:execute` I do not get the `tags` :confused:

ravbaker
2018-12-07 14:47
I discover that for lookup via `tag` with `pact_uri` like: `https://pactbroker.project.com/pacts/provider/Elli/consumer/Demeter/latest/develop` in `_links` section for `"pb:publish-verification-results"` returns not the same version of contract that was in return but returns latest pushed contract variant. Any thoughs why it happend? Also same other version I see in `"pb:diff"` section. It bites me much on `rake pact:verify` run because then the verification is submit to a different version of contract and it ends with a mess. @bethskurrie

ravbaker
2018-12-07 15:02
looks like `pact_version_sha` is different from `consumer_version_number` on same `represented` pact record

ravbaker
2018-12-10 08:59
@bethskurrie can you help me somehow?

ashish.dubey91
2018-12-10 11:16
has joined #pact-broker

richard.hulm
2018-12-10 11:35
Hiya! We're getting 401s from the broker - implying our credentials have been rotated

richard.hulm
2018-12-10 11:35
What's the best place to keep track of this?

matt.fellows
2018-12-10 11:39
Hi Richard, can youoo please DM me with more detaials?

ashish.dubey91
2018-12-10 12:25
cross posting this from #general: for some reason from my ubuntu machine I can `dig http://foo.pact.dius.com.au` just fine but when I do `curl http://foo.pact.dius.com.au` I get `Could not resolve host: http://foo.pact.dius.com.au` any DNS changes happened recently?

matt.fellows
2018-12-10 12:41
is `foo` important to you or are you obscuring the real domain?

matt.fellows
2018-12-10 12:41
``` > dig http://foo.pact.dius.com.au +short *.http://pact-prod.dius.com.au. 13.211.26.183 13.236.214.174 ```

ashish.dubey91
2018-12-10 12:50
obscuring the real domain. foo -> grofers in my case

d.van.dijk
2018-12-10 13:58
has joined #pact-broker

d.van.dijk
2018-12-10 14:04
@matt.fellows http://portbase.pact.dius.com.au could not be resolved either.

d.van.dijk
2018-12-10 14:35
I'm experiencing the same problem as @ashish.dubey91 Coleagues on Windows can reach the site, but on Ubuntu I can't. Our Jenkins build server on linux experiences UnknownHostException. Anyone?

richard.hulm
2018-12-10 16:15
Hiya we're having the same DNS resolution issues

richard.hulm
2018-12-10 16:18
It seems http://foo.pact.dius.com.au is being redirected to *.http://pact-prod.dius.com.au which is breaking the DNS lookup

richard.hulm
2018-12-10 16:18
You can getaround it by using http://foo.pact-prod.dius.com.au (but the SSL cert is wrong)

bethskurrie
2018-12-10 19:15
Hi guys. We've done some DNS magic to migrate to the new infrastructure without downtime (or that was the plan!) This had had some unexpected effects. We'll address them asap.

bethskurrie
2018-12-10 19:17
Sorry about the inconvenience. The new environment will be much more stable than the old one once we've sorted out the teething issues.

bethskurrie
2018-12-10 20:09
Ok @d.van.dijk @richard.hulm @ashish.dubey91 can you try again now?

bethskurrie
2018-12-10 20:10
I'm guessing you're all probably asleep. The joys of working in a global distributed industry!

ashish.dubey91
2018-12-10 20:40
it works now! :slightly_smiling_face:

ashish.dubey91
2018-12-10 20:41
I'm curious to find out though how DNS resolution behavior was weird with the changes you guys did

ashish.dubey91
2018-12-10 20:43
Mac -> dig and curl are both able to resolve. On Ubuntu however, dig is able to find A records but not curl

matt.fellows
2018-12-10 21:15
It seemed only to be the case on Ubuntu but could more likely be related to specific versions of tooling/network stack

matt.fellows
2018-12-10 21:16
But yes, strange

bethskurrie
2018-12-10 21:17
My guess is that some implementations do some extra smarts when there are wildcards involved.

matt.fellows
2018-12-10 21:18
It should also be noted that it did work on other Linux variations (in our case Amazon Linux)

d.van.dijk
2018-12-11 06:55
Yes, it works

d.van.dijk
2018-12-11 06:55
thanks

matt.fellows
2018-12-11 07:16
:thumbsup:

richard.hulm
2018-12-11 09:54
All good - thanks for your help @bethskurrie and @matt.fellows (Quite right - we're in the office ~9-17 GMT! Woo worldwide economy :stuck_out_tongue: )

ravbaker
2018-12-11 13:48
@bethskurrie any chance getting some help on this?

tghcastro
2018-12-12 13:25
has joined #pact-broker

ravbaker
2018-12-13 07:23
Few days ago I posted an issue yet got no answer. But I believe it?s a real flaw in pactbroker. Any chance someone can help me? https://pact-foundation.slack.com/archives/C9VPNUJR2/p1544194044044700

matt.fellows
2018-12-13 07:28
If that?s true, I think the best starting point would be to create a bug on the pact-broker repository, with something we can use to reproduce the issue.

bethskurrie
2018-12-13 07:35
It would surprise me if nobody had noticed this, as it is critical functionality. I won't rule it out thought. Can you please create a script to recreate it @ravbaker? Note that the verifications belong to the content, not the consumer version, so if the latest has the same content as the latest develop, the verification result will apply to both.

brentbarker9
2018-12-13 23:05
I upgraded my local pact docker from 2.24.0 to 2.27.6 and I'm having issues with viewing some pacts

brentbarker9
2018-12-13 23:05
I get the following error:

brentbarker9
2018-12-13 23:05
`this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.`

brentbarker9
2018-12-13 23:05
but other v3 contracts are rendering OK

brentbarker9
2018-12-13 23:05
does the pact broker not support v3 pacts in all cases?

brentbarker9
2018-12-13 23:05
the old version rendered it just fine

matt.fellows
2018-12-13 23:12
> does the pact broker not support v3 pacts in all cases? The broker doesn?t support _visualising_ v3 pacts at all. It supports them for all the usual operations, you just can?t render them

bethskurrie
2018-12-13 23:12
Render them nicely

matt.fellows
2018-12-13 23:12
are you sure other v3 pacts are rendering OK? (perhaps they are v3 part aren?t using any of the v3 features)

bethskurrie
2018-12-13 23:13
They render the JSON

zach.the.hammer
2018-12-18 16:11
has joined #pact-broker

zach.the.hammer
2018-12-18 16:13
Any plans to add some of the v3 features to the pact broker UI? Specifically for the markdown pact document. 1. multiple provider states 2. provider state variables

zach.the.hammer
2018-12-18 16:15
lol as always i should check if matt posted a response to my question right before i posted it


matt.fellows
2018-12-18 23:00
If you?re feeling generous, it shouldn?t be a big PR :slightly_smiling_face:

zach.the.hammer
2018-12-18 23:27
Ha maybe this weekend

zach.the.hammer
2018-12-18 23:41
Is the web ui code in the pact broker repo?

zach.the.hammer
2018-12-18 23:42
Can you point out where the pact rendering code is?

matt.fellows
2018-12-18 23:42
yep, at the moment

matt.fellows
2018-12-18 23:42
ummm? maybe


zach.the.hammer
2018-12-18 23:43
Haha i am there

matt.fellows
2018-12-18 23:43
actually, maybe not

zach.the.hammer
2018-12-18 23:43
I see the network view

zach.the.hammer
2018-12-18 23:43
But not the actual pact


matt.fellows
2018-12-18 23:45
It?s going to be a new Resource I think



matt.fellows
2018-12-18 23:46
The latter being the `text/html` ?renderer? for the new resource

zach.the.hammer
2018-12-18 23:47
Oh god

zach.the.hammer
2018-12-18 23:47
Ruby

zach.the.hammer
2018-12-18 23:47
Ha ok i will explore this when i have some time

matt.fellows
2018-12-18 23:47
indeed

matt.fellows
2018-12-18 23:48
I think it?s more wrapping your head around WebMachine which is basically HTTP projected unto overly precise OO concepts. It?s pretty great though, from what little I?ve seen of it

zach.the.hammer
2018-12-18 23:50
Pact::Doc::Markdown::ConsumerContractRenderer

zach.the.hammer
2018-12-18 23:51
Seems like that?s where the magic happens

zach.the.hammer
2018-12-18 23:51
Alright thanks matt. I?ll see what i can do

matt.fellows
2018-12-18 23:52
:thumbsup:

matt.fellows
2018-12-18 23:52
Know that any progress you make here will make lots of people happy (and probably avoid another repeat of that question tomorrow :laughing: )

zach.the.hammer
2018-12-19 00:02
haha whatever i can do to get beth to answer more of my random questions

dglaubman
2019-01-03 22:27
has joined #pact-broker

thomas.scheuchzer
2019-01-05 10:22
has joined #pact-broker

ilya.markevich1991
2019-01-05 21:06
has joined #pact-broker

lmoore
2019-01-07 04:21
has joined #pact-broker

serikch
2019-01-07 08:58
has joined #pact-broker

mehdizonjy
2019-01-10 07:55
has joined #pact-broker

mehdizonjy
2019-01-10 09:03
hello everyone Thanks for all the work you've put into the broker and the whole pact echosystem. I'm currently spiking on creating a POC and integrating Pacts Broker into our pipeline. I'm stuck on configuring the `contract_content_changed` webhook. I can execute the webhook manually and it's able to access and call my provider's CI. However whenever my consumer updates their version and publishes a new contract, the webhook shows `not run` status and it's not attempting to call my endpoint. There doesn't seem to be any log messages when i try to access the `logs endpoint`. anytips on how to further debug this ?

matt.fellows
2019-01-11 03:09
@mehdizonjy are you actually publishing a _new_ contract? as in, are there new fields / interactions in it? If it?s just a new version, this won?t trigger (as the contract itself hasn?t changed, and therefore there is no reason to bug the provider about it)

mehdizonjy
2019-01-11 03:12
thanks for the reply. i changed both the contract (by requiring an extra field) and pumping up the consumer version. it's worth noting that i'm using the hosted pacts broker solution , but when running pacts broker locally on my machine via docker it's working like a charm.

matt.fellows
2019-01-11 03:24
hmm thanks

matt.fellows
2019-01-11 03:24
@bethskurrie any ideas how to debug this?

bethskurrie
2019-01-11 03:26
There should be some debug logs that say what's going on with regards to webhooks when a pact is published

bethskurrie
2019-01-11 03:26
we'll need to bump the log level

bethskurrie
2019-01-11 03:28
If you're just messing around (ie. it's a test pact) then try deleting the pact entirely and starting again.


mehdizonjy
2019-01-11 03:51
i just removed all the published pacts, and then published a new version. however it's still stuck at `notRun`. I then proceeded to removing the both participants and give it another try, sadly no luck :cry: > we'll need to bump the log level is there away for me to do that in the hosted broker solution and access the logs ? the logs on the webhook itself are still empty

bethskurrie
2019-01-11 03:51
no, these are logs you can't see.

bethskurrie
2019-01-11 03:58
@mehdizonjy I'm just deploying a change to prod which will allow me to modify the log level dynamically and check out why it thinks it's not changed.

mehdizonjy
2019-01-11 03:59
awesome, thanks for taking the time to help me debug this ^_^

bethskurrie
2019-01-11 04:03
``` def update_pact params, existing_pact http://logger.info "Updating existing pact publication with params #{params.reject{ |k, v| k == :json_content}}" logger.debug "Content #{params[:json_content]}" updated_pact = pact_repository.update existing_pact.id, params if existing_pact.json_content != updated_pact.json_content webhook_service.trigger_webhooks updated_pact, nil, PactBroker::Webhooks::WebhookEvent::CONTRACT_CONTENT_CHANGED else logger.debug "Pact has not changed since previous revision, not triggering webhooks" end updated_pact end ```

bethskurrie
2019-01-11 04:03
ok, that's not helpful



mehdizonjy
2019-01-11 04:05
is that what's happening ?


bethskurrie
2019-01-11 04:05
That's the critical logic.

mehdizonjy
2019-01-11 04:06
so basically the broker is not detecting any changes in the pact ?

bethskurrie
2019-01-11 04:06
Yes.

mehdizonjy
2019-01-11 04:06
therefore it'snot running the webhook

mehdizonjy
2019-01-11 04:06
:neutral_face:

bethskurrie
2019-01-11 04:07
I'm not sure why.

mehdizonjy
2019-01-11 04:07
how come following the same steps on my local pact broker produces different results ?

bethskurrie
2019-01-11 04:08
I'm not sure.

bethskurrie
2019-01-11 04:08
Can you PM me your broker subdomain?

leslie.fung.lf
2019-01-11 09:04
has joined #pact-broker

gbivins4
2019-01-12 00:24
has joined #pact-broker

galvinshane
2019-01-18 11:35
has joined #pact-broker

galvinshane
2019-01-18 11:46
Im wondering is it possible to change the default port (from 80) and context path of pact broker? so i am using docker to deploy to kubernetes and would like to be able configure ingress with a path of /pact and also change the default port. Wondering if there are environmental variable to can set to achieve this currently?

gopinathlangote11
2019-01-18 15:58
I think you can do it

galvinshane
2019-01-18 16:58
Hi Gopinath, have you been able to do this? would you happen to remember how to did?

pravera
2019-01-23 13:59
has joined #pact-broker

hossam.saraya.ext
2019-02-01 09:26
has joined #pact-broker

hossam.saraya.ext
2019-02-01 09:26
anyone around?

bethskurrie
2019-02-01 09:27
yes

hossam.saraya.ext
2019-02-01 09:28
Hey @bethskurrie. How is your day going?

bethskurrie
2019-02-01 09:28
Pretty good. Working on the commercial broker today.

bethskurrie
2019-02-01 09:28
Should have some social logins coming out soon

bethskurrie
2019-02-01 09:29
Been a long time coming

hossam.saraya.ext
2019-02-01 09:29
Oh sounds good! I didn't see any paid plans. Only saw the free option

bethskurrie
2019-02-01 09:30
We've got to get something to pay for first!

hossam.saraya.ext
2019-02-01 09:30
:smile: like a big strong broker

matt.fellows
2019-02-01 09:31
Big strong broker - new contender for product name :laughing:

hossam.saraya.ext
2019-02-01 09:31
:smile:

hossam.saraya.ext
2019-02-01 09:32
Okay so at my company we have a distributed microservices arch. services live on a private network and outside world can't access services directly. We also don't have an API gateway layer, we have frontend servers that speaks with the services in the private networks

hossam.saraya.ext
2019-02-01 09:32
So, I am setting up pact between the smallest provider/consumer we have to get started

hossam.saraya.ext
2019-02-01 09:33
One question is, if I use the hosted pact broker. *Can I assume that the broker machine ip is static* so that I can whitelist it

hossam.saraya.ext
2019-02-01 09:34
Otherwise, I will not be able to setup webhooks because the http requests fired from the broker will never reach our network

bethskurrie
2019-02-01 09:34
Understood

bethskurrie
2019-02-01 09:34
@kong may be able to answer that.

hossam.saraya.ext
2019-02-01 09:38
I also wanted to ask you what are the possible use cases for webhooks? So what I have in mind for our CI pipeline is: *Consumer* - Defines and publishes contracts to broker at the end of the build *Provider* - Query the broker for contracts and test its ownself against the matching contracts - Publish verification results back to the broker - Pass if the verification succeeds, fail otherwise

hossam.saraya.ext
2019-02-01 09:39
Does this sound like the right way to use pact for you? @bethskurrie

bethskurrie
2019-02-01 09:39
Yes.


bethskurrie
2019-02-01 09:39
Webhooks will trigger the provider build when a contract changes

hossam.saraya.ext
2019-02-01 09:39
Yea it says that a use case would be to trigger builds on provider when contracts change

bethskurrie
2019-02-01 09:40
if you're running your provider ci regularly anyway, it's not such a big deal.

bethskurrie
2019-02-01 09:40
it's mostly useful when your provider is not under active development

hossam.saraya.ext
2019-02-01 09:41
mmm so what if the provider build fails...we will have the system in a contract-violating state after we deploy the consumer. yes?

hossam.saraya.ext
2019-02-01 09:42
because for us. QA, Staging environments auto deploy if the build passes. So for a consumer that violates the contract, the build will still pass and it will be deployed

bethskurrie
2019-02-01 09:48
so, you need the can-i-deploy tool

hossam.saraya.ext
2019-02-01 09:50
Okay so to use the `can-i-deploy` tool. I have to `verify` the provider against the updated/new contracts first?

matt.fellows
2019-02-01 10:00
yes, but if the contract hasn?t changed between consumer builds the broker knows and it will already be green (it also won?t fire the webhook for changed pacts, because it hasn?t changed)

hossam.saraya.ext
2019-02-01 10:02
makes sense. But for changed contracts, how can I asynchronously verify the provider from the consumer build? I am worried about deadlocks here. If I add pact verification as a build step in both consumer and provider..I might end up in a deadlock where both provider and consumer will fail

matt.fellows
2019-02-01 10:06
Well, the webhook is async and the consumer build shouldn?t know about the provider build going on (i.e. it shouldn?t wait for it or anythnig).

matt.fellows
2019-02-01 10:07
If a new expectation is added to the contract that has yet to be validated by its provider, it _will_ currently fail the contract test

matt.fellows
2019-02-01 10:07
so the branch wouldn?t be in a mergeable state just yet, but once the provider has gotten to it and verified, a rebuild on that branch should succeed

matt.fellows
2019-02-01 10:08
It?s a bit clumsy, to be fair, and we?re not far away from releasing a way to resolve that deadlock (currently called WIP pacts). Stay tuned

hossam.saraya.ext
2019-02-01 10:09
Okay but that means that for every contract change, the consumer has to fail once?

hossam.saraya.ext
2019-02-01 10:09
have I got it right

matt.fellows
2019-02-01 10:10
there are ways to automate that part (e.g. create a dependency on the contract testing step of the provider?s build), but given WIP pacts are coming my advice would be to not attempt it

bethskurrie
2019-02-01 10:10
We'd recommend putting your new expectations on a branch of the consumer

bethskurrie
2019-02-01 10:11
publish that to the broker, get the provider to verify it, then once it's green, merge in your feature branch into the consumer.

bethskurrie
2019-02-01 10:11
Because the pact will have been "pre-verified" when it was on a branch, it won't fail on master.

matt.fellows
2019-02-01 10:14
yes, sorry if that part wasn?t clear earlier. For some reason I thought branches had been discussed

hossam.saraya.ext
2019-02-01 10:14
mmm that makes sense I think. Only downside here is that it needs human interaction. I was looking for a way to have that check inside the consumer build (a way to ask the provider to verify without going into a deadlock). But you saying its WIP anyways right?

hossam.saraya.ext
2019-02-01 10:15
and since webhooks are async, we cant wait for it in consumer build

matt.fellows
2019-02-01 10:17
you can link builds together as noted, but that just creates a dependency tree that can get complicated very quickly for anything other than fairly simple architectures. Best to let builds fail and have humans review

hossam.saraya.ext
2019-02-01 10:17
cant I get away with: ``` - consumer publish contract - webhook triggers provider verifications - consumer sleeps ? - consumer polls `can-i-deploy` - consumer fails or succeed when `can-i-deploy` has new results ```

bethskurrie
2019-02-01 10:17
It seems to happen less often than you'd think.

bethskurrie
2019-02-01 10:18
You can poll can-i-deploy if you'd really like to - it's got built in retries for this.


matt.fellows
2019-02-01 10:18
of course, but that is still creating a dependency on another non-deterministic build. It can work, you can weigh up if the additional complexity is worth it in your environment

matt.fellows
2019-02-01 10:19
And I should note I?ve seen this done in a number of places to great success

matt.fellows
2019-02-01 10:19
in some environments, this just gets a bit messy. Keep an eye on it and change if it does

hossam.saraya.ext
2019-02-01 10:20
Okay I think you are right about creating a dep on a non deterministic build..I suspect that to get nasty at some point of future time

matt.fellows
2019-02-01 10:20
it tends to work nicely with new apps that have quick builds and a small amount of collaborators

hossam.saraya.ext
2019-02-01 10:20
I will ask our PR reviewers to check the broker UI first before merging a PR.

matt.fellows
2019-02-01 10:21
as this scales, you now could have multiple builds waiting for multiple other builds

bethskurrie
2019-02-01 10:21
you can actually get the webhook to post an update to the PR

hossam.saraya.ext
2019-02-01 10:21
exactly..which can feel like a circus


hossam.saraya.ext
2019-02-01 10:22
Ah thats really nice

hossam.saraya.ext
2019-02-01 10:23
Okay but from the provider side, we should have the pact verification as a build step and that would make the build fail if the verification fails. So thats still automated on the provider which is good

hossam.saraya.ext
2019-02-01 10:24
Thanks a lot for the insider help..you enlightened me :sparkles:

bethskurrie
2019-02-01 10:24
np

hossam.saraya.ext
2019-02-01 10:25
Still have questions related to the broker concept thou

hossam.saraya.ext
2019-02-01 10:26
so, do you think I should only spin up one broker for all the environments? In that case I would prefix service names like `staging-user-service` and `production-billing-service`..etc

hossam.saraya.ext
2019-02-01 10:26
The other option is to have a broker for each environment

bethskurrie
2019-02-01 10:26
you use tags to manage environments

bethskurrie
2019-02-01 10:26
single broker for all stages

hossam.saraya.ext
2019-02-01 10:27
ah and is there a filter in the UI where can I filter pacts by tag?


bethskurrie
2019-02-01 10:27
Yes, there is a filter, but it's got a poor UI

hossam.saraya.ext
2019-02-01 10:27
nop, will do now

bethskurrie
2019-02-01 10:28
that will explain about tags.

hossam.saraya.ext
2019-02-01 10:28
at some point I would like to contribute..maybe create a UI for you :muscle:

bethskurrie
2019-02-01 10:28
you tag a version with metadata that tells you about the branch it's on or the stage it's in (eg. "master" or "prod")

matt.fellows
2019-02-01 10:28
OooOH!

bethskurrie
2019-02-01 10:29
Then you can say "I want to verify the latest "master" pact" or "the latest production pact"

bethskurrie
2019-02-01 10:29
Any help with the UI would be appreciated. I initially didn't have the skillz, and now I just don't have the time, to make it look good.

hossam.saraya.ext
2019-02-01 10:30
I would def. love to help you out

hossam.saraya.ext
2019-02-01 10:31
https://dribbble.com/daedlock not so active on dribble but I share some stuff there.

bethskurrie
2019-02-01 10:32
Man, I am such a back end dev these days, I love it when front end devs want to do UIs for me!

bethskurrie
2019-02-01 10:32
I think I lost touch with CSS about 5 years ago and never caught up again.

hossam.saraya.ext
2019-02-01 10:32
there is no CSS now

hossam.saraya.ext
2019-02-01 10:32
there is styled components and CSS-in-JS

bethskurrie
2019-02-01 10:32
whatever the kids are using these days :stuck_out_tongue:

hossam.saraya.ext
2019-02-01 10:32
:smile:

hossam.saraya.ext
2019-02-01 10:33
yea frontend part of the world is changing faster than my brain can handle

hossam.saraya.ext
2019-02-01 10:34
Awesome!! I just need to know if I can assume that brokers ip is static or not. Otherwise I can't use the webhooks and I will have to run and maintain a local copy :disappointed:

matt.fellows
2019-02-01 10:35
No static IP, but can provide IPs for whitelisting

matt.fellows
2019-02-01 10:35
``` 13.210.164.235 13.210.66.183 13.211.59.138 13.54.130.12 54.252.242.229 54.66.180.72 13.236.113.160 54.252.233.246 ```

hossam.saraya.ext
2019-02-01 10:35
thats awesome man thanks

matt.fellows
2019-02-01 10:37
Just so we?re clear, the broker itself is not on a static address, but webhooks will come out via one of them

bethskurrie
2019-02-01 10:38
They use Magic.

hossam.saraya.ext
2019-02-01 10:41
great. are you using any frameworks on frontend? or is it just SSR with bootstrap

bethskurrie
2019-02-01 10:51
SSR

bethskurrie
2019-02-01 10:51
There's an api to create a js front end with though.

bethskurrie
2019-02-01 10:51
/dashboard

bethskurrie
2019-02-01 10:52
It would be good to do something in vue or react.

hossam.saraya.ext
2019-02-01 10:52
you can use `react-rails` if you are using rails

bethskurrie
2019-02-01 10:52
Something that a lot of people can contribute to for maintenance - the problem with the Ruby back end is that not many people use Ruby these days.

bethskurrie
2019-02-01 10:53
It's not rails.

bethskurrie
2019-02-01 10:53
And there are currently only 3 pages anyway!

bethskurrie
2019-02-01 10:53
Would be easy to rewrite.

hossam.saraya.ext
2019-02-01 10:55
I can imagine. Can't we generate api documentations from the contracts? Is it something you would consider?

bethskurrie
2019-02-01 10:57
How does that differ from the current HTML pact rendering?

hossam.saraya.ext
2019-02-01 10:59
idk I am thinking like a documentation with each service and its endpoints..etc

hossam.saraya.ext
2019-02-01 10:59
but that might sound silly since this is not what pact is about anyways

bethskurrie
2019-02-01 11:00
Swagger would do that better

hossam.saraya.ext
2019-02-01 11:00
agreed

bethskurrie
2019-02-01 11:00
We want to integrate swagger into the pact work flow better in thrle future.

bethskurrie
2019-02-01 11:01
It's late here in Australia, so I'll chat to you a other time.

hossam.saraya.ext
2019-02-01 11:01
Okay thanks a lot! ttys

bethskurrie
2019-02-01 11:02
I'd recommend starting with some wire frames and getting some feedback from the pact community on slack if you're interested in the UI. We actually need to start with a design exercise.

hossam.saraya.ext
2019-02-01 11:04
Will start on something this weekend. The pages we have are (pact list, pact view and network graph) I think I need to discuss this in a bit more details later to know what pages should be designed, what api endpoints we already have..etc

hossam.saraya.ext
2019-02-03 10:28
Okay I am back again to discuss the UI screens we have. I will start a designing a prototype for broker's UI but need more direction from you

hossam.saraya.ext
2019-02-03 10:36
Oh almost forgot that for me its an open source contribution and for you its a full time job :smile: so probably I won't be able to reach you guys on weekends -.-

matt.fellows
2019-02-03 11:02
> for you its a full time job :smile: well? no, we also have full time jobs too. This is our, not-paid-but-still-basically-full-time job :slightly_smiling_face:

hossam.saraya.ext
2019-02-03 11:43
that requires devotion man keep it up

hossam.saraya.ext
2019-02-03 11:43
any idea where should I start in regards to the UI?

bethskurrie
2019-02-03 20:35
Sure does.

bethskurrie
2019-02-03 20:37
I'd start by doing some wire frames. Put them in front of some of the users from the slack channel, get some feedback, and iterate.

bethskurrie
2019-02-03 20:37
Sorry, the time zone difference means you're ready to work on this when I'm in bed, unfortunately!

hossam.saraya.ext
2019-02-04 08:58
:smile:

hossam.saraya.ext
2019-02-04 14:05
Is it a good idea to use *git SHA* as consumer and provider versions?

yousafn
2019-02-04 14:13
I use short git sha plus a CI build version number, gives us the ability to reference a single commit, and know which build artefacts have been tested (as our deployable artefacts contain the CI build number)

hossam.saraya.ext
2019-02-04 14:14
> CI build version numbe good idea

hossam.saraya.ext
2019-02-04 17:06
~DELETED~

james.carman
2019-02-07 22:53
has joined #pact-broker

james.carman
2019-02-07 22:59
I think the problem I ran into before with all of this automation was that if the provider does not declare any pacts, the broker won?t have data on it. There?s nothing to tag

james.carman
2019-02-07 23:02
I need to make sure the production version of the provider is verified against my consumer pact

james.carman
2019-02-07 23:03
This is when trying to deploy a new consumer version into an environment

james.carman
2019-02-07 23:03
Am I missing something?

james.carman
2019-02-07 23:04
Being able to tag a provider version would work I suppose

james.carman
2019-02-07 23:06
@bethskurrie I think this was my conundrum before

james.carman
2019-02-07 23:07
I?m just getting back to getting pact integrated into our workflows

bethskurrie
2019-02-07 23:07
Sorry, I'm working right now.

james.carman
2019-02-07 23:07
K

bethskurrie
2019-02-07 23:08
Can you come up with a concise and complete description of your problem scenario, with an expected result, and the actual result

james.carman
2019-02-07 23:08
Whenever you have time. Thanks

james.carman
2019-02-07 23:08
I can try, sure

james.carman
2019-02-07 23:22
Part of our issue is we can?t use webhooks because we are using a hosted instance, which can?t reach our Jenkins box

abubics
2019-02-07 23:32
The provider doesn't need to declare any pacts (that's not really a concept) or tests . . . it just tells the broker which provider it is, so it knows which Pact scenarios to verify

james.carman
2019-02-07 23:36
I need to know which version to verify

james.carman
2019-02-07 23:41
Of the provider

abubics
2019-02-07 23:42
right, that's what the tags are for :slightly_smiling_face:

james.carman
2019-02-07 23:42
I understand that the provider doesn?t declare pacts and they?re not supposed to

james.carman
2019-02-07 23:43
The issue is I need to know that the right version (the production version) of the provider is verified against my pact

james.carman
2019-02-07 23:43
How do I know what is the production version of the provider?

abubics
2019-02-07 23:46
To clarify, you want to know what the provider version is for the latest `prod` tag on a pact version?

james.carman
2019-02-07 23:47
Before I deploy a consumer to production, I need to make sure its pacts have been verified against all of the production versions of the providers

james.carman
2019-02-07 23:47
That?s the general concept

james.carman
2019-02-07 23:48
I?m trying to figure out if tags (alone) can solve this problem

james.carman
2019-02-07 23:48
If they provide enough state

james.carman
2019-02-07 23:49
The only place a provider version shows up is when they verify a pact

james.carman
2019-02-07 23:49
There?s a version associated with that verification

james.carman
2019-02-07 23:51
But there doesn?t appear to be a way to declare that a specific provider version is the production version

james.carman
2019-02-07 23:51
Make sense?


abubics
2019-02-08 00:01
1. When a provider verifies a pact version, the provider's version is listed in the matrix. 2. When a verified pact version is promoted to a prod environment, it should push the `prod` tag to that pact version. 3. Now any consumer changes have an updated prod provider version to verify against.

abubics
2019-02-08 00:01
Is this workflow missing something for you?

abubics
2019-02-08 00:01
For example, do you have multiple live prod versions?

abubics
2019-02-08 00:01
(that's a real use case sometimes)

abubics
2019-02-08 00:02
(You still need to add the `prod` tag when the provider is promoted to prod. Nothing in Pact can do that for you, of course)

james.carman
2019-02-08 00:35
It doesn?t even need to be multiple prod versions.

james.carman
2019-02-08 00:35
The issue is that I have no way of knowing what is the production version of the provider

james.carman
2019-02-08 00:37
The pact, and the tags associated with it are meant to be associated with the consumer that uploaded the pact

james.carman
2019-02-08 00:37
There is no tag for a provider

hossam.saraya.ext
2019-02-08 01:09
I think the tag is associated with a ?pact? not a service. The provider would then verify itself against the latest ?prod? pacts. Someone correct me if I am wrong

hossam.saraya.ext
2019-02-08 01:15
If all is green, you deploy. If you do a CD and deployments doesnt happen manually. I think the flow would be 1. Consumer changes and publish new pact to brokee 2. Broker trigger a build on the provider via a webhook 3. You use can-i-deploy as a consumer build step. If it succeeds, deploy. Otherwise exit with non-0

hossam.saraya.ext
2019-02-08 01:17
Cant you whitelist the brokers ip on your jenki ns box? I think webhooks is needed for having the flow you need

abubics
2019-02-08 02:32
You're right, @hossam.saraya.ext, tags go on Pact versions. Pacts are versioned by content, so if multiple versions of consumers have the same Pact content, no extra work needs to happen. Likewise, if a provider has verified one version of a Pact, all future verifications automatically happen until the content changes again.

abubics
2019-02-08 02:33
If you wanted to have `consumer-prod` and `provider-prod` as separate tags, I guess you could, but I'm not sure what that solves.

james.carman
2019-02-08 04:49
The trick is that the specific version of the provider needs to verify the pact

james.carman
2019-02-08 04:49
The version that?s in production

james.carman
2019-02-08 04:51
Yes, the pact is what?s tagged, but the pact comes from the consumer. So, the tag on the pact is really within the context of a version of the consumer.

james.carman
2019-02-08 04:53
I?m not trying to be difficult. I?m just trying to figure out if I can safely certify that a consumer works with the versions of the providers that it is about to be deployed with

abubics
2019-02-08 05:04
I'm sure you can, have you looked at the matrix? It shows every combination of consumer version that either - hasn't been verified by any provider version, or - has been verified, and which version it is

abubics
2019-02-08 05:04
If you need that info by an API or CLI tool, I'm not the best person to direct you, but maybe one of the actual maintainers :slightly_smiling_face:

james.carman
2019-02-08 05:25
Oh I?m sure the matrix can tell me the answer. But, I need to know which specific combination(s) to look for.

james.carman
2019-02-08 05:26
It?s all about that provider version

james.carman
2019-02-08 05:26
I need to know which version of the provider to check

abubics
2019-02-08 05:33
I must still be missing something . . . if the matrix can tell you the answer, what outstanding issues do you have? Maybe describe the usage context?

abubics
2019-02-08 05:33
I mean, if the info's in there, I'm sure you can get it out somehow.

james.carman
2019-02-08 05:38
I need to know what question to ask it, which cell to look for in the grid.

james.carman
2019-02-08 05:46
I mean programmatically, by the way. Of course we know (or can easily determine) what version of our stuff is running where.

rjmcguinness
2019-02-08 09:52
has joined #pact-broker

bethskurrie
2019-02-08 20:05
We can give you a list of IPs to white list @james.carman

james.carman
2019-02-08 20:43
That can certainly help with our automation. Let me ping our ops guys and see if they?re down with that

hossam.saraya.ext
2019-02-09 11:19
pact screen first concept. Feedback & suggestions are much appreciated

rafael.anachoreta
2019-02-12 12:13
has joined #pact-broker

pkuang
2019-02-14 16:47
has joined #pact-broker

pkuang
2019-02-14 16:57
Hi! I was wondering if someone can comment on the prospect of this proposed feature: https://github.com/pact-foundation/pact_broker/issues/248 This would be useful for my CI/CD use case where I have a consumer change in a branch that requires verification from the provider version in prod. However this may fail if the corresponding change hasn't been deployed to prod yet. However, once the provider has deployed to prod and we know the consumer branch change is compatible, can-i-deploy will still fail since the provider verification build wasn't rerun against the consumer branch contracts. It would be useful if we were able to simply re-run the consumer branch build (which would republish the same contract) and have the webhook trigger the provider verification build via a 'contract_published' event that fires regardless of whether the contract has changed.

tomw
2019-02-15 16:54
has joined #pact-broker

bethskurrie
2019-02-18 02:09
This looks amazing!

bethskurrie
2019-02-18 02:09
I though you were just going to do the index page.

bethskurrie
2019-02-18 02:11
This would be quite easy to do. It's just a matter of having the free time to do it, which I don't have a lot of right now.

bethskurrie
2019-02-18 02:11
If you're keen enough to do a PR, I can show you where the code would need to change.


bethskurrie
2019-02-18 02:12
I remember I deliberately made the event "CONTRACT_CONTENT_CHANGED" instead of PUBLISHED so that we could add one for PUBLISHED later.


bethskurrie
2019-02-18 02:15
Adding the event to this list should allow the API to accept the new value: https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/webhooks/webhook_event.rb#L14

hossam.saraya.ext
2019-02-18 08:30
That wont be a good idea. we should create some identity thats visible on all pages

bethskurrie
2019-02-18 08:30
Even better than I had hoped.

hossam.saraya.ext
2019-02-18 08:30
Right now the kind of identity we have is ?made with bootstrap? :D

bethskurrie
2019-02-18 08:30
Sad but true

bethskurrie
2019-02-18 08:31
I can't see the index page mock up though

bethskurrie
2019-02-18 08:31
It seems to have been deleted.

hossam.saraya.ext
2019-02-18 08:31
Yea I havent worked on it yet

hossam.saraya.ext
2019-02-18 08:31
Its still wip

bethskurrie
2019-02-18 08:31
no problem!

hossam.saraya.ext
2019-02-18 08:31
So i think index page and the pact matrix page

bethskurrie
2019-02-18 08:32
One concern I'd have with putting the request and response side by side is that deeply nested JSON might end up being squished.

bethskurrie
2019-02-18 08:32
It looks great with a simple example, but might not scale for real world data.

hossam.saraya.ext
2019-02-18 08:32
Yea good point

hossam.saraya.ext
2019-02-18 08:33
We might want to test it against real data

hossam.saraya.ext
2019-02-18 08:33
We can parse the json and show it as a tree

bethskurrie
2019-02-18 08:33
I might be able to find some real data and obfuscate it.

hossam.saraya.ext
2019-02-18 08:33
So we have both text and tree view. But that doesnt totally fix the indentation hell

bethskurrie
2019-02-18 08:34
Have you worked with the v3 pact spec where there are multiple provider states, and provider state params?



hossam.saraya.ext
2019-02-18 08:35
Nope havent seen that. I might need you to walk me through the broker to point out the core ui interactions

bethskurrie
2019-02-18 08:36
That format is not even currently supported by the broker.

bethskurrie
2019-02-18 08:36
Really, there are only 4 pages. The index, the network diagram, the matrix, and the pact itself.

hossam.saraya.ext
2019-02-18 08:39
Yea thats what I thought. I think the matrix is interesting. I will think of another way to present it beside the tabular format

hossam.saraya.ext
2019-02-18 08:43
Do you think we should have a brand primary color. Or you are already settled on ?black??

bethskurrie
2019-02-18 08:44
I have no preference!

bethskurrie
2019-02-18 08:44
I do quite like the b/w, as it's striking, and doesn't look like anything else I've seen.

bethskurrie
2019-02-18 08:45
Given that the matrix by it's nature is very tabular, i'm curious as to how else it could be presented.

bethskurrie
2019-02-18 08:45
It's the epitome of relational data.

hossam.saraya.ext
2019-02-18 08:45
Yea. Will try to get outside the box :package:

bethskurrie
2019-02-18 08:46
I can see the index being presented as cards.

bethskurrie
2019-02-18 08:46
I think there's a lot that could be done with that, but the matrix... I can't quite imagine. I'll look forward to seeing what you come up with though.

bethskurrie
2019-02-18 08:47
Something to note with the index is that there is the simple view, and the tags view.

hossam.saraya.ext
2019-02-18 08:48
I think we should combine both views because they are ultimately the same. And maybe have a switch ?show with/without tags?

bethskurrie
2019-02-18 08:48
I'd actually like to have the tags on the default view, and not have the 'simple' view. But making the space for each pact allow you to have multiple tags for the consumer and provider versions was quite tricky for us (we have done some work on the UI at DiUS for the commercial broker, but we haven't gotten it in to prod yet)

hossam.saraya.ext
2019-02-18 08:48
Also having autocomplete for tags and versions

bethskurrie
2019-02-18 08:49
The matrix and index are not the same - the matrix is every combination of two particular services.

bethskurrie
2019-02-18 08:49
They have a lot of overlap, it's true.

hossam.saraya.ext
2019-02-18 08:49
Yea I meant the tags view. The mateix deserves its own space

hossam.saraya.ext
2019-02-18 08:50
Its probably the core view where users spend the most time

bethskurrie
2019-02-18 08:50
Ah yes - I'd like to retire the no-tags view.

hossam.saraya.ext
2019-02-18 08:50
Or at least me :D

bethskurrie
2019-02-18 08:50
Yes, I think most people do.

hossam.saraya.ext
2019-02-18 08:52
Also I noticed that searching the matrix by tag & latest version doesnt work

hossam.saraya.ext
2019-02-18 08:52
idk if I am doing something wrong

hossam.saraya.ext
2019-02-18 08:52
But I always get an empty result

bethskurrie
2019-02-18 08:52
there may not be a result for that combination

bethskurrie
2019-02-18 08:53
do you mean tag for one, and latest version for the other?

hossam.saraya.ext
2019-02-18 08:53
No. Tag and latest version for both contractees

bethskurrie
2019-02-18 08:53
you can't enter both.

hossam.saraya.ext
2019-02-18 08:53
Why not?

bethskurrie
2019-02-18 08:53
you can say, "latest version with tag" or "latest version"

bethskurrie
2019-02-18 08:54
it doesn't make sense.

bethskurrie
2019-02-18 08:54
Can you give me a screenshot? Maybe I'm misunderstanding you.

hossam.saraya.ext
2019-02-18 08:54
Yep. Gotta jump in a quick meeting now but will post a screenie right after

bethskurrie
2019-02-18 08:54
ok

hossam.saraya.ext
2019-02-18 13:34
Okay it works when I apply the filter to one participant only (the consumer)

hossam.saraya.ext
2019-02-18 13:34
Conceptually, is the tag related to a participant or a pact?

hossam.saraya.ext
2019-02-18 13:35
I know that each participant can have versions..but what about the tags? Do we tag a participant or do we tag a pact?

mail
2019-02-20 11:05
has joined #pact-broker

lukas.mrtvy
2019-02-21 12:36
has joined #pact-broker

lukas.mrtvy
2019-02-21 12:36
Does Pact Broker provide healthcheck or metrics endpoint for Prometheus?

dagarwal
2019-02-21 13:31
has joined #pact-broker

oswald.quek
2019-02-21 16:06
has joined #pact-broker

m.r.green
2019-02-25 09:05
has joined #pact-broker

kajan.siva
2019-02-25 14:51
has joined #pact-broker

pkuang
2019-02-26 16:33
Hi @bethskurrie, can you review https://github.com/pact-foundation/pact_broker/pull/258 when you get the chance please?

kajan.siva
2019-02-26 19:08
@kajan.siva has left the channel

ragarwal
2019-02-27 06:03
Hello, I have a question: I want to use the pact broker interface and features but can?t use its own db. Is it possible to provide the data via some api?

bethskurrie
2019-02-27 06:04
What problem are you trying to solve?

ragarwal
2019-02-27 06:07
we are doing contract testing is a way where consumer side writes pacts but the provider side is using swagger files for verification. Company has its own contract-testing-cli which does all the validation work. The cli is a command line tool and prints everything on console which is not easy to consume. I really like the power pact_broker has and all the details it provides. Just trying to understand how can we use it in our setup?

bethskurrie
2019-02-27 06:07
You can publish any JSON contract to the broker. It doesn't have to be a pact.

bethskurrie
2019-02-27 06:08
Sounds like you're using the swagger validator from atlassian?

bethskurrie
2019-02-27 06:08
We're actually adding support for swagger documents in the DiUS commercial broker. cc @matt.fellows

pltran875
2019-03-01 23:07
has joined #pact-broker

mouser
2019-03-04 04:55
hi, just wondering if there has been any change in behaviour around webhooks for the hosted pact broker? we seem to be having webhooks triggered even if the contract hasn?t changed??

matt.fellows
2019-03-04 05:02
Not that I?m aware of, but I know others have had that issue if they use matchers with defaults as the library generates new dates/integers etc. each time

bethskurrie
2019-03-04 05:04
you can see what has changed by going to the pact in the API browser, then clicking on the `pb:diff-previous-distinct` relation.

mouser
2019-03-04 05:04
yeah we?ve had that issue before and are generally fairly careful to provide fixed examples when writing our tests

bethskurrie
2019-03-04 05:04
@mouser ^^

bethskurrie
2019-03-04 05:05
See what version it thinks the previous distinct version is.

mouser
2019-03-04 05:05
we?ve just noticed in the last few days that at times our build monitor lights up with what appears to be multiple webhooks being triggered?. we manually diff?ed one in particular and could see no difference other than the published date

mouser
2019-03-04 05:05
ok, i?ll try that

matt.fellows
2019-03-04 05:15
Interesting, perhaps it?s that issue above?

bethskurrie
2019-03-04 05:41
Any luck @mouser?

mouser
2019-03-04 21:54
Not yet?. I found one of our javascript pact tests was using a dynamic timestamp that was causing one provider to be unnecessarily run?.

mouser
2019-03-04 21:55
but i?m still looking into some of the others

bethskurrie
2019-03-04 21:59
If you can't identify the reason, I can add some logging so we can see what the broker thinks the diff is.

mouser
2019-03-04 22:51
Ok? let me keep a bit more of an eye on things over the next day or so and I?ll try to get more details about when it?s happening. It doesn?t seem to be happening on all consumer builds so I suspect it might be an incorrectly configured service or webhook somewheere

mouser
2019-03-04 22:51
thanks beth!

josh.mccure
2019-03-05 01:06
has joined #pact-broker

bethskurrie
2019-03-05 02:59
np

rabih
2019-03-05 06:17
has joined #pact-broker

rabih
2019-03-05 06:17
Hi, is it possible to force the name for consumer/provider instead of getting this message(other than creating manually): The name ?ServicesProvider? is very similar to the following existing consumers/providers: * providers_api If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.

bethskurrie
2019-03-05 06:24
There should be more information in that error to tell how to fix it.

bethskurrie
2019-03-05 06:24
You can turn off the duplicate detection.

bethskurrie
2019-03-05 06:25
Services Provider is very vague! Are sure it's the best name?

bethskurrie
2019-03-05 06:26
Also which library and version are you using to publish the pact?


rabih
2019-03-05 06:29
Hi Beth, yes this is the message that we got, also note that we are using the hosted pact broker so we could not chanbe the config

bethskurrie
2019-03-05 06:30
Oh right

bethskurrie
2019-03-05 06:30
Can I actually suggest that in this case, your names are very vague, and perhaps changing them to be more descriptive of what the services does might kill two birds with one stone?

rabih
2019-03-05 06:31
so is there any way to add this check when initialising dsl.Pact or when publishing

bethskurrie
2019-03-05 06:31
Is this actually a provider that returns information about other providers?

rabih
2019-03-05 06:31
yes we are changing the names

rabih
2019-03-05 06:32
we are following a convention of `servicename_type` so for example a service named triggers that has api providers would be triggers_api

rabih
2019-03-05 06:33
we have also services that use MQ integration tests, named like control_mq

bethskurrie
2019-03-05 06:34
As an aside, a client I was at banned the use of "service" and "api" in the name, because they felt it was redundant.

bethskurrie
2019-03-05 06:34
You shouldn't have problems calling things foo_api bar_api

bethskurrie
2019-03-05 06:35
If you do, I can update the logic.

bethskurrie
2019-03-05 06:36
I may be able to turn this off for your broker specifically if you continue to have problems.

rabih
2019-03-05 06:36
that would be appreciated

bethskurrie
2019-03-05 06:37
Can you send an email to about this please?

rabih
2019-03-05 06:37
ok sure thank you

rabih
2019-03-05 06:38
I will just also send the pact url, any further details from my side?

bethskurrie
2019-03-05 06:39
I just need to know your broker. You'll need to send it from an email address that matches the original registration domain if it's for a company.

rabih
2019-03-05 06:39
ok sure

bethskurrie
2019-03-06 07:47
@hossam.saraya.ext the tag belongs to the version

bethskurrie
2019-03-06 07:48
There's a really good doc on versioning in the broker on http://docs.pact.io

rabih
2019-03-06 12:09
Hello @bethskurrie , any updates regarding this issue, still getting the same message

vinod.baradwaj
2019-03-07 10:19
is it possible to `delete` webhooks that are already created or update it ? when i try to `delete` i get 405 error ?

matt.fellows
2019-03-07 10:19
Yes, of course. What resource are you trying to delete?

vinod.baradwaj
2019-03-07 10:21
i have created webhook for pb:create.. i want it to be deleted

bethskurrie
2019-03-07 10:22
Go to /webhooks

bethskurrie
2019-03-07 10:23
Find the one you want, and send delete to it.

vinod.baradwaj
2019-03-07 10:24
these are the entries i have in webhooks

bethskurrie
2019-03-07 10:25
Why aren't you using the api browser?

vinod.baradwaj
2019-03-07 10:25
it worked.. thanks @bethskurrie @matt.fellows :+1:

matt.fellows
2019-03-07 10:25
So you would delete the only webhook in that list

matt.fellows
2019-03-07 10:25
:thumbsup:

vinod.baradwaj
2019-03-07 10:31
I am trying to setup webhooks to trigger provider build on jenkins, so trying out different combinations, still not able to trigger the provider build. is it possible to get status of webhooks ?

matt.fellows
2019-03-07 10:31
yes

matt.fellows
2019-03-07 10:32
Navigate through the HAL API and you should be able to see the status and any logs associated with it

vinod.baradwaj
2019-03-07 10:32
it says `success` still in jenkins the build has not triggered

matt.fellows
2019-03-07 10:32
what do the logs say?

bethskurrie
2019-03-07 10:33
From the index page, you'll see a link to the Webhook status for that pact. Follow those links, and you'll find the execution logs for the Webhook.

bethskurrie
2019-03-07 10:33
Also, remember the Webhook is only triggered when the pact changes.

matt.fellows
2019-03-07 10:34
But you can manually trigger it, which is useful for debugging

vinod.baradwaj
2019-03-07 10:57
in status it says `success`.. yes @matt.fellows i triggered manually.. but not sure whats the actual issue in calling the jenkins build

matt.fellows
2019-03-07 10:58
What do the logs say?

vinod.baradwaj
2019-03-07 11:23
i see only this @matt.fellows

matt.fellows
2019-03-07 11:24
Even if you click the link for ?Webhook execution logs??

vinod.baradwaj
2019-03-07 12:15
some authentication issue??

vinod.baradwaj
2019-03-07 13:41
fixed it... thanks @matt.fellows :slightly_smiling_face:

matt.fellows
2019-03-07 23:22
np, what was it?

joguespermana
2019-03-11 02:15
has joined #pact-broker


vinod.baradwaj
2019-03-11 14:00
i was not using the correct url with `/build`

oswald.quek
2019-03-12 14:35
:wave: is there an endpoint in the pact broker to delete pacts that are older than a certain date?

davidjgmendes
2019-03-13 14:37
has joined #pact-broker

davidjgmendes
2019-03-13 14:43
@yousafn sry for digging up this old thread, but your use case interested me and brought up some questions. You mentioned your use of WireMock alongside CDC testing. My question is on the scope of each of the tests. Are the tests using WireMock functionally testing the service that is consuming the mocked service ? And how do you make sure the WireMock mocks keep parity with the evolving contracts. Thanks in advance for any input on this.

alisdaircole
2019-03-13 16:38
has joined #pact-broker

yousafn
2019-03-13 16:46
Hi mate, no problem. It was a big struggle to ensure our wiremock mocks, we kept in sync with our documentation, as we weren?t writing api documentation up front and using generated swagger from the services to document the functionality. If I?m honest it was a massive cluster-fuck, and we built wiremock provider mocks as the providing teams weren?t engaged or bothered about providing these. this tool supports validating wiremock against swagger https://bitbucket.org/atlassian/swagger-request-validator/src/master/ My use case for my current client is documented in the following blog with an example repository showing how we are keeping our pact and swagger contracts in sync https://you54f.wordpress.com/2019/02/19/protecting-your-api-development-workflows-with-swagger-openapi-pact-io/ https://github.com/YOU54F/pact-consumer-example-typescript

yousafn
2019-03-13 16:48
the wiremock representations were similar to the pact approach, however our mocks would return a full response body and not just the bit we were interested in. Our test would check that our expectation was being met (as in the particular piece of data from the response was available) Pact seems to address alot of the issues but it all hinges on collaboration, if you don?t have that, it is never going to mesh well

yousafn
2019-03-13 16:54
just to add, because we didn?t trust our providers and because there was no collaboration, and we didn?t have a view of their changes, we should run a set of tests against their service every hour. A failure meant the request or response structure had changed, and we then needed to assess the change, and the impact it had on us.

davidjgmendes
2019-03-13 16:59
Thanks for the insight, it's really helpful . Will analyse the links you have sent. Much appreciated :pray:

yousafn
2019-03-13 17:02
Any time mate, I have been meaning to write up about my experiences in my last company, I?ve got an example repo that I keep meaning to polish up and get it up on github to demonstrate how we were using it for CDC, but I don?t think it is of much use anymore because I would advocate the use of pact and its supporting toolset to anyone doing cdc testing, bearing in mind the considering of pacts limitations listed in the FAQ of what it is not good for (pass through apis/public api?s)

bethskurrie
2019-03-13 22:34
@hossam.saraya.ext someone has raised an issue asking for pagination on the index page of the broker. I thought I'd check where you're up to in your UI redesign before I spend any time updating the current page.

davidjgmendes
2019-03-14 11:08
In your blog-post you mention "So we are now using our PACT contracts, that we generated, to perform our component integration and e2e testing, with mocks". Are these pact defined interactions enough to functionally test the consumer service ? And if so, don't you end up with contracts that are too tight ? Guiding myself mostly through the PACT Docs here. For component testing is where I would resort to implementing wiremocks instead of resorting to the contracts, my issue is the ability to make sure wiremocks are in sync with the pacts / swagger. From what i have seen from the tool you have referenced it only works if we are defining wiremocks through java (not my case) and I'm looking for a more language agnostic solution. Still, imo it's a great workflow that you have managed there :thumbsup:

yousafn
2019-03-14 15:17
We are functionally testing our consumers with our pact mocks but we are using request matchers to ensure that we are loose with the data our mock provider accepts, (instead of expecting an exact string, it uses a matcher to take any string) so we are interested in checking the structure of the message and only return information defined in an integration test plan, so we can ensure that our data we have defined for our provider states is in sync with the real provider when it is developed. We try and push as much of our testing, as far down the stack as possible, and we use cypress for our e2e and UI tests, but only run a few full stack journeys and stub out responses for the test to provide more granular control. Wiremock is nice, it provides really fine control of your mocks, however I would advise that if you want to use it, that you get your providers to produce the mock, and therefore you as a consumer, you don?t have to worry about keeping a full mock stood up (where you may only care about a tiny portion of an entire response returned). We had to also have a suite of tests, that tested that wiremock behaved as we expected it to, especially when we had developers/testers adding more scenarios, as sometimes they would conflict and not provide expected responses (as a new matcher may be at a higher priority level than your existing mocks)

yousafn
2019-03-14 15:25
Can we set the title of a webhook when registering it with the pact broker? https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/webhooks.markdown The webhooks I have added to circleci and slack reporting both appear with a title of `title: "A webhook for all pacts",` when viewed via the `/webhooks` endpoint. I have tried adding title inside the body element, and outside to no avail. Danke

yousafn
2019-03-14 15:32
Actually, doing some more digging, I believe it is not currently implemented. https://github.com/pact-foundation/pact_broker/issues/136 I have 4 webhooks currently, two for circleci and two for slack (one for publisher verification, and one for contract changed) and it isn?t easy to distinguish which one is which. Will take a look at the issue and files that need changing and see what I can do. I am not familiar with Ruby, so if I do propose a PR, go easy on me :thumbsup: :stuck_out_tongue:

yousafn
2019-03-14 17:42
Another one, now that I have created my webhooks, the sensitive information in the URL?s (CircleCI token and Slack webhook URL) is exposed to readonly users. They can navigate to `/webhooks` and then click on the href under pb:webhooks and it is exposed. Is there any way I can whitelist this for read-only users


thirumal.net
2019-03-15 01:55
*how to connect to RDS Postgres Database from Dockerized pact broker which is deployed in aws EC2 Instance *? i am able to run both pactbroker and postgres docker images successfully in EC2 instance. publishing and verfifcation is working fine but i am facing issue if want to use external AWS RDS database like postgres . i am following below steps but unable to run frontend pact broker 1) Created RDS DB with credentials 2) running pact broker front end docker image in EC2 successfully 3) *how to make sure Pact broker front end application is talking properly with Postgres DB which is not dockeized* i have inspected docker id of frontend pact broker and it has proper usernames/pwd which i executed from rancher "Env": [ "PACT_BROKER_DATABASE_USERNAME=postgres", "PACT_BROKER_DATABASE_PASSWORD=pwd", "PACT_BROKER_DATABASE_HOST=http://pactbroker.c16kmrwxzbxe.us-west-2.rds.amazonaws.com", "PACT_BROKER_DATABASE_NAME=pactbroker", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "DEBIAN_FRONTEND=teletype", "LANG=en_US.UTF-8", "LANGUAGE=en_US:en", "LC_ALL=en_US.UTF-8", "APP_HOME=/home/app/pact_broker/" reason i am not using dockerized pact broker is to get the benefit of RDS autobackup, high avilability, scalability ..etc *please help me what are my next steps to make sure pactbroker is talking with backend postgres database*

richard.jones
2019-03-15 03:18
Our pact broker is currently returning ```{ error: { message: "undefined method `name' for nil:NilClass" } }``` for requests to `/dashboard` ? any ideas?

bethskurrie
2019-03-15 03:18
:thinking_face:

bethskurrie
2019-03-15 03:19
Look at your logs for more info.

richard.jones
2019-03-15 03:19
I?ll see if I can get to them, yep

bethskurrie
2019-03-15 03:21
Have you considered signing up for a free hosted version at http://pact.dius.com.au @thirumal.net?

bethskurrie
2019-03-15 03:23
I really cannot comment on your AWS set up as there are many reasons why your set up may be failing (firewall, policies, VPN access). You need an AWS ops person to help you.

richard.jones
2019-03-15 05:41
@bethskurrie we?ve apparently seen this previously with bad pacts that were uploaded to the broker. We?ll be looking into it on Monday to figure the specific pact that is causing the issue this time.

bethskurrie
2019-03-15 05:42
That was my gut feel, because a consumer/provider is really the only thing with a name

thirumal.net
2019-03-15 17:14
@bethskurrie -Thank you beth, i have to add AWS host IP to inboud rule of RDS , then it started working fine.

thirumal.net
2019-03-15 17:24
@bethskurrie -Regarding http://pact.dius.com.au - i have recommended this pact broker but my management asked me whether this is hippa compliance or not . can you please direct me where can i see this hippa info

yousafn
2019-03-17 14:18
Hey @thirumal.net. I would change your credentials and security settings. Your pact database looks like it is accessible publicly. (ie the postgres port is open) I am happy to answer any questions about AWS Setup has I have a pact-broker hosted on AWS EC2 instance, with an RDS postgres DB. You should ensure your database isn?t given a public IP and put it on a VPC accessible to your EC2 instance only. Setup seperate security groups for your pact broker db and your pact broker ec2 instance. Did you have an ELB? if so you can sign your certificates with amazons cert manager, otherwise you need to roll your own as you can?t use amazons cert manager with your own ec2 instance. I am going to do a write up in a few days, as I have had just had to toughen our security up at work to get it compliant and want to share back my knowledge

sergiy
2019-03-17 14:34
has joined #pact-broker

richard.jones
2019-03-18 02:50
@bethskurrie if it helps, I can privately supply you with our database dump for the above ^^

bethskurrie
2019-03-18 02:54
Yes thanks. I can't see how you can be getting a nil there.

bethskurrie
2019-03-18 02:54
``` Pacticipant.find(id: PactBroker::Pacts::AllPactPublications .where(pact_version_id: pact_version_id) .limit(1).select(:provider_id)) ```

bethskurrie
2019-03-18 02:55
There should not be a way that can be nil, so there's obviously some data combination that I haven't thought of happening in your database.

bethskurrie
2019-03-18 02:55
you can send it to

richard.jones
2019-03-18 02:58
Yep. I?m poking around the database and I can?t see it either, though I?m not confident I?m reading the Ruby code correctly!

richard.jones
2019-03-18 02:59
dump sent!

bethskurrie
2019-03-18 02:59
If I have the db, I'll just put a debug point at that line and it should explain what the problem is.

thirumal.net
2019-03-20 06:17
@yousafn -Thank you for your reply. i have tried for ELB in AWS but some reason it is not working.. i am doing pact broker infrastruture task where i am playing with RDS but as you mentioned i need to change security setting for db. please share your article once you are completed -Thanks

yousafn
2019-03-20 20:40
Hi mate, I have written something up here https://you54f.wordpress.com/2019/03/19/securing-the-pact-broker-with-nginx-letsencrypt/ But it doesn?t talk about securing your rds database If you are just using an ec2 with docker instance of the pact broker and your rds Postgres instance - ensure your database doesn?t have a publicly accessible endpoint ( you can do this via rds console), - stick it on the same vpc as the ec2 instance - set up 2 security groups, one for the ec2 instance to allow http or https traffic. One for your database. - for your db security group ensure it can exposes only the Postgres post and limit access to the ec2 security group - if you need ssh access to your ec2 instance, limit access to your IP ( ideally your work will have a fixed IP ) - if you need to open it up to access from anywhere, then add 2 factor auth to your ssh session and use fail2ban to parse your logs for ssh brute force attacks and exclude the ip addresses via iptables Regarding running on an ELB, ideally use cloud formation templates. You want to clear a cluster with a network stack including vpcs, route 53 for dns and roles with ecs access to execute the containers, then service template?s to run fargate ecs and rds tasks. Deploy via AWS-cli to allow you to pass in environment variables at runtime into the docker container for the pact broker to pick up. Additionally you can store your env vars in amazons parameter store This is a good place to start for the CF templates. You can deploy your db with CF templates too https://github.com/nathanpeck/aws-cloudformation-fargate#private-subnet-public-load-balancer Unfortunately I can?t share my work CF templates. Best of luck with playing with AWS but please do be mindful that you don?t want to leave your resources insecure for too long. Feel free to drop me a pm if you want help with any specifics.

vitaliy.grigoruk
2019-03-21 11:56
has joined #pact-broker

richard.jones
2019-03-21 23:14
We?re seeing a really confusing issue here, wondering if others have also seen it. If we fetch the HTML view of a pact and the JSON view, the contents of the pact differ. There have been many revisions of the pact uploaded.

bethskurrie
2019-03-21 23:15
that should not be possible because they go through the same resource.

bethskurrie
2019-03-21 23:15
The code is exactly the same - the renderer differs.

bethskurrie
2019-03-21 23:15
also, sorry, I haven't had a chance to try out your db on the old code.

bethskurrie
2019-03-21 23:15
Life has been a bit hectic.

bethskurrie
2019-03-21 23:16
Can you provide some data for me?

richard.jones
2019-03-21 23:17
I don?t believe the pact exhibiting this issue is in the snapshot I provided previously, the pact is only a couple of days old. I?ll ask for a fresh snapshot :slightly_smiling_face:

bethskurrie
2019-03-21 23:17
Are you using the same URL exactly?


bethskurrie
2019-03-22 08:26
Question for broker users. I'm improving the messages in the can I deploy results, that explain why an app can't be deployed.

bethskurrie
2019-03-22 08:28
These two options describe the same situation - which one makes more sense (esp for users who are not familiar with the underlying domain model) 1. Version xyz of SomeApp does not exist. 2. No pacts or verifications have been published for version xyz of SomeApp.

vitaliy.grigoruk
2019-03-22 08:37
IMHO, option #2 is better.

bethskurrie
2019-03-22 08:44
Mm. I was leaning towards that. 1 is technically correct, but I think 2 is probably more helpful.

vitaliy.grigoruk
2019-03-22 08:54
option 2 gives a hint about a possible reason, while option 1 just says that it doesn?t exist.

bethskurrie
2019-03-22 08:54
:+1:

arunkumarpoonia
2019-03-22 09:25
has joined #pact-broker

arunkumarpoonia
2019-03-22 10:27
how to publish result with this image - image: dius/pact-provider-verifier-docker?


arunkumarpoonia
2019-03-22 10:28
@bethskurrie can you please help here ?

bethskurrie
2019-03-22 11:09
I suspect you can't

bethskurrie
2019-03-22 11:09
We may need to add that feature

arunkumarpoonia
2019-03-22 11:11
are you planning to add that feature ?

arunkumarpoonia
2019-03-22 11:27
how to publish pact verification result to broker ?


arunkumarpoonia
2019-03-22 13:34
@bethskurrie I am unable to use pact-provider-verifier to verify pacts from broker .

arunkumarpoonia
2019-03-22 13:36
I am running this command - ./pact-provider-verifier --PACT_URL=baseURL/pacts/provider/catalogApi/consumer/magento/latest -h, --provider-base-url=providerURLi

arunkumarpoonia
2019-03-22 14:41
guys

arunkumarpoonia
2019-03-22 14:42
I am unable to verify pact with pact-provider-verifier .

arunkumarpoonia
2019-03-22 14:42
any help will be appreciated ?

rjmcguinness
2019-03-22 16:27
The pact team is based in Australia, so I expect you?ll need to wait till this evening (if you?re in Europe)

matt.fellows
2019-03-22 20:45
I've just responded. Look more carefully at the CLI flags, you've just got them a bit wrong.

mwroblewski
2019-03-24 16:41
has joined #pact-broker

mwroblewski
2019-03-24 16:41
Hello, I have a question concerning plugging Pact into CI / CD: https://stackoverflow.com/questions/55324476/plugging-pact-into-ci-cd. Thanks for help in advance

bethskurrie
2019-03-24 22:17
Your command is wrong.

bethskurrie
2019-03-24 22:17
Please see the comment on the issue.

bethskurrie
2019-03-25 02:57
I've updated the can-i-deploy logic so that can-i-deploy does not stop you deploying a provider to a given environment when the consumer is not yet deployed.

bethskurrie
2019-03-25 02:58
I know there have been a few people having problems with this. Please update your broker and try again.

matt.fellows
2019-03-25 05:52
Is this the WIP pacts or just not failing if there are no consumers yet?

bethskurrie
2019-03-25 05:52
No, different issue

matt.fellows
2019-03-25 05:52
Oh

bethskurrie
2019-03-25 05:53
Sorry, yes, kind of the second point.

hossam.saraya.ext
2019-03-25 10:03
I haven't added anything since then as I am quite super busy. I don't know when I am getting more free time :disappointed:

bethskurrie
2019-03-25 10:04
I feel your pain. It's why the UI still looks like it does after 5 years!

hossam.saraya.ext
2019-03-25 10:05
:smile: yea...it's always the UI that we compromise at the end..sadly

bethskurrie
2019-03-25 10:05
It's the part I enjoy the least, so there are always other things I find higher on the priority list!

arunkumarpoonia
2019-03-25 11:10
Thanks @matt.fellows

matt.fellows
2019-03-25 11:36
:+1:

richard.jones
2019-03-25 22:39
I?ve finally found some time to poke into it more, and learn a bit more how to read the ruby code, and think I?ve found an issue: the code at https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/domain/verification.rb#L83 joins `verifications` and `pact_publications` on `pact_version_id` from both tables, but in our database we have 228 rows where there is no corresponding entry in `pact_publications` for the `pact_version_id` in `verifications`. This would result in a `nil` provider, if I understand correctly. Many different `pact_version_id` are in those 228 rows.

bethskurrie
2019-03-25 22:39
um

bethskurrie
2019-03-25 22:39
that data is wrong

richard.jones
2019-03-25 22:39
There hasn?t been a bogus row in `verifications` generated since December though

bethskurrie
2019-03-25 22:39
that should be impossible

richard.jones
2019-03-25 22:39
:smile:

bethskurrie
2019-03-25 22:40
are they old rows?

richard.jones
2019-03-25 22:40
`select * from verifications where pact_version_id not in (select pact_version_id from pact_publications);` is the SQL I used to find those rows

richard.jones
2019-03-25 22:40
dated from June to December last year

bethskurrie
2019-03-25 22:40
you haven't done a manual cleanup of the data at some stage have you?

richard.jones
2019-03-25 22:40
that?s not ?old? in our broker

richard.jones
2019-03-25 22:40
not that I?m aware of

richard.jones
2019-03-25 22:41
I will ask

bethskurrie
2019-03-25 22:41
ok *that* is an issue.

bethskurrie
2019-03-25 22:41
I will have a look at some other databases.

bethskurrie
2019-03-25 22:42
it's like the pact was verified, and then the publication was deleted through the API.

bethskurrie
2019-03-25 22:42
that would cause that scenario.

richard.jones
2019-03-25 22:43
OK, yep. We definitely need to do some weeding in our broker, as we know there?s a bunch of mis-registered pacts (mis-spelled or just out of date participants for a start). But we?ve not done any of that yet.

richard.jones
2019-03-25 23:24
I?ve confirmed with the broker maintainers here that we?ve only used the API calls to manipulate data in the broker, never manual SQL.

bethskurrie
2019-03-25 23:24
the API call that deletes a pact will leave your data in that situation.

bethskurrie
2019-03-25 23:24
it deletes the publication, but leaves the content, and its connected verifications.

bethskurrie
2019-03-25 23:24
I'm not sure what the best thing is to do about it. Will have to give it some thought.

bethskurrie
2019-03-25 23:25
basiscally, it seems you have left over verifications for pact publications that have been deleted at some stage.

bethskurrie
2019-03-25 23:26
to fix it, you could delete all those orphan verifications.

richard.jones
2019-03-26 00:18
(sorry for AFK) thanks for investigating! We can certainly delete the orphan rows, thanks.


arunkumarpoonia
2019-03-26 09:01
what is the best approach to manage provider state ?

mwroblewski
2019-03-26 09:51
Hello, is it possible to use pact broker without tags ? https://stackoverflow.com/questions/55346970/using-pact-broker-without-tags

matt.fellows
2019-03-26 09:53
I'll try to answer later, but the short answer is yes (you just get less flexibility)

matt.fellows
2019-03-26 09:53
The longer answer is... Why :laughing:

mwroblewski
2019-03-26 10:01
Thanks in advance, let's just say it's due to the way feature branches are used in our project - we can't use their name as tags :wink:

bethskurrie
2019-03-26 10:09
Can you sha the name of the branch to something short and unique?

bethskurrie
2019-03-26 10:10
Are the names too long?

bethskurrie
2019-03-26 10:10
Tag names can contain slashes (eg feat/foo) if that's what the issue is.

bethskurrie
2019-03-26 10:12
That is a very vague question @arunkumarpoonia. Can you be more specific?

bethskurrie
2019-03-26 10:14
I'm making a thread so we don't spam everyone.

bethskurrie
2019-03-26 10:14
You say in your question that the build could still pass even if the pact verification failed. Which build?

bethskurrie
2019-03-26 10:14
Why would it pass?

bethskurrie
2019-03-26 10:15
Can you be clearer about the underlying problem that is stopping you using tags? Is it a technical issue or a human one?

mwroblewski
2019-03-26 10:16
this is rather organizational issue

mwroblewski
2019-03-26 10:16
we use separate feature branches for single small issues in JIRA

bethskurrie
2019-03-26 10:18
I don't see a problem with that.

mwroblewski
2019-03-26 10:18
also there is a separate issue for provider / consumer developer team

bethskurrie
2019-03-26 10:20
If suggest trying to just get things going without tags

bethskurrie
2019-03-26 10:21
Personally, I think the main tags to have are dev and prod.

bethskurrie
2019-03-26 10:22
This is what allows you to ensure backwards compatibility between your consumer and provider.

bethskurrie
2019-03-26 10:22
Feature tags are icing on the cake.

bethskurrie
2019-03-26 10:22
Try with those two tags and see how you go.

mwroblewski
2019-03-26 10:22
ok, thanks

bethskurrie
2019-03-26 10:23
You tag with dev when you publish the pact, and tag with prod when you deploy that app version to prod.

bethskurrie
2019-03-26 10:24
This will allow you to run can-i-deploy - - pacticipant Foo - - to prod

bethskurrie
2019-03-26 10:24
Sorry, on phone, bad formatting.

matt.fellows
2019-03-26 10:39
FWIW I almost always start with just those two tags and in many situations that is good enough

matt.fellows
2019-03-26 10:40
Not all projects enable easy symmetry of feature branches, so that can be difficult.

bethskurrie
2019-03-26 10:44
This is an awesome resource @yousafn

mwroblewski
2019-03-26 11:05
thank you

matt.fellows
2019-03-26 11:11
:thumbsup:

adamgreen
2019-03-26 15:16
has joined #pact-broker

arunkumarpoonia
2019-03-27 08:22
what is the best approach to create provider state when we verify contract . I am using https://github.com/pact-foundation/pact-provider-verifier this to verify pact.

matt.fellows
2019-03-27 08:23
what options are you considering?+

matt.fellows
2019-03-27 08:24
Do you have to use that verifier? Is there not a language/framework you can use? (more optimal)

arunkumarpoonia
2019-03-27 09:36
@matt.fellows can you please suggest a framework for php ?

arunkumarpoonia
2019-03-27 09:37
what is the best approach to handle provider state ? it will be good to get some pointers so that we can head in right direction .


matt.fellows
2019-03-27 09:45
> what is the best approach to handle provider state ? it will be good to get some pointers so that we can head in right direction . Normally I use a state to setup a data fixture (e.g. to seed a specific set of data into a database)

arunkumarpoonia
2019-03-27 10:18
Thanks @matt.fellows i looked at pact-php but cant find any example to handle provider state?

arunkumarpoonia
2019-03-27 10:18
it will be really helpful if you can share any example .


matt.fellows
2019-03-27 10:22
Basically, you need to add a route to your code (just during testing). It will be called prior to each test, to ask the API to setup a particular state. That is where you can change the database / setup internal state etc.

matt.fellows
2019-03-27 10:22
Might want to ask in the #pact-php channel

arunkumarpoonia
2019-03-27 10:26
Thanks a lot @matt.fellows

matt.fellows
2019-03-27 10:27
np

adamgreen
2019-03-27 16:39
Hi all. Is it possible to configure CORs when using pact_broker-docker?


adamgreen
2019-03-27 16:40
however i am still getting Cross Origin errors when calling the APIs from an external web app

arunkumarpoonia
2019-03-28 11:50
How to verify a interaction when id is generated randomly?

arunkumarpoonia
2019-03-28 11:50
if i want to test getCustomer/{customerId} customer id is random here

arunkumarpoonia
2019-03-28 11:51
I am able to test post action but not sure how to create state for {ustomerId} here

arunkumarpoonia
2019-03-28 11:51
any help will be appreciated

dagarwal
2019-03-28 12:10
you need to pass the exact id .i achieved this by updating db at provider level

arunkumarpoonia
2019-03-28 13:19
ok, thanks

mboudreau
2019-03-28 22:18
Exact id if that's important for you to test, or you can use a matcher so that it doesn't matter what it is

mboudreau
2019-03-28 22:19
You can essentially wildcard it so it doesn't matter what's passed in

bethskurrie
2019-03-29 03:40
That can actually be quite tricky @arunkumarpoonia and the answer depends on which library (language) you're using. Can you ask the question in the relevant channel? eg #pact-jvm or #pact-js

bethskurrie
2019-03-29 03:41
@arunkumarpoonia are you talking about CORS issues with the mock service or the Pact Broker?

bethskurrie
2019-03-29 03:42
I feel like you may be getting them confused. The mock service runs on your local machine, and provides an HTTP mock provider. The Pact Broker allows you to exchange contracts and verification results between projects. I can't see why you'd have CORS issues making a request to the Pact Broker.

adamgreen
2019-03-29 08:34
@bethskurrie we're trying to access the pact-broker from a different web application through the apis but due to the different domains the the pact-broker doesn't allow cross domain requests

bethskurrie
2019-03-29 08:35
Is it your own instance, or the hosted version?

adamgreen
2019-03-29 08:37
we're running our own hosted version using the docker-compose set up

bethskurrie
2019-03-29 08:38
You'll need to set the appropriate cors headers in the nginx config

adamgreen
2019-03-29 08:39
ah ok, so we need the reverse proxy if we're going to do this then? That's fine, i'll have a look into setting that up. Thanks for the guidance :slightly_smiling_face:

bethskurrie
2019-03-29 08:40
Pretty sure the docker compose has an nginx set up.

adamgreen
2019-03-29 08:42
when setting up for the first time in an azure vm, passenger phusion was having trouble with the nginx set up, if i recall correctly. removing the nginx removed that issue, hence maybe i've ended up looking in the wrong place for a solution

bethskurrie
2019-03-29 08:44
You can always add them in rack middleware quite easily.


adamgreen
2019-03-29 08:50
so if i pull the pact-broker repo, add that to the app.rb file, build my own broker image - we should be good to go. I'll give this a shot. Thanks again!

bethskurrie
2019-03-29 08:52
Yes, clone the docker repo. Add the rack cors gem to the gem file.

bethskurrie
2019-03-29 08:53
Then add the "use" statement in the http://config.ru

arunkumarpoonia
2019-03-29 15:59
thanks @bethskurrie for your reply. I am using pact-php

yousafn
2019-03-29 17:11
Ola, does the webhook event `contract_content_changed` fire if there is a different version number? Our pact version numbers use circleci buld num + git commit sha such as `761-45dd0a4`. and we tag with `feature/foo-123` If I trigger the CI build to run again, the version number will be upped due to the circleci build number increasing from `761-45dd0a4` to `762-45dd0a4`. The content of the pact hasn?t changed, bar the version number, and this fires the ` "name": "contract_content_changed"` event.

yousafn
2019-03-29 17:12
Danke in advance

bethskurrie
2019-04-01 02:29
No. The event only fires if the content has changed.

bethskurrie
2019-04-01 02:30
Hence the name "contract_content_changed".

bethskurrie
2019-04-01 02:30
:wink:

bethskurrie
2019-04-01 02:30
There must be some non deterministic data in your contract.

bethskurrie
2019-04-01 02:32
To work out what this is, open the pact in the API (HAL) browser, then use either the `pb:diff` or `pb:diff-previous-distinct` relations to work out what has changed in the contract.

bethskurrie
2019-04-01 02:33
@yousafn using CI build numbers is not recommended. Have a read of this: https://github.com/pact-foundation/pact_broker/wiki/Pacticipant-version-numbers

franklin.huynh
2019-04-01 03:19
has joined #pact-broker

franklin.huynh
2019-04-01 03:31
Hi, I'm not sure if it is the right place to ask. I'm having an issue with triggering webhook to bamboo build. I receive this error. ``` "error": { "message": "SSL_connect returned=1 errno=0 state=error: certificate verify failed", ``` I can make sure the request and webhook created correctly. Could anyone shed a light for me? I could provide more stacktrace if needed

bethskurrie
2019-04-01 03:31
yes. your bamboo instance probably has a self signed certificate.


franklin.huynh
2019-04-01 03:34
thanks @bethskurrie for your quick response. I tried implementing that and the fix by executing this script https://github.com/pact-foundation/pact_broker/blob/master/script/insert-self-signed-certificate-from-url.rb I don't have much knowledge on ruby I'm having issue with the database credentials

bethskurrie
2019-04-01 03:34
what sort of database do you have?

franklin.huynh
2019-04-01 03:36
postgres does that answer your question?

bethskurrie
2019-04-01 03:36
yes

bethskurrie
2019-04-01 03:36
DATABASE_CREDENTIALS = {logger: Logger.new($stdout), adapter: "postgres", host: "HOST", username: "USERNAME", password: "PASSWORD", :encoding => 'utf8'}

bethskurrie
2019-04-01 03:36
you'll need to provider the creds and host

franklin.huynh
2019-04-01 03:36
I'll try this now

franklin.huynh
2019-04-01 03:36
thanks Beth

bethskurrie
2019-04-01 03:37
you'll need to comment out line 10 as well.

franklin.huynh
2019-04-01 03:39
sure thanks

franklin.huynh
2019-04-01 04:02
Hi @bethskurrie I tried and get this error ``` /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': LoadError: cannot load such file -- pg (Sequel::AdapterNotFound) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/adapters/postgres.rb:6:in `<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:88:in `load_adapter' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:17:in `adapter_class' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:45:in `connect' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/core.rb:121:in `connect' from certificate2.rb:20:in `<main>' ```

franklin.huynh
2019-04-01 04:02
I couldn't execute the script

bethskurrie
2019-04-01 04:03
how are you executing it?

bethskurrie
2019-04-01 04:03
you need the pg gem available

bethskurrie
2019-04-01 04:03
what languages are you familiar with?

franklin.huynh
2019-04-01 04:03
C# java

franklin.huynh
2019-04-01 04:04
and shell script

bethskurrie
2019-04-01 04:04
ok, so it's like executing a java file without you pom.xml

bethskurrie
2019-04-01 04:04
it doesn't know where to get your dependency from.

bethskurrie
2019-04-01 04:04
where are you executing the script from?

franklin.huynh
2019-04-01 04:05
I'm executing in my local machine

bethskurrie
2019-04-01 04:05
have you got the pact_broker project checked out?

franklin.huynh
2019-04-01 04:05
I host the pact broker docker on my local

bethskurrie
2019-04-01 04:05
ok, run `bundle install`

franklin.huynh
2019-04-01 04:05
I used the docker-compose up to host it on my local

bethskurrie
2019-04-01 04:06
I need to just write an API for this.

bethskurrie
2019-04-01 04:06
Sorry.

franklin.huynh
2019-04-01 04:07
that's ok, you're doing great.

franklin.huynh
2019-04-01 04:08
I'm QA not DevOps or Dev so it's taking me so long to figure this out

bethskurrie
2019-04-01 04:08
are you comfortable with sql?

franklin.huynh
2019-04-01 04:09
no I'm not let me try with the bundle install and run the script again

bethskurrie
2019-04-01 04:11
``` require 'uri' require 'securerandom' require 'date' require 'json' uri_string = "https://google.com" uri = URI(uri_string) certificate_command = "openssl s_client -showcerts -servername #{uri.host} -connect #{uri.host}:#{uri.port} </dev/null 2>/dev/null | openssl x509 -outform PEM" certificate_content = `#{certificate_command}` puts "Downloaded certificate from #{uri.host}: #{certificate_content}" puts({ uuid: SecureRandom.urlsafe_base64, description: "Self signed certificate for #{uri.host}", content: certificate_content, created_at: DateTime.now, updated_at: DateTime.now }.to_json) ```

bethskurrie
2019-04-01 04:11
ok, that script will give you the fields you need to insert

bethskurrie
2019-04-01 04:12
install pgAdmin and then just manually insert the record into the database.

franklin.huynh
2019-04-01 04:14
ok

franklin.huynh
2019-04-01 04:36
@bethskurrie Guess what, itis working like a charm after I inserted the certificate manually. I just wanna say thank you so much for your support

franklin.huynh
2019-04-01 04:39
I have a question. do we have a pact broker cloud version with licensed?

bethskurrie
2019-04-01 04:39
np

bethskurrie
2019-04-01 04:39
with licenced what?

bethskurrie
2019-04-01 04:40
If you are interested in a cloud version, go to http://pact.dius.com.au and sign up for a free trial.

bethskurrie
2019-04-01 04:41
(I work on this along with @matt.fellows and @uglyog)

franklin.huynh
2019-04-01 04:49
I registered it before. But chose to host by our company. (on aws) However, I found out that it may requires effort to maintain it sometime and also cost us a bit on aws service. so we may consider if we can go with licensed cloud version

matt.fellows
2019-04-01 05:50
If by licensed you mean paid/supported, please drop us an email at and we can chat further

franklin.huynh
2019-04-01 05:54
yes @matt.fellows , that's what I mean. Will drop an email asap

matt.fellows
2019-04-01 07:08
:+1:

yousafn
2019-04-01 12:46
Thanks for the reply Beth. Looking at the `pb:diff` or `pb:diff-previous-distinct` relations really helped. It looked to be verifying against old pacts, that actually had changes in, and was ignoring the tag. This appeared to be due to the way we were publishing/tagging - we used 2 curl scripts, one to publish, one to tag. We have now switched to the pact-js publishing step, and tag during the publish step, which has tightened up the checks against contracts using the same tag only, limiting the webhook noise we were getting With regards to the CI number, we use the build number from our deploy step to tag our artefacts, which we promote from test, into staging and production, so the source is always known. Apparently we store this in a git tag, so I will use that, plus a git sha to make up the version number

qatrera
2019-04-02 13:57
has joined #pact-broker

bethskurrie
2019-04-03 06:08
Cool. Sounds like you have it covered.

bethskurrie
2019-04-03 06:09
Yes, you have to tag before you publish.

adamgreen
2019-04-03 14:26
Hi Beth, sadly had no joy in just amending the config as part of the pact_broker-docker repo, suspect i'd have to amend the app.rb file in the base pact-broker repo and create my image from there?

bheemreddy181
2019-04-05 20:14
has joined #pact-broker

jon.pascoe
2019-04-09 11:17
has joined #pact-broker

florian
2019-04-09 20:40
has joined #pact-broker

vitaliy.grigoruk
2019-04-11 15:20
Hi there. I?m trying to add a webhook to pact broker, which will trigger provider verification on provider CI. But for this, I need somehow to tell provider exactly which consumer contract has changed (I don?t want to re-run provider verification for all tags / versions of all consumers). I?d like to run verification only a contract that has been just published. Is there any way to add variables to webhook definitions? e.g. I?d like to pass consumer `$contractTags` to provider CI.

vitaliy.grigoruk
2019-04-11 19:12
pls ignore, already found this in docs :slightly_smiling_face:

franklin.huynh
2019-04-12 00:04
Hi @vitaliy.grigoruk , I have a question but not sure if it is the same with you or not. I'd like the webhook trigger only when the contract with "master" tag changed. Are we able to do it? I cannot find it is the docs.

bethskurrie
2019-04-12 01:22
Hi @vitaliy.grigoruk @franklin.huynh this feature is on the backlog. In the meantime, you can add the consumerVersionTags to the webhook body (as per https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/webhooks.markdown#dynamic-variable-substitution) and get it to trigger an intermediate build. That intermediate build can decide whether or not to trigger the downstream build, and what branch of the provider to use.

matt.fellows
2019-04-12 01:26
Hi , this morning we enabled a Web Application Firewall on our hosted Pact Broker service (https://pact.dius.com.au). This follows a number of additions to our security, compliance and auditing work this year, including a recent third party penetration test. We are monitoring the change closely, however if you do experience any issues today that are out of the ordinary, please let us know so that we can investigate ASAP. Cheers, Matt

james.carman
2019-04-12 01:27
We did see some 504s today. I was wondering if you guys were doing some maintenance

matt.fellows
2019-04-12 01:27
I?ll DM you so we can work through it

bethskurrie
2019-04-12 01:28
@james.carman we've put out a new version of the pact-jvm library with retries to handle any 504s that happen during broker interactions. If you're using one of the other languages, let me know so I can make sure it's got the latest code.

franklin.huynh
2019-04-12 01:29
good solution in the meantime :thumbsup:

james.carman
2019-04-12 01:29
What version of pact-jvm do I need? Just get what?s in central now?

bethskurrie
2019-04-12 01:29
latest in central

james.carman
2019-04-12 01:30
I?m on it. Thanks

james.carman
2019-04-12 01:31
Gotta get kids in bed first. Then I?ll upgrade and get a build going

bethskurrie
2019-04-12 01:31
^^ story of my life

matt.fellows
2019-04-12 01:34
Confirmed that the 504s are unrelated to the change (I think the JVM issues as you mentioned)

james.carman
2019-04-12 01:42
Would you guys be interested in a nice ?test harness? for JAX-RS-based services?

matt.fellows
2019-04-12 01:42
like, a Pact specific one?

james.carman
2019-04-12 01:42
Yeah

james.carman
2019-04-12 01:42
for doing pact verifications

james.carman
2019-04-12 01:43
I?m going to publish one in my ?Jaxxy? library and I?ll let you know when it?s out there: https://github.com/jaxxy-rs/jaxxy

matt.fellows
2019-04-12 01:43
I?m keen to see it, @uglyog would probably have more opinions as the JVM mantainer

matt.fellows
2019-04-12 01:44
Ha, Jasmine the retreiver

james.carman
2019-04-12 01:44
She?s a big sweetie!

bethskurrie
2019-04-12 01:44
A friend for Mary the Alligator?

james.carman
2019-04-12 01:46
So, this 3.6.3 version of pact-jvm does the retries automatically? Or, do I need to turn on some setting?

matt.fellows
2019-04-12 01:46
should be automatically, I believe

james.carman
2019-04-12 01:46
cool, thanks

vitaliy.grigoruk
2019-04-12 07:26
I guess it is not possible. But you can pass tags to your CI job and then based on tag value either perform a build or not. Alternatively, you can have a small proxy application running between pact broker and your CI, where you can do filtering of webhooks based on tag value

vitaliy.grigoruk
2019-04-12 09:40
Hey folks, what are the best practices around cleanup of consumer versions that are not needed anymore (e.g. the ones that are already released). For example, when `consumer feature branch is deleted` -> remove all consumer contract versions that were associated with that deleted branch.

bethskurrie
2019-04-12 09:41
You can delete by tag.

bethskurrie
2019-04-12 09:42
Have a look at the Pact Broker github wiki, on the "deleting things" page.

vitaliy.grigoruk
2019-04-12 09:42
:+1:

vitaliy.grigoruk
2019-04-12 09:42
thank you, @bethskurrie

kevin.meiresonne
2019-04-15 09:46
Hi all, we have this weird issue on our hosted pact broker. When publishing a new version of a certain contract, we keep getting a 403 FORBIDDEN since April 12th. However, publishing other contracts on the same broker using the same credentials works just fine... Any idea what could be causing this?

bethskurrie
2019-04-15 09:47
I may be in the process of fixing that as we speak.

bethskurrie
2019-04-15 09:48
i'll ping you when I've finished deploying, and we can see if it fixes it.

bethskurrie
2019-04-15 09:48
is there a dot in the consumer version number?

kevin.meiresonne
2019-04-15 09:48
Great, that would be excellent

kevin.meiresonne
2019-04-15 09:48
no dots, we use commit sha as version number

bethskurrie
2019-04-15 09:49
hm. maybe this won't fix it. but let's see.


bethskurrie
2019-04-15 09:50
There is some routing logic that makes sure the request goes to the right place (UI or API) based on the headers, content types, etc. I realised this afternoon that there was a bug in it.

bethskurrie
2019-04-15 09:51
I love everything about our new build pipeline, except that it takes what I consider ages to deploy to prod because of ECS draining. Will ping you in half an hour or so...

kevin.meiresonne
2019-04-15 09:52
Weird though that we only have this issue on one particular contract... All others work just fine, just this one started giving 403's since friday

bethskurrie
2019-04-15 09:52
let me have a look at the logs

vinod.baradwaj
2019-04-15 10:57
webhooks in our broker is not triggering provider jobs in jenkins. When i try to directly call pb:execute endpoint, it is triggering the job in jenkins. But the same is not getting triggered when pact file is updated to broker. Is this something related to versioning of the pact files ?

bethskurrie
2019-04-15 11:15
Has the content changed?

bethskurrie
2019-04-15 11:16
Webhooks are only triggered when the content itself has changed, not just when a new publication is made.

vinod.baradwaj
2019-04-15 11:16
then what about the version ? if we update the version ?

bethskurrie
2019-04-15 11:17
No

bethskurrie
2019-04-15 11:17
There's no point - if the previous version is verified, and it's the same content, then it gets the same verification results.


bethskurrie
2019-04-15 11:20
If the content is the same as the previous version, then the only reason you'd need to run the verification again is if the provider had changed - but then if the provider had changed, it would run it's own build, and would pull in the latest pacts and verify them during that.

vinod.baradwaj
2019-04-15 11:38
ah okay got it... thanks Beth :slightly_smiling_face:

bethskurrie
2019-04-15 11:42
:+1:

arunkumarpoonia
2019-04-15 12:22
@vinod.baradwaj @beth I am unable to trigger webhook, getting below error :

arunkumarpoonia
2019-04-15 12:22
{ "errors": { "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } }

beth
2019-04-15 12:23
has joined #pact-broker

arunkumarpoonia
2019-04-15 12:28
Unable to add webhook for non secure URL

arunkumarpoonia
2019-04-15 12:29
{ "errors": { "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } }

bethskurrie
2019-04-15 21:18
Well. What did the docs say @arunkumarpoonia?

bethskurrie
2019-04-15 21:18
Did you find the part where it tells you how to configure the whitelist?

matt.fellows
2019-04-15 22:08
Do you have a question?

ian.mcwilliams
2019-04-16 14:49
has joined #pact-broker

marc
2019-04-17 13:28
has joined #pact-broker

iruben91
2019-04-17 14:17
has joined #pact-broker

arunkumarpoonia
2019-04-18 15:12
I want to create webhook for gitlab, it will be if someone can provide me sample request.


ravbaker
2019-04-19 13:15
@bethskurrie hi! I?ve just made a PR that fixes merging of pacts when they have the v2/v3 way of naming `providerState` https://github.com/pact-foundation/pact_broker/pull/269 Please review and incorporate in next release if no objections. We have been using this as a fix in forked version of pact_broker for some time without any issues in my current project. I?m also open for discussion if something is unclear.

vaso.giamarelou
2019-04-20 11:43
has joined #pact-broker

bheemreddy181
2019-04-22 01:38
Is it recommended to trigger the Travis CI or CIRCLE CI job of provider when we write webhooks from Consumer Side or Create a specific job on Jenkins which just does pact:verify , rather if we trigger Travis CI Job it might trigger the functional tests and unit tests etc as well @bethskurrie @matt.fellows ?

bheemreddy181
2019-04-22 01:39
The wait time from Travis CI job might be more compared to the time taken by the jenkins job which just does pact:verify ?

bethskurrie
2019-04-22 01:39
Personally, I'd just make a separate job that did the pact:verify, so as to get quicker feedback.

bethskurrie
2019-04-22 01:40
But of course, you'd want the pact:verify to also run during the normal build of the provider too.

bethskurrie
2019-04-22 01:40
Remember, if the pact hasn't changed, it's "pre-verified" in the broker, and no webhook gets triggered.

matt.fellows
2019-04-22 01:43
I don't really like triggering the provider builds from a consumer publish, and tend not to need it. Occasionally you push a change on the consider that requires waiting for a provider build and we just handle it by talking to the teams. This problem will be improved with the upcoming WIP pacts feature also

matt.fellows
2019-04-22 01:43
Simpler is better here IMO

bheemreddy181
2019-04-22 01:44
Makes sense :slightly_smiling_face:

bheemreddy181
2019-04-22 01:48
@bethskurrie Does *last published pact* change each time I publish a new pact but it is the same as the previous pact - I don't see a change in there until unless I change the expectations - if the expectations are not changed then it shows way older value?

matt.fellows
2019-04-22 02:21
That sounds correct - there is no _new_ published pact, just the same one published again

matt.fellows
2019-04-22 02:22
so no, the *last published pact* doesn?t change if you keep pushing the same contract up

bethskurrie
2019-04-22 02:28
It probably uses the date of the content, rather than the publication.

bheemreddy181
2019-04-22 02:40
but doesn't we have to update the latest date there so that we will know that the pact published but don't trigger the webhooks because the content didn?t change ?

bethskurrie
2019-04-22 02:49
If you're in doubt about anything, look at the matrix page

bethskurrie
2019-04-22 02:49
It has every pact publication and verification.

bheemreddy181
2019-04-22 02:51
you mean matrix shows the latest date ?

bethskurrie
2019-04-22 02:51
The top row

bethskurrie
2019-04-22 02:52
Will have the date that the most recent pact was published

bheemreddy181
2019-04-22 03:06
@bethskurrie It doesn?t actually i published two pacts within a time difference of 2 mins, I only see one which was published 2 mins ago

bheemreddy181
2019-04-22 04:07
I published 10 pacts in last one hour -- i only see one which is published one hour ago

bethskurrie
2019-04-22 04:46
Did they have the same consumer version number?

bethskurrie
2019-04-22 04:47
What is the output from the publishing logs? You can turn on verbose output.

bethskurrie
2019-04-22 05:02
So, if you publish with the exact same consumer version number and the same content, no new resource gets created.

bethskurrie
2019-04-22 05:04
If you publish a pact with the same content, but a different consumer version number, you'll see a new line in the matrix, but no webhooks will be triggered. If you publish content that has changed, and a new consumer version number, you'll see a new line in be matrix, and the webhooks will be triggered.

bheemreddy181
2019-04-22 12:56
They have the same consumer version and same content

bheemreddy181
2019-04-22 14:24
I agree that no new resource would get created but why not the *last published pact* value doesn't change ?

bheemreddy181
2019-04-22 14:55
@bethskurrie ^

bethskurrie
2019-04-22 20:09
It was an arbitrary decision that could have gone either way. The underlying pact publication database row is designed to be immutable, and so only has a created date, not an updated date.

bethskurrie
2019-04-22 20:10
I could add an updated date column, and set it if an identical request came in.

bethskurrie
2019-04-22 20:11
Nobody has actually raised it before. I think it's probably only relevant when you're messing around. Usually, the consumer version number will change with each build and that means the last published date should change. I'll double check which column it's using @bheemreddy181

bheemreddy181
2019-04-22 21:04
Sure thanks, Beth.

alexei
2019-04-23 10:27
has joined #pact-broker

vitaliy.grigoruk
2019-04-24 12:21
Hi folks. I have couple of pact publishing failures today. ``` [2019-04-24T10:30:36.020Z] ERROR: pact-node@6.21.5/112 on 7758fa148fa7: Could not publish pact: Failed to publish consumer/provider pact due to error: PactBroker::Client::Error - <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> </body> </html> ``` Wondering if anybody else seeing the same.

vitaliy.grigoruk
2019-04-24 13:03
I?d also like to talk about future pricing of https://pact.dius.com.au/ Who would be the best contact person?

matt.fellows
2019-04-24 22:25
Hi @vitaliy.grigoruk, I'll dm you

matt.fellows
2019-04-24 22:26
We did see a few issues last night that resolved fairly quickly, let us know if you do have any further issues

bethskurrie
2019-04-24 22:49
@bheemreddy181 how are you going?

bheemreddy181
2019-04-24 22:51
Thanks for checking back , I haven?t got time to check the things what you mentioned last time I am yet to complete the POC ( working one ) for demo at our company

bethskurrie
2019-04-24 22:52
cool. let us know how you go!

bheemreddy181
2019-04-24 22:55
Sure

bheemreddy181
2019-04-24 22:55
The documentation you mentioned last time is not clear enough to understand for verifying pact from pact broker

bheemreddy181
2019-04-24 22:56
The version stuff and all

bheemreddy181
2019-04-24 22:56
I might need some more inputs

bheemreddy181
2019-04-24 22:56
Will let you know

bethskurrie
2019-04-24 22:56
You don't give it a version - you tell it to verify the latest version.

bethskurrie
2019-04-24 22:56
The broker knows which the latest version is.

bethskurrie
2019-04-24 22:56
(the one that was most recently published)

bheemreddy181
2019-04-24 22:57
I have quick question here - how do I check the optional field types while contract testing

bheemreddy181
2019-04-24 22:57
What if my provider has changed the optional type from string to int

bethskurrie
2019-04-24 22:57
that's the point - you find out the breaking changes in the test.

bheemreddy181
2019-04-24 22:57
I am trying fix this into a real use case

bethskurrie
2019-04-24 22:57
the point is not to stop the tests ever failing - the point is to have them fail up front.

bethskurrie
2019-04-24 22:57
your tests are the canary.

bethskurrie
2019-04-24 22:58
you find out *before* you deploy.

bethskurrie
2019-04-24 22:58
they can and should fail at some point.

bheemreddy181
2019-04-24 22:58
Yes true that I should write test for pieces what I send rather than writing for everything you mean ?

bheemreddy181
2019-04-24 22:59
Rather before deploy before even merge to master

bheemreddy181
2019-04-24 22:59
I want the feedback on my PR itself

bethskurrie
2019-04-24 22:59
the pact tests should run just after your unit tests.

bethskurrie
2019-04-24 22:59
yes, they should run before you merge the PR.

bheemreddy181
2019-04-24 23:00
Agree

bethskurrie
2019-04-24 23:00
They should run before you ever deploy.

bheemreddy181
2019-04-24 23:00
One more thing if have my own verification task I set to the latest rather than version as you said

bethskurrie
2019-04-24 23:01
If you have integration tests that require you to deploy to a test environment, they should definitely be run before then. They should fail if something has changed, so that you don't even deploy a broken integration.

bethskurrie
2019-04-24 23:01
quick feedback.

bheemreddy181
2019-04-24 23:01
In that case my pact_helper will not have the pact_uri ?

bethskurrie
2019-04-24 23:01
you should give it the broker details

bethskurrie
2019-04-24 23:01
it will work out what pacts to pull in based on the provider name.

bethskurrie
2019-04-24 23:02
best practice is to manage your versions with tags - let me find you some links.



bheemreddy181
2019-04-24 23:04
What do you mean by tags ?

bethskurrie
2019-04-24 23:04
Please read the docs!

bheemreddy181
2019-04-24 23:04
My versioning would be a commit hash

bheemreddy181
2019-04-24 23:04
Sure will take a look

bethskurrie
2019-04-24 23:04
If you haven't come across tags by now, you're missing a critical part, and there's more reading to do.

bethskurrie
2019-04-24 23:04
Please do read those two links I pasted above.

bheemreddy181
2019-04-24 23:04
Oh I see makes sense

bheemreddy181
2019-04-25 03:54
Out of the below 4 links apart from docker pact broker everything else is returning 404 just fyi


bethskurrie
2019-04-25 04:14
yeah, that link is broken

bethskurrie
2019-04-25 04:14
send me the parent link and i'll fix it.

bethskurrie
2019-04-25 04:16
ok, found it

bethskurrie
2019-04-25 04:19
they should be updated in the gitbook soon

yousafn
2019-04-26 09:36
Hey all, Been messing about with AWS Lambda recently, and have managed to get the pact-broker running in a lambda function. I have a repo here https://github.com/YOU54F/pact_broker-serverless The lambda based pact broker can be visited on https://you54f.co.uk/ I will be doing a blog write up in the next week, but for now, enjoy :ok_hand:

bethskurrie
2019-04-26 09:41
Ha! @matt.fellows has been trying to talk me into this for ages.

bethskurrie
2019-04-26 09:41
My concern was slow load times. How have you found it?

yousafn
2019-04-26 09:45
It?s pretty decent tbh, so much quicker than heroku that?s for sure. (mind you, my heroku instance is running passenger standalone) I need to hook it up with a CI pipeline later on today on one of my pact example repos so I can push pacts, perform webhooks and verifications and make sure everything is working as intended

matt.fellows
2019-04-26 09:47
Background processes won't work, and some other things won't will need to change but that's great!

bethskurrie
2019-04-26 09:48
Hm. The webooks are executed in an async way.

yousafn
2019-04-26 09:48
This is load times on pact-broker hosted on an ECS instance for info

bethskurrie
2019-04-26 09:48
You may hit difficulties with that.

bethskurrie
2019-04-26 09:50
Nice load times.

yousafn
2019-04-26 09:50
I imagine it is going to be a painful process, especially as it wasn?t designed to run in a lambda, but I?m not planning on running this in prod for work, it was more for my experimentation with AWS lambda, and being able to understand it?s limitations. Will keep you lot posted anyhoo

yousafn
2019-04-26 12:01
publishing, slack webhooks (contract_content_changed & provider_verification_published) and verification seem to working a-ok! :party_parrot:

thadir
2019-04-26 15:11
Is there any good documentation on creating custom webhooks. I want to when the broker sees that the consumer changed the contract that the broker triggers our build server.Any one experiance with this?


kgrabowski
2019-04-27 09:04
has joined #pact-broker

bethskurrie
2019-04-28 02:35
we're doing some upgrades to the DiUS hosted broker folks. There will be some downtime on this one, but we should be back up and running within an hour. You can follow the status on http://status.pact.dius.com.au/

ashish.dubey91
2019-04-28 05:22
curious how?s the infrastructure fairing now overall? I remember there were issues few months ago which led us to setup our own broker

bethskurrie
2019-04-28 05:22
We should have a no downtime deployments env now.

bethskurrie
2019-04-28 05:23
We've had a massive improvement in reliability

bethskurrie
2019-04-28 05:24
We rearchitected the whole platform.

bethskurrie
2019-04-28 05:25
Today's deployment was some fine tuning of our resources.

matt.fellows
2019-04-28 07:50
++ security

bethskurrie
2019-04-28 08:04
We've WAFed it up recently.

matt.fellows
2019-04-28 08:20
There was a little patch right before Xmas that was rough

matt.fellows
2019-04-28 08:20
But since the new stack switch it's been great

matt.fellows
2019-04-28 08:20
Woukd you consider moving?

kevin.meiresonne
2019-04-29 12:35
Hi, we're getting slow responses and 502's on the hosted pact broker. Is there maintenance going on? Status page doesn't say so.

matt.fellows
2019-04-29 12:37
No, that is news to me

matt.fellows
2019-04-29 12:37
I?ll check dashboards, but no alarms have gone off

kevin.meiresonne
2019-04-29 12:42
Seems to be working again now

kevin.meiresonne
2019-04-29 12:42
maybe a glitch

matt.fellows
2019-04-29 12:44
I?ll be around for a few hours prepping for the AWS Summit, so ping me if you have issues

matt.fellows
2019-04-29 12:44
I?m not seeing any 502s in our logs, strangely

kevin.meiresonne
2019-04-29 12:45
hmm

matt.fellows
2019-04-29 12:45
That could be Humio delaying ingest or something

matt.fellows
2019-04-29 12:46
hmm no Humio seems up to date

kevin.meiresonne
2019-04-29 12:46
non technical question: does dius/pact have official logo's that can be used? I'm working on a slack webhook, and was wondering if I could use a proper pact logo for it


matt.fellows
2019-04-29 12:47
Not DiUS but official Pact ones

kevin.meiresonne
2019-04-29 12:47
excellent!

matt.fellows
2019-04-29 12:48
I?ll keep an eye on the broker

matt.fellows
2019-04-29 12:52
It looks like there might have been a garbage collection like event on RDS around that time. Average requests went up to 1.9s (around 10:30 local time, so 22 mins ago)

kevin.meiresonne
2019-04-29 13:19
Just got another 502

kevin.meiresonne
2019-04-29 13:19
after a refresh it was gone

matt.fellows
2019-04-29 13:20
I just got a notice of the same, investigating

matt.fellows
2019-04-29 13:20
nothing obvious causing it (CPU/mem/load etc.), so keen to see why

s1apped
2019-04-29 13:27
has joined #pact-broker

s1apped
2019-04-29 13:46
if I have a webhook with event = contract_content_changed, both consumer and provied version is commit sha and consumer is tagged with branch name

s1apped
2019-04-29 13:47
should this webhook trigger provider build even though the contract didn't change?

matt.fellows
2019-04-29 13:49
I don?t believe so, no


s1apped
2019-04-29 13:58
I double checked everything and don't see where I could make a mistake

matt.fellows
2019-04-29 14:01
thanks Matthew, we?ll get it looked at in due course

s1apped
2019-04-29 14:03
thank you

matt.fellows
2019-04-29 14:14
you?re welcome

vinod.baradwaj
2019-04-30 06:23
through pack-broker API's can we get list of providers for one particular consumer ?

bethskurrie
2019-04-30 06:26
you can if you don't mind filtering the output

bethskurrie
2019-04-30 06:27
If you use the "/pacts/latest" URL, you can match by consumer name

vinod.baradwaj
2019-04-30 06:30
thanks Beth.. :+1:

bheemreddy181
2019-05-01 03:52
So @bethskurrie I did read through tags part now I am clear on that - but we are not yet in place of implementing a feature branch but we merge everything into master as a dark release

james.carman
2019-05-01 19:11
is there a ?global? badge for a provider that means ?all pacts verified??

james.carman
2019-05-01 19:11
I see one for the consumer/provider pair

james.carman
2019-05-01 19:11
Or, is the idea that you?d put a badge for each provider you consume from on your consumer README?

vitaliy.grigoruk
2019-05-01 19:45
Hey folks, I have a question for people who?re using broker webhooks to trigger provider verifications when consumer contract is changed. How do you make your provider verification CI job to verify only changed contract ? Right now, my provider verification job verifies contracts from all consumers that have same tag. For example: - there is 1 provider and 3 consumers. - git branch name is used to tag contracts. - consumer#1 contract changes for master build and it is published to a broker. - broker webhook triggers provider verification CI job and passes `CONSUMER_VERSION_TAG=master` as build param - `pact-provider-verifier` is invoked with `--consumer-version-tag master` arg. As a result, provider verification CI job will fetch contracts from all 3 consumers instead of a contract that has been changed recently. It feels like `pact-provider-verifier` is missing an optional arg `--consumer`, so it will be possible to filter contracts by consumer name (if provided)

bethskurrie
2019-05-01 23:12
The webhook payload can be templated. You can pass the url of the contract that has just been published to the ci job, and if you can parse the parameters, you can then pass that url to the verification job.

bethskurrie
2019-05-01 23:13
It will be a different command than the one you use as part of your default verification job, where you would just give the name of the provider and it would fetch all the pacts based on the name. You'll need to use the format where you pass in a specific URL.

vitaliy.grigoruk
2019-05-02 05:34
how do I pass pact broker credentials in this case?

bethskurrie
2019-05-02 05:35
same args

bethskurrie
2019-05-02 05:35
just don't give it the provider name

bethskurrie
2019-05-02 05:35
pact-provider-verifier http://the-pact-that-changed --broker-username ... --broker-password ...

vitaliy.grigoruk
2019-05-02 05:36
great, thanks! I?ll try that

vitaliy.grigoruk
2019-05-02 05:36
worse documenting somewhere :slightly_smiling_face:

bethskurrie
2019-05-02 05:36
yes, when I answered your question I realised it wasn't written anywhere.

bethskurrie
2019-05-02 05:36
what docs have you been reading to set up the webhooks?

bethskurrie
2019-05-02 05:36
just trying to think where to put it.

bethskurrie
2019-05-02 05:37
I mean, the CLI args are documened in the github auth, and if you use --help

bethskurrie
2019-05-02 05:37
but this particular usage is not explained.


bethskurrie
2019-05-02 07:15
The problem is, there are so many different pact languages that someone might verify in, it's hard to know what docs to put where.

bethskurrie
2019-05-02 07:15
@uglyog in the pact-jvm impl, is it possible to set up a pact verification task (separate from the default one) that just accepts one pact URL and broker creds?

uglyog
2019-05-02 07:18
Yes, should work with Gradle or Maven

bethskurrie
2019-05-02 07:19
cool. I'll add some docs saying that you can configure your job to just accept the changed pact, and say "see the docs for your verification task" because we don't want to have that repeated all over the place.

bethskurrie
2019-05-02 07:34
I've updated this @vitaliy.grigoruk. Does that explain it clearly enough? https://github.com/pact-foundation/pact_broker/wiki/Webhooks#provider-ci

vitaliy.grigoruk
2019-05-02 07:57
looks great, thanks

bart.schotten
2019-05-02 10:47
has joined #pact-broker

bart.schotten
2019-05-02 10:54
Question: When you have a pacticipant A that is both a consumer of events of pacticipant B, *and* a consumer of an API of pacticipant B, it seems that you would have two contracts between the same consumer and provider (at least based on how it's now being implemented for pact-net. Is there a way for the Pact Broker to deal with this, or can it only deal with one contract per consumer-provider pair? A possible workaround would be to give the consumer or provider a slightly different name or something, but that's a bit nasty.

bethskurrie
2019-05-02 11:00
Sorry, there's no way apart from a separate name at the moment.

ian.mcwilliams
2019-05-02 11:01
i'll be hitting this issue in the near future - so pactSetup.js lets you set the provider info and it seems you can only set one consumer and provider, right? what if you are consuming from more than one provider?

ian.mcwilliams
2019-05-02 11:01
```global.provider = new Pact({ consumer: 'my-system', provider: 'some-provider', port: global.port, log: path.resolve(__dirname, '../', 'logs', 'mockserver-integration.log'), dir: path.resolve(__dirname, '../', 'pacts'), spec: 2, cors: true, pactfileWriteMode: 'update', });```

bethskurrie
2019-05-02 11:01
You make a separate pact with that provider.

bethskurrie
2019-05-02 11:02
Same consumer name, different provider name, different port.

bethskurrie
2019-05-02 11:03
It's not going to be something that will get picked up immediately, but you can raise an issue for a future feature request.

ian.mcwilliams
2019-05-02 11:03
does global.provider become an array of Pact objects?

bethskurrie
2019-05-02 11:03
You need to assign it to a different name

bethskurrie
2019-05-02 11:04
They're managed independently.

ian.mcwilliams
2019-05-02 11:04
as in, you need a different setup file altogether?

ian.mcwilliams
2019-05-02 11:04
one per provider?

bethskurrie
2019-05-02 11:08
No, why?

bethskurrie
2019-05-02 11:09
Can't you assign more than one thing to global?

bethskurrie
2019-05-02 11:10
(I'm not really a js person, can you tell?!)

ian.mcwilliams
2019-05-02 11:13
i don't think anyone's _really_ a js person :wink: no i think it's just understanding how to separate the two, for example it could be that global.provider contains an array of Pact objects, or it could be that we have `global.provider_a` and `global.provider_b`, each containing a Pact object - i'm not sure how the pactfile job identifies relevant Pact objects so whatever we do needs to just be in line with how that job works

bethskurrie
2019-05-02 11:13
The second example is how to set it up

ian.mcwilliams
2019-05-02 11:15
ok great, thanks! hopefully @matt.fellows can help with the CI issue, if i can get that working for us then i'll quickly be onto multiple providers :+1::blush:

bethskurrie
2019-05-02 11:15
Then you just make sure that file is required before any of your pact tests

ian.mcwilliams
2019-05-02 11:16
yep that part is certainly no problem :wink:

matt.fellows
2019-05-02 11:17
I?ll be looking shortly at that issue Ian - I?m at the AWS Summit and the lights at my desk stopped working. Moving things around so that I can comfortably work :slightly_smiling_face:

bethskurrie
2019-05-02 11:18
Clarification. The lights at the summit worked fine - it's the lights on his hotel that aren't working!

matt.fellows
2019-05-02 11:20
:point_up: yes that

matt.fellows
2019-05-02 11:20
the Summit was very well organised

matt.fellows
2019-05-02 11:20
can?t brain now, so don?t expect amazing problem solving skills from me :slightly_smiling_face:

ian.mcwilliams
2019-05-02 11:21
yeah, i guess light can be considered a vital pre-requisite :laughing: cheers matt, i'll be in a meeting or two but otherwise around if there's anything i can try or info i can provide :+1:

bart.schotten
2019-05-02 11:42
Alright, thanks for clearing it up

detert
2019-05-06 07:01
has joined #pact-broker

vitaliy.grigoruk
2019-05-07 08:56
Hey folks. Does anybody use pack broker webhooks for posting status checks to consumer github commits? I?m triggering 2 provider verifications jobs (using code from master and release branches, that correspond to staging and production environments) every time consumer contract is updated on a broker. The question is: - how can I pass a link to provider CI build when verification results are published to a broker and then pass it to github status (so when I click on the link in github status check -> I got redirected to provider CI build URL instead of pact broker verification results URL). I guess that support for this should be implemented in both pact broker as well as client libraries. Right now I don?t have a possibility to trace provider verification results in pact broker to a URL of provider CI build that generated those results

bethskurrie
2019-05-07 08:57
The underlying API supports it, but I don't think it's currently used in the clients.

bethskurrie
2019-05-07 08:58
Which impl are you using?

vitaliy.grigoruk
2019-05-07 08:58
pact-js

bethskurrie
2019-05-07 08:59
Raise an issue in pact provider verifier to be able to provide the CI link via the CLI verify call.

vitaliy.grigoruk
2019-05-07 09:00
:+1: will create an issue and make a PR

vitaliy.grigoruk
2019-05-07 09:00
thanks

matt.fellows
2019-05-07 10:30
Thanks!

vitaliy.grigoruk
2019-05-07 11:24
Hi @bethskurrie. I?ve implemented it according to your suggestion, but now provider verification results are not posted back to pact broker?

bethskurrie
2019-05-07 11:52
Are you passing the right things in? It needs the provider version number, and the flag to publish the results has to be turned on.

bethskurrie
2019-05-07 11:54
It's the same underlying code, no matter how it gets the link, so if it's not publishing the verification, it's because something is not being passed in the same way. It might be a bug in the js wrapper code.

vitaliy.grigoruk
2019-05-07 12:37
I?ll keep digging then

vitaliy.grigoruk
2019-05-07 12:59
omg? there was a small typo in my code. Hate vanilla js sometimes

vitaliy.grigoruk
2019-05-07 12:59
thanks for hints, Beth

rune
2019-05-08 07:00
has joined #pact-broker

bethskurrie
2019-05-08 07:08
Do you use feature toggles @bheemreddy181? You can use the feature toggles as tag names, and generate a different contract by turning the feature toggle on.

nick.karamaniolas
2019-05-08 10:32
has joined #pact-broker

james.hattersley-dyke
2019-05-09 11:14
has joined #pact-broker

james.prescott
2019-05-10 08:40
has joined #pact-broker

mtissot79
2019-05-10 14:39
has joined #pact-broker

mtissot79
2019-05-10 14:42
Hi pact. I need the new docker image that can be run without root permissions, as the kubernetes instance on which I try to deploy does not allow root deployment. But I can not find this image on docker registry. Could you please tell me where can I find it? Thx so much

yousafn
2019-05-10 14:47
There is a link on the repo https://github.com/pact-foundation/pact-broker-docker https://hub.docker.com/r/pactfoundation/pact-broker/ but note the image is currently tagged as `edge`

brwhaley
2019-05-11 01:27
has joined #pact-broker

mtissot79
2019-05-11 14:37
Thank for the feedback. I ll try this image on Monday

bethskurrie
2019-05-12 23:39
@mtissot79 we're expecting that this will be the new standard Pact Broker deployment image, but as this particular deployment configuration is quite new, we're just making sure people know this before they use it. So far, nobody has reported any issues, and it's been out for a few weeks.

james.hattersley-dyke
2019-05-13 10:48
Hi, I'm using the broker and can-i-deploy but there's no option on the cli for a token? Only username and password?

james.hattersley-dyke
2019-05-13 10:49
i've tried `--token` and `--broker-token`

james.hattersley-dyke
2019-05-13 10:49
nothing documented in the `can-i-deploy --help` either :disappointed:

james.hattersley-dyke
2019-05-13 10:52
It's the cli embedded in pact-js if that helps

james.hattersley-dyke
2019-05-13 10:53
v8.2.0

matt.fellows
2019-05-13 11:13
Ah, that may not be in the Node JS client yet

matt.fellows
2019-05-13 11:13
Let me take a look


matt.fellows
2019-05-13 11:25
OK yep just missing the flag - should be a new release out in 30 mins @james.hattersley-dyke


james.hattersley-dyke
2019-05-13 13:16
awesome thanks Matt!

asite-rshah
2019-05-14 09:48
has joined #pact-broker

christophe.leray
2019-05-14 15:46
has joined #pact-broker

scott.riley111
2019-05-14 17:03
has joined #pact-broker

matt.fellows
2019-05-15 05:38
we?ve been discussing the pros/cons of having a hosted mock service (stub in Pact parlance) as part of http://pactflow.io. One the one hand, it wouldn?t be a huge amount of work to have any contract become an instant ?mock server? on the other you can already do it via CLI tools like the pact-stub-server at https://github.com/pact-foundation/pact-ruby-standalone/releases . Is this something people would find useful? If so, why?

kristofer.landgren
2019-05-15 07:26
has joined #pact-broker

franklin.huynh
2019-05-15 08:43
hello @matt.fellows I'm proposing the team (5 users) plan for my company as you my know. I'm getting some questions - Will it limit our developers to access to pact broker. - What will happen if there are many people login to pact broker at the same time? - What the meaning of "user" here? For example, the contract publish by user a. Will other user be able to see the contract? - What will happen if the pact broker is unavailable? Will we have a timely support only with chat and email? Could you help me with these questions?

vk.regs
2019-05-15 09:20
has joined #pact-broker

matt.fellows
2019-05-15 09:20
Hi @franklin.huynh, i?ll try to answer your questions A user is considered any person / system that requires independent access to the broker. For example, if you have a User that will be logging into the UI they will need their own user. Each user gets a single readonly and read-write API token that can be used for automation (e.g. CI or local verification). You probably only need 1 user seat per human logging into the UI. Readonly tokens can be generated for use by team members that don?t need UI access.

heymega
2019-05-15 09:21
@matt.fellows I'm just looking at PactFlow and I'm a little confused Is PactFlow just a managed broker? If so, how does it differ from the existing broker we've come to know and love?

vk.regs
2019-05-15 09:21
Hi I want to use pact files from pact broker for pact stub. Is it possible to get link to pact files in part broker?

matt.fellows
2019-05-15 09:21
> What will happen if there are many people login to pact broker at the same time? At the moment, the limit is absolute, not concurrent. So if you have more than 5 users needing access but not at the same time, this will exceed the limit

bethskurrie
2019-05-15 09:22
Yes

bethskurrie
2019-05-15 09:22
If you want to hand craft it, it will look something like `http://BROKER/pacts/provider/PROVIDER/consumer/CONSUMER/latest`



bethskurrie
2019-05-15 09:23
yup

vk.regs
2019-05-15 09:23
Bu it is looks like web page

bethskurrie
2019-05-15 09:24
curl it

vk.regs
2019-05-15 09:24
stun can undestand it?

vk.regs
2019-05-15 09:24
ok, thanks

bethskurrie
2019-05-15 09:24
you get the content type you ask for

vk.regs
2019-05-15 09:24
is it possible to get all files by one link?

bethskurrie
2019-05-15 09:24
if you open it in a browser, you get an HTML rendering. If you use the header "Accept: application/hal+json" you get the JSON

bethskurrie
2019-05-15 09:24
No, they're separate.

matt.fellows
2019-05-15 09:24
> What will happen if the pact broker is unavailable? Will we have a timely support only with chat and email? We provide email support for this tier and are implementing chat very soon. We typically respond within a few hours AEST. Our SLAs are documented in the T&Cs. As for downtime, we have invested a lot this year into the resilience and security of our infrastructure. We have zero downtime deployments and will give you at least 48 hours notice.

bethskurrie
2019-05-15 09:25
You can get all the urls for the pacts for a provider though.

matt.fellows
2019-05-15 09:26
The TL;DR is that the Developer and Team plans are hardened, highly available and secured variants of the open source broker. They have social integration (e.g. GitHub), API tokens and also a new UX

matt.fellows
2019-05-15 09:27
The business tier (which is not generally available) is where we are adding features that are _not_ Pact specific - e.g. Swagger / OAS integration

heymega
2019-05-15 09:28
You had me at "new UI" :joy:

heymega
2019-05-15 09:28
So the API endpoints are exactly the same PactFlow?

vk.regs
2019-05-15 09:29
Thanks

bethskurrie
2019-05-15 09:29
yes

heymega
2019-05-15 09:29
Also with it being managed would you provide upgrades as new version of the specification change?

bethskurrie
2019-05-15 09:29
they'll be interoperatble for all existing functionality

vk.regs
2019-05-15 09:30
One more general question: what is the best practice prepare pact files for pact stub (manually, may be some generator exists)?

bethskurrie
2019-05-15 09:30
The broker actually doesn't care about the specification version.

bethskurrie
2019-05-15 09:30
The pacts are a black box - you can actually publish any json contract.

bethskurrie
2019-05-15 09:31
Well, to be exact, the HTML rendering of the pact cares about the spec version, but if it can't parse it, it just displays the JSON.

matt.fellows
2019-05-15 09:31
But you can assume the broker will update as new changes make their way into the OSS broker. I don?t have the numbers, but I would suggest we release updates multiple times a week at a _minimum_

bethskurrie
2019-05-15 09:31
But yes, pactflow will always have the latest version of the Pact Broker code.

bethskurrie
2019-05-15 09:31
In fact, sometimes it has the code before the OSS codebase, because I'll try things out in pactflow before I do an official release of the OSS code :wink:

heymega
2019-05-15 09:32
Cool. Are the API calls still protected by basic auth or is now using something like bearer tokens?

franklin.huynh
2019-05-15 09:32
thanks Matt. Could you explain this a bit ``` So if you have more than 5 users needing access but not at the same time, this will exceed the limit ```

franklin.huynh
2019-05-15 09:33
what do you mean by this?

matt.fellows
2019-05-15 09:33
bearer tokens

franklin.huynh
2019-05-15 09:34
- Do you mean 5 users using 1 credential? - How can it still exceed the limit if they are not accessing at the same time?

matt.fellows
2019-05-15 09:35
Each User that requires access to the UI should have their own username/password

heymega
2019-05-15 09:35
Sweet! Last question before I try and steal my boss' credit card. I work for a registered charity in the UK in the education sector. Do you offer discounts?

matt.fellows
2019-05-15 09:35
> Do you mean 5 users using 1 credential? No - we wouldn?t recommend that sort of security practice

franklin.huynh
2019-05-15 09:36
it means I will have 5 credentails, right?

matt.fellows
2019-05-15 09:36
Yep!

franklin.huynh
2019-05-15 09:37
and each user can generate the token to use in term of Readonly and read-write permission?

matt.fellows
2019-05-15 09:37
There would be 5 users registered in the system, each with their own set of credentials to authenticate (or users registered through Social login via GitHub). Each user can also create API tokens for automation

franklin.huynh
2019-05-15 09:37
understood

franklin.huynh
2019-05-15 09:38
so if I understand correctly, the participants of a user will not be accessible by other users

franklin.huynh
2019-05-15 09:38
is that correct?

franklin.huynh
2019-05-15 09:38
let me clarify my question

franklin.huynh
2019-05-15 09:38
by this example

matt.fellows
2019-05-15 09:42
We haven?t had that question yet - but let?s chat offline. Can you contact us at ? If you send us what you need (i.e. number of users and anything else that comes to mind) we?ll work something out.

heymega
2019-05-15 09:43
:thumbsup:

matt.fellows
2019-05-15 09:43
:thumbsup:

richard.peckett
2019-05-15 09:57
peeps, it looks like a pull request has been completed for AMQP for Neil's pact dot net implementation; assuming will this play nicely with the new broker? :smile:

richard.peckett
2019-05-15 09:57
correction, it still looks like it's open my bad :neutral_face:


bethskurrie
2019-05-15 09:58
Yes, it will play nicely because it's the same underlying code as the JS

bethskurrie
2019-05-15 09:58
Unless someone has gone and implemented it separately...

richard.peckett
2019-05-15 09:58
awesome cheers Beth

bethskurrie
2019-05-15 09:59
hm... it may be a native impl

bethskurrie
2019-05-15 10:00
It looks like it might be a custom job

bethskurrie
2019-05-15 10:02
I wish people would talk to us first!

richard.peckett
2019-05-15 10:05
oh bollocks haha

richard.peckett
2019-05-15 10:06
I was going to have a play with this this afternoon by just signing up for your free tier pact flow broker

bethskurrie
2019-05-15 10:06
js and pact-jvm support messages

matt.fellows
2019-05-15 10:07
If it is still producing the correct pact files publishing shouldn't be hard though

matt.fellows
2019-05-15 11:37
No there is no generator. The contracts are generated by the pact tests themselves

matt.fellows
2019-05-15 11:39
Sorry had to do the bed time routine.

matt.fellows
2019-05-15 11:40
See how you go. In theory there's no reason why it can't work with the broker, even if not using the implementation in Ruby/JS etc

matt.fellows
2019-05-15 11:41
As long as you can pull in and publish the contracts independently it should be ok - we have CLI tools to communicate with the broker and then Pact Net can do the bits in between

phall
2019-05-15 13:01
has joined #pact-broker

franklin.huynh
2019-05-16 03:58
Hi, do you guys have example for webhook for trigger bitbucket pipeline

matt.fellows
2019-05-16 03:59
I haven?t seen one myself, but if you get it working, we?d love to see it make its way to https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library :pray:

franklin.huynh
2019-05-16 05:31
Please ignore my question, I already found the solution ~hey @matt.fellows I'm trying debugging about the webhook stuff. But I receieve this message~ ``` "message": "For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information." ``` ~I'm running docker-compose up on my local for testing but could not enable the whitelist. I update the docker-compose.yml as below but still not able to see the error message. Could you please help me?~ ``` version: "3" services: postgres: image: postgres healthcheck: test: psql postgres --command "select 1" -U postgres ports: - "5432:5432" environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_DB: postgres broker_app: image: dius/pact-broker links: - postgres # If you remove nginx, enable the following ports: - "80:80" environment: PACT_BROKER_DATABASE_USERNAME: postgres PACT_BROKER_DATABASE_PASSWORD: password PACT_BROKER_DATABASE_HOST: postgres PACT_BROKER_DATABASE_NAME: postgres webhook_host_whitelist: http://api.bitbucket.org # Nginx is not necessary, but demonstrates how # one might use a reverse proxy in front of the broker, # and includes the use of a self-signed TLS certificate # nginx: # image: nginx:alpine # links: # - broker_app:broker # volumes: # - ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro # - ./ssl:/etc/nginx/ssl # ports: # - "8443:443" # - "80:80" ```

franklin.huynh
2019-05-16 05:33
~I added the webhook_host_whitelist environment variable with the whitelist host~

mtissot79
2019-05-16 08:35
Hi Beth The docker image works now but I met some troubles with the security policy that my company put in kubernetes. The security policy don't allow root user or user without uid. I pulled the code from git and change a little bit the docker file: Add '-u 1000' in the useradd command Change the line 'USER ruby' to 'USER 1000' After repackaging the image, all works in k8. Maybe this could help you if other companies put this kind of policy in k8 Cheers Michael

bethskurrie
2019-05-16 08:35
Thanks. Is there any reason why we woulnd't put that in to the main code?

mtissot79
2019-05-16 11:31
First the user iud should be a parameter, and I m not a kubernetes policy expert. If a policy allow only user by username for exemple, the container will not start in k8 because of 'USER 1000'. Because I m lacking knowledge on that part, I can not submit my local modifications as a pull request.

shalygai.a
2019-05-16 11:47
has joined #pact-broker

bethskurrie
2019-05-16 12:35
Hm. OK. Maybe we could have a branch of the code and have a kubernetes tag.

arunkumarpoonia
2019-05-16 15:18
gelling below error on provide side :

arunkumarpoonia
2019-05-16 15:18
{ "rateBands": [ ... , - Pact::UnexpectedIndex, + Hash, ] }

arunkumarpoonia
2019-05-16 15:19
i am using docker image for verification

arunkumarpoonia
2019-05-16 15:21
any help will be appriciated

dagarwal
2019-05-16 16:20
when are you getting this error ?

dagarwal
2019-05-16 16:21
could you please share more information @arunkumarpoonia

bethskurrie
2019-05-16 22:07
@arunkumarpoonia the broker does not do any verification. It is a service for exchanging the contracts and the verification results. The problem you are having is during pact verification. If you look lower down in the error message you received, there is a list of the descriptions of the differences. It will include a message that says something like "array is too long". That is the problem. Your provider is return and array that is longer than the consumer expected. Your consumer should use an "each like" to say that they don't care how long the array is.

bethskurrie
2019-05-16 22:08
Hey @vitaliy.grigoruk I've updated the section in the Effective Pact Setup Guide on getting the builds set up. Can you tell me what you think of this section? https://docs.pact.io/best_practices/pact_nirvana#4-automate-the-contract-and-verification-results-exchange

heymega
2019-05-18 16:58
Couple of questions regarding PactFlows auth... I understand it supports bearer tokens. Is this using Oauth? If so, do you support non user grant types like client credentials grant? Sometimes a user won't be present especially when making calls in deployment pipelines. If not, are you planning on still supporting basic authentication alongside it?

matt.fellows
2019-05-18 22:41
The bearer token are simply API keys which can be generated by users. You can create read only and read write tokens

matt.fellows
2019-05-18 22:42
We actually support openid connect but have only inplemented GitHub (which is actually oauth2) at the moment as it was the most requested. We also support standard authentication via user/pass.

matt.fellows
2019-05-18 22:43
Basic auth is dead, because it's not ideal from a security perspective

matt.fellows
2019-05-18 22:46
Make sense?

heymega
2019-05-19 17:27
Kinda! So if these tokens need to be generated by users (by logging into GitHub), how do incorporate that into a build pipeline where a user context doesn't exist? Or are you saying we can generate long lived tokens after we've logged in? Github and Azure DevOps allow you to generate PAT (Personal Access Tokens) for this reason. Will the broker allow us to to generate these kinds of long lived tokens?

matt.fellows
2019-05-19 20:48
Yes exactly that.

matt.fellows
2019-05-19 20:48
The tokens live in the broker though, not any federated identity store

heymega
2019-05-20 08:28
Perfect, thank you.

matt.fellows
2019-05-20 08:28
:ok_hand:

vitaliy.grigoruk
2019-05-20 09:11
Hi everybody. I?ve set up pact broker webhook for github commit status https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status So the workflow looks the following way: 1. developer pushes a code change to a feature branch of consumer codebase. 2. consumer CI executes tests for that commit and uploads generated contract file to pact broker. 3. if published pact is different from latest one: a - pact broker executes a webhook that creates `pending` ?Pact verification? status for that github commit. b - pact broker executes a webhook that triggers provider?s CI job that verifies recently published contract. 4. provider?s CI job publishes verification results back to pact broker. 5. pact broker executes a webhook that updates consumer commit ?Pact verification? status to `passed` or `failed`. This workflow allows us to pre-verify contracts before consumer feature branches are merged into master. We use Github PRs that are merged only if all status checks are green. Github statuses for consumer commits work correctly when contract is changed (as in workflow described above). However, when it doesn?t change - there are no status checks created. I understand that new contract version inherits verification results from previous one if contract doesn?t change. It will be still nice to have a way to create a webhook event for the case when contract is published but content didn?t change. Then we can use this event to create status checks for consumer github commits even in cases if contract hasn?t changed. Any thoughts on this, @bethskurrie?

bethskurrie
2019-05-20 09:25
Firstly, that workflow is superb!

bethskurrie
2019-05-20 09:26
And secondly, yes, there is an event for pact published (rather than changed). You should use that for your github status updates. Have a look at the webhooks api docs, and you'll find it.

vitaliy.grigoruk
2019-05-20 09:54
I guess using `pact published` event instead of `pact changed` will help me to get commit statuses for all consumer commits. However, this means that provider verification CI job will be triggered every time when contract is published, rather than when contract is changed. It is fine for us for now, as we don?t have many services ?pactified?. But in a long term I?d like to avoid redundant provider verifications for the same pact contract. It would be cool if there are more events available to attach webhooks to. E.g. `contract_content_not_changed` or `provider_verification_inherited`

bethskurrie
2019-05-20 09:55
No... You have one webhook to trigger ci (pact changed) and one webhook for github statuses (pact published).

bethskurrie
2019-05-20 09:57
You won't get unnecessary ci triggers.

vitaliy.grigoruk
2019-05-20 10:06
hm? I think I know why it doesn?t work fo me? I?m triggering 2 provider verification jobs (one is running with latest `master ` branch, other with `release` branch, which correspond to `staging` and `production` provider versions). I?ve setup a webhook like this first: https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status and as a result I get 1 `pending` status check when new contract version is published with `context: api ` and then when both `staging` and `production` provider verifications are finished and results are published to a broker, I get 2 more statuses `context: api staging` and `context: api production`. However, pending status still remains?

vitaliy.grigoruk
2019-05-20 10:08
so, I split https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status webhook into 3: - 2 `contract_content_changed` webhooks that create `pending` status check for `context: api staging` and `context: api production` - 1 `provider_verification_published` webhook (same as in webhook library, but without `contract_content_changed` event.

arunkumarpoonia
2019-05-20 11:13
Hi,

arunkumarpoonia
2019-05-20 11:13
I am unable to create webhook for http url , Below error is returned :

arunkumarpoonia
2019-05-20 11:13
"scheme must be https. See /doc/webhooks#whitelist for more information."

arunkumarpoonia
2019-05-20 11:14
Is it possible to create webhook for http url, @bethskurrie can you help here pls ?

bethskurrie
2019-05-20 11:15
Did you read the docs @arunkumarpoonia?

bethskurrie
2019-05-20 11:15
The one referenced in the error message?

bethskurrie
2019-05-20 11:16
Are you using your own broker, or the DiUS hosted one?

arunkumarpoonia
2019-05-20 11:21
I am using my own broker

bethskurrie
2019-05-20 11:21
I'm still confused. You should only need 2 webhooks. One that updates github on contract published and provider verification published. And one that triggers the ci on contract content changed.

bethskurrie
2019-05-20 11:22
Can you go the the url on your own broker that the error message tells you to?

arunkumarpoonia
2019-05-20 11:26
Thanks Beth, Will take a look

bethskurrie
2019-05-20 11:26
Arun, is there a problem with that message?

bethskurrie
2019-05-20 11:27
"See /doc/webhooks#whitelist for more information."

bethskurrie
2019-05-20 11:27
Is it confusing because it's a relative link?

arunkumarpoonia
2019-05-20 11:29
its fine, i am able to see details on this screen - hal-browser/browser.html#/webhooks/provider/-test-API/consumer/test-UI


vitaliy.grigoruk
2019-05-20 11:30
yeah, this works well when I?m verifying contract with only one version of provider. When I?m triggering 2 CI provider verification jobs (master and release branches), this setup doesn?t work as desired. I?d like to get 2 statuses for each consumer github commit: - `provider release branch` - `provider master branch`

bethskurrie
2019-05-20 11:36
Isn't that what the provider tags in the context does?

bethskurrie
2019-05-20 11:37
Which pending status still remains?

bethskurrie
2019-05-20 11:38
Maybe you could take a series of screenshots of the github PR statuses for me, and send me the json for the webhooks you're working on, and I'll see if I can nut it out.

bethskurrie
2019-05-20 11:40
I've got to go to bed ( :flag-au:) but send what you can to and I'll have a look in the morning.

vitaliy.grigoruk
2019-05-20 12:02
:+1:

vitaliy.grigoruk
2019-05-20 20:45
I?ve decided it would be better to make it publicly available instead @bethskurrie

franklin.huynh
2019-05-21 00:18
Added

matt.fellows
2019-05-21 00:23
Thanks man!

jinal
2019-05-21 05:56
has joined #pact-broker

sankalan13
2019-05-21 05:56
has joined #pact-broker

sankalan13
2019-05-21 06:01
Hi guys Very new to pact and I'm trying to create webhooks from the free hosted pact-broker "Pact-flow". I want to know how I can set the 'PACT_BROKER_WEBHOOK_HOST_WHITELIST' env variable when I am using the hosted broker. For the docker-compose broker, I can easily set it in the compose file itself.

bethskurrie
2019-05-21 06:03
You can't at the moment.

bethskurrie
2019-05-21 06:03
Let me look into it and see if I can made this customisable at a tenant level though.

bethskurrie
2019-05-21 06:04
Can I ask what you're connecting to that's on the public internet but isn't https?

sankalan13
2019-05-21 06:08
Thank you for the quick response :slightly_smiling_face: I wanted to make webhook triggers for slack and github but in the locally hosted docker pact-broker, i could not make the webhook triggers work unless I whitelisted the urls. I was thinking its the same case with pact-flow. (Asked the question without trying out first) Have these URLs already been whitelisted in pact-flow? @bethskurrie

bethskurrie
2019-05-21 06:09
Slack and github run on https

bethskurrie
2019-05-21 06:10
And yes, all domains are whitelisted.

sankalan13
2019-05-21 06:11
Awesome thank you so much for that. Is there any documentation for pact-flow currently?

bethskurrie
2019-05-21 06:12
All the OSS documentation applies to pactflow currently. We're working on creating separate docs, as we add new features that aren't available in the OSS version.

sankalan13
2019-05-21 06:19
Got it. Thanks a ton Beth :slightly_smiling_face:

sankalan13
2019-05-21 11:20
Hi guys I am using the pact-verifier to get my pact file from pact-flow and use it to verify my provider. This is the exact code I have been using: ```pact-verifier --provider-base-url="http://localhost:8000" --pact-url="https://springboard.pact.dius.com.au/pacts/provider/paymentcallutilityservice/consumer/ui/latest/" --provider-states-setup-url="http://localhost:8000/_pact/provider_states/" --custom-provider-header="Authorization: Bearer ***********" -a "0.0.2" -r``` Here are a few things I have tried: 1) Changing the bearer token on the --custom-provider-header tag and putting it in the URL 2) Added and removed --pact-broker-username="********" --pact-broker-password="******" 3) Used the ruby pact-provider-verifier gem instead of the one with python 4) used the actual version of the pact in the pact flow instead of /latest/ tag 5) changed the localhost base urls to actual server running on kubernetes 6) using the old --broker-token from pact-provider-verifier None of the above has resolved the issue. The error I am getting is ```Error reading file from https://springboard.pact.dius.com.au/pacts/provider/paymentcallutilityservice/consumer/ui/latest/ HTTP request failed: status=401 /Users/Sankalan/.virtualenvs/work/lib/python2.7/site-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.7.2/lib/pact/consumer_contract/pact_file.rb:69:in `block in get_remote_with_retry'``` With stack trace to follow. P.S. Is this the right channel for these questions or should I direct them to some other channel. :slightly_smiling_face:

bethskurrie
2019-05-21 11:22
Are you using pact python?

bethskurrie
2019-05-21 11:23
I think the verifier needs updating to support the bearer token.

bethskurrie
2019-05-21 11:23
Try using the docker pactfoundation/pact-cli instead.

bethskurrie
2019-05-21 11:24
--broker-token is the parameter.

sankalan13
2019-05-21 11:28
Yes I am using pact python. Okay trying it :slightly_smiling_face: thank you

sankalan13
2019-05-21 12:09
Hey @bethskurrie Thank you for guiding me in the right direction. I updated the latest version of pact-provider-verifier and now the --broker-token is visible to me. I am using this command now: ```pact-provider-verifier --pact-broker-base-url="https://springboard.pact.dius.com.au/" --provider-base-url="http://localhost:8000" -c "http://localhost:8000/_pact/provider_states" --broker-token="**********" -a "0.0.1" -r -v --provider=paymentcallutilityservice``` The error changed, before I wasn't able to retrieve the URL but I am still getting a 401 unauthorized. I am not able to get my pact file from the pact-flow server using my bearer token. I even tried using the basic auth but that also doesnt seem to work. ```INFO: Fetching pacts for paymentcallutilityservice from https://springboard.pact.dius.com.au/ for tags: latest 0.0.2 opening connection to http://springboard.pact.dius.com.au:443... opened starting SSL for http://springboard.pact.dius.com.au:443... SSL established <- "GET /? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: Basic amluYWxAc3ByaW5nYm9hcmQuY29tOkppbmFsQDEyMw==\r\nHost: http://springboard.pact.dius.com.au\r\n\r\n" -> "HTTP/1.1 401 Unauthorized\r\n" -> "Date: Tue, 21 May 2019 12:02:27 GMT\r\n" -> "Content-Type: text/plain\r\n" -> "Content-Length: 0\r\n" -> "Connection: keep-alive\r\n" -> "Status: 401 Unauthorized\r\n" -> "X-Pact-Broker-Git-Sha: 742d506c8cd63cc4c7e25aecfb0e31ab2af3a7e5\r\n" -> "WWW-Authenticate: Basic realm=\"Restricted area\"\r\n" -> "X-Saas-Broker-Git-Sha: deb11516a75e3b5052b6f634fa71603e35b4add7\r\n" -> "X-Pact-Broker-Version: 2.31.0\r\n" -> "X-Request-Id: ab2e290d9bae7a74fdb0fb3d12b9124d\r\n" -> "X-Frame-Options: SAMEORIGIN\r\n" -> "X-XSS-Protection: 1; mode=block\r\n" -> "X-Content-Type-Options: nosniff\r\n" -> "Referrer-Policy: strict-origin\r\n" -> "Strict-Transport-Security: max-age=31536000 ; includeSubDomains\r\n" -> "\r\n" reading 0 bytes...``` pactfoundation/pact-cli only has a publish option and a can-i-deploy option. It does not have an option from where I can verify my provider.


sankalan13
2019-05-22 03:48
Thanks Matt. I will try that too. I found the problem yesterday (I guess? :p) Pact version release 1.40.0 supports broker token but pact-provider-verifier gem uses pact 1.38.0 version release. I think this is the problem. When I remove 1.38 and install 1.40, pact mock service gem collides and raises version conflict. ```Unable to activate pact-message-0.5.0, because pact-mock_service-3.1.0 conflicts with pact-mock_service (~> 2.6) (Gem::ConflictError)``` because pact-mock_service depends on pact-message 0.5.0. I am not sure if the current pact-broker-verifier is compatible with the --broker-token field.

bethskurrie
2019-05-22 03:48
I'm in the process of fixing it.

bethskurrie
2019-05-22 03:48
In the meantime, set the env var PACT_BROKER_TOKEN and it should work.

bethskurrie
2019-05-22 03:50
The verification process executes a command, and that command gets printed to the terminal. I didn't want to have the token printed to the terminal - hence the use of the env var.

bethskurrie
2019-05-22 03:50
I'd missed hooking up the --broker-token param to the env var though.

matt.fellows
2019-05-22 04:43
Thanks for fixing Beth.

sankalan13
2019-05-22 05:22
Thanks Beth. Can you give a tentative estimate as to when the fix will be out?

matt.fellows
2019-05-22 05:38
The fix is out in the standalone and pact js. Where do you need it?

sankalan13
2019-05-22 05:46
I am using the pact-provider-verifier gem and I see that the fix is out as pact-provider-verifier is using pact 1.40.0 but the provider verification is still failing for me somewhere in the pact-support 1.10.2 version. I'm trying to get to the bottom of it but I have a hunch that the broker token is not propagating through. Will send a screenshot of the stack trace

sankalan13
2019-05-22 05:52
This is the stack trace I am getting. The first two times, the broker token is being propagated to the header when accessing the pactflow url and then the /provider/name/latest url. But as soon as the verifier tries to access the actual pact file url, the broker token is not passed with it. Because of which I am not able to read the file. I am still trying to find the exact problem. Maybe you guys will know it quicker if there is a problem here.

sankalan13
2019-05-22 05:55
@matt.fellows pact standalone is still using pact 1.38.0 so pact-provider-verifier is failing on it.

sankalan13
2019-05-22 05:57
Sorry my bad, pulled the 1.65 version instead of 1.66

sankalan13
2019-05-22 05:58
Fixed in standalone. Thank you so much guys!!! Wohoooooooo

matt.fellows
2019-05-22 06:11
:+1:

matt.fellows
2019-05-22 06:11
:laughing:

sankalan13
2019-05-22 07:27
Pact support is awesome!! You guys are so proactive!! Highly appreciated :smile:

bethskurrie
2019-05-22 07:28
No problem!

anabalfun
2019-05-22 09:14
has joined #pact-broker

qatrera
2019-05-22 10:51
Hi! We are wondering if this endpoint `DELETE /pacts/provider/{provider}/consumer/{consumer}/tag/{tag}` will delete a pact that has more than one tag. For instance, I have a pact tagged with `['production', 'my_branch_name']` and I delete the pacts with tag `'my_branch_name'` using the mentioned endpoint, will my pact be deleted too? or it will only remove the `'my_branch_name'` tag?

vitaliy.grigoruk
2019-05-22 11:01
I?d expect that request mentioned above should delete tags only

vitaliy.grigoruk
2019-05-22 11:03
but I?ll let somebody else to answer this question

detert
2019-05-22 11:06
My guess: It deletes a tag. Why don't you just try it?

bethskurrie
2019-05-22 11:26
It deletes the pacts, regardless of whether they have other tags.

bethskurrie
2019-05-22 11:27
I have had the thought though that it would be better to make it just remove the tag if there are other tags attached, so you can keep all your prod pacts, but remove ones from a branch you're no longer using.

bethskurrie
2019-05-22 11:28
I'm not sure when I'll get around to it, but can you raise it as a feature request?

qatrera
2019-05-22 12:03
> I have had the thought though that it would be better to make it just remove the tag if there are other tags attached, so you can keep all your prod pacts, but remove ones from a branch you're no longer using. that's the use case we were thinking (still trying to figure some things out around Pact) but we were concerned we could potentially overload the broker with no longer used pacts.

qatrera
2019-05-22 12:25
we'll investigate a bit more and create the feature request if we need to (and try to create a PR for it)

qatrera
2019-05-22 12:25
thanks for the quick response!

detert
2019-05-22 15:59
Hi. I call the `pact-provider-verifier` with a https broker url, however the publish-verify-results call seems to try to call http (I get a redirect from my webserver at port 80). Is that a known issue?

matt.fellows
2019-05-22 21:24
Can you prove/demonstrate this? That would definitely be a new bug and is not intended behavior

detert
2019-05-24 06:07
Well yes. I disabled the http to https redirect in Apache and now it works

matt.fellows
2019-05-24 06:11
that would imply that you were configuring it with an http url - I?m concerned if you?re removing that redirect (seems like a good security practice)


detert
2019-05-24 06:22
I can add the redirect again, if it works. Currently everything is internally

detert
2019-05-24 06:24
The successful version even states published to http:// even if I provide https://

detert
2019-05-24 06:26
I added the success log to the issue

detert
2019-05-24 06:26
I have to leave for now, I'll be back later

matt.fellows
2019-05-24 06:26
thx

matt.fellows
2019-05-24 06:26
np

qatrera
2019-05-24 09:51
Hi again! :wave: Context: we are using pact_broker_docker FROM dius/pact-broker:2.31.0-1. Our Jenkins has 'Prevent Cross Site Request Forgery' enabled so in order to trigger a Jenkins job from a webhook we also need to pass a valid `crumb` . This `crumb` is obtained by doing an extra request. Has someone configured a broker webhook successfully with this setting enabled? As far as I know this `crumb` has a TTL, so we can't avoid to perform the auth request first. But in the webhook we can only configure one request. We would really like to avoid to create a proxy service for this if possible. If someone has more ideas we would really appreciate it :blush:


vitaliy.grigoruk
2019-05-24 09:58
Use ?Authentication Token? for each job

qatrera
2019-05-24 10:09
omg, it works! I thought we already tried that! Thanks!!! :heart:

bethskurrie
2019-05-24 10:45
Great!

bethskurrie
2019-05-24 10:46
Also, check out the latest broker image at pactfoundation/pact-broker. It's much smaller and runs without root permissions. We'll be retiring the one you're using @qatrera

bethskurrie
2019-05-24 10:46
The same configuration options apply to the new one, you can literally just swap pactfoundation for dius.

qatrera
2019-05-24 10:51
ah, didn't know that, we'll check!

qatrera
2019-05-24 10:51
thanks @bethskurrie!

qatrera
2019-05-24 11:15
Following this comment by @bethskurrie https://pact-foundation.slack.com/archives/C9VPNUJR2/p1558694762008600?thread_ts=1558691514.007300&cid=C9VPNUJR2 we saw that for the new `pactfoundation/pact-broker` there aren't any tags published https://hub.docker.com/r/pactfoundation/pact-broker/tags (compared with the dius one https://hub.docker.com/r/dius/pact-broker/tags). Would it be possible to have some version tags there? It would help debugging (among other things :slightly_smiling_face: ). Thanks!

bethskurrie
2019-05-24 11:25
Good point @qatrera. We've just been running it in beta for the last few weeks to make sure there weren't any issues.

bethskurrie
2019-05-24 11:25
That's why there's only the edge tag. Nobody has reported anything however, so I reckon we can make an official release.

borsuk.artem034
2019-05-24 15:05
~Hi folks, I need get latest provider version for webhook, I'm try to use ${pactbroker.providerVersionNumber}, but it is empty~ Never mind :slightly_smiling_face: it works when you publish contract and webhook triggered, but not work when you do debugging

borsuk.artem034
2019-05-24 15:09
~more details: I have separate job for running "pact-provider-verifier" which I want to run via webhook in bamboo ...rest/api/latest/queue/PLAN?&amp;bamboo.ENVIRONMENT=${pactbroker.consumerVersionTags}&amp;bamboo.variable.PROVIDER_VERSION=${pactbroker.providerVersionNumber}~

borsuk.artem034
2019-05-25 06:15
Question regarding the previous one, do we have a possibility for new consumer contract set the latest provider version by the same tag as a new consumer?

bethskurrie
2019-05-25 06:16
I'm sorry @borsuk.artem034, I don't understand the question

bethskurrie
2019-05-25 06:17
@borsuk.artem034 are you triggering a provider verification from a webhook? You should pass the URL of the changed pact to the verification job.


borsuk.artem034
2019-05-25 06:46
@bethskurrie np, my fault, I should describe the problem with details. So: 1. Consumer change the contract and version 2. In pact broker, we can see a new line with the version of consumer and empty provider version 3. For trigger "pact-provider-verifier" via webhook in CI, I need pass the TAG and Provider-version The problem in step 3, I don't know how I can specify a provider version

bethskurrie
2019-05-25 06:46
You don't typically specify the tag and provider version.

bethskurrie
2019-05-25 06:47
typically you'd trigger a CI job, and that would just use the latest version of the code (or a set branch/git tag)

borsuk.artem034
2019-05-25 06:50
hmm, just for verification or build provider?

bethskurrie
2019-05-25 06:50
for verification.


bethskurrie
2019-05-25 06:51
The consumer doesn't tell the provider which version it should be verified by - the provider decides that.

borsuk.artem034
2019-05-25 06:55
yep, I read already, in that case verification result will be not published, because for publishing require parameter --provider-app-version

bethskurrie
2019-05-25 06:56
that's on the provider side...

bethskurrie
2019-05-25 06:57
the pact gets generated by the consumer tests, published to the broker, the broker triggers a provider verification job in the provider's CI, which checks out the latest version of the code, and verifies the pact at the URL that was passed to it from the webhook. That's the job that needs to know the provider version. It publishes the verification result back to the pact broker with the provider version.

bethskurrie
2019-05-25 06:57
it's the provider job - it should know the provider version.

bethskurrie
2019-05-25 06:58
The webhook does not know anything about the provider version.


borsuk.artem034
2019-05-25 07:11
mmm, let's proceed with example (sorry for annoying you, i just want solid understanding) 3. webhook pass TAG and run Provider verifying 4. Provider verifying job should checkout latest code base and take branch name and hash commit Is the correct way?

bethskurrie
2019-05-25 07:11
> webhook pass TAG and run Provider verifying

bethskurrie
2019-05-25 07:12
The webhook just passes the URL of the changed pact.

bethskurrie
2019-05-25 07:12
> Provider verifying job should checkout latest code base and take branch name and hash commit Yes.

bethskurrie
2019-05-25 07:13
The job for the webhooks (when the pact changes) is different from your normal provider CI pipeline.

bethskurrie
2019-05-25 07:14
The normal provider pipeline is triggered when you commit your provider, and that's the one where you give it specific consumer version tags to verify.


borsuk.artem034
2019-05-25 07:15
In tag I'm specify environment (like test1, test2, stage...) so, if contract changed on test2 then provider to verifing will be on test2 too

bethskurrie
2019-05-25 07:15
if you want to put smarts into the logic, then you'll need an intermediate CI job to trigger the right provider job.

bethskurrie
2019-05-25 07:17
typically you tag with the environment when you deploy

bethskurrie
2019-05-25 07:17
not when you publish a pact.

borsuk.artem034
2019-05-25 07:18
oh, it is my omission, pact published during deploy in my case

bethskurrie
2019-05-25 07:18
why?

bethskurrie
2019-05-25 07:19
you don't know if you're safe to deploy yet.

bethskurrie
2019-05-25 07:19
typically you'd go 1. generate pact 2. publish pact (you don't know if it will pass verification yet) and tag with branch name 3. use can-i-deploy to check the status of the pact 4. deploy if it is green 5. tag with the environment name

bethskurrie
2019-05-25 07:23
Do you have an unusual deployment pipeline?

borsuk.artem034
2019-05-25 07:31
Some kind, we have separate build plans which create a docker images(during build pact generated), then deploy images on environment(during deploy - pact published with version (imageName-commitHash) and runed can-i-deploy)

borsuk.artem034
2019-05-25 07:33
I thought it will be suitable solution, but after talk with you I don't know

bethskurrie
2019-05-25 07:34
you shouldn't separate the pact generation from the pact publication.

bethskurrie
2019-05-25 07:34
you need to publish and get the verification results before you know you're safe to deploy.

bethskurrie
2019-05-25 07:35
otherwise, you could put whatever you liked in a pact, and deploy it to the environment - but it would not work with the provider.

borsuk.artem034
2019-05-25 07:43
yeah, I made a big mistake, many thanks for your time and returning me in the right direction

bethskurrie
2019-05-25 07:43
:thumbsup::skin-tone-3:

monch1962
2019-05-27 21:27
has joined #pact-broker

diandra
2019-05-28 00:21
has joined #pact-broker

s1apped
2019-05-28 09:47
Hi. I'm trying to run pact broker docker on aks cluster and postgres database. Looks like pod and service is up and running but unable to connect to HAL and there is nothing in logs ( running it in DEBUG ). I suspect some issues with DB connection but I'm not able to troubleshoot. cat /var/log/nginx/access.log is empty.

bethskurrie
2019-05-28 09:51
Have you found the debugging page on the wiki?


s1apped
2019-05-28 09:54
yes I followed it

bethskurrie
2019-05-28 09:54
I'm not sure how much we can help you because it sounds like you're having problems with the environment more so than the broker itself.

bethskurrie
2019-05-28 09:55
Can you run a local docker instance connecting to the same database?

bethskurrie
2019-05-28 09:58
If it had started up and was unable to connect, you should see some logs somewhere indicating that. It seems to me like the broker process isn't even starting.

s1apped
2019-05-28 09:59
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh... *** Running /etc/my_init.d/10_syslog-ng.init... May 28 09:16:10 pactbroker-5b8f46c966-89w67 syslog-ng[13]: syslog-ng starting up; version='3.13.2' *** Running /etc/my_init.d/30_presetup_nginx.sh... *** Booting runit daemon... *** Runit started as PID 22 May 28 09:16:11 pactbroker-5b8f46c966-89w67 cron[27]: (CRON) INFO (pidfile fd = 3) May 28 09:16:11 pactbroker-5b8f46c966-89w67 cron[27]: (CRON) INFO (Running @reboot jobs) ok: run: /etc/service/nginx-log-forwarder: (pid 31) 0s May 28 09:17:01 pactbroker-5b8f46c966-89w67 CRON[57]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

s1apped
2019-05-28 09:59
these are the only logs I see

bethskurrie
2019-05-28 10:00
Try running the new puma docker image.

bethskurrie
2019-05-28 10:00
It's in pactfoundation/pact-broker

bethskurrie
2019-05-28 10:01
Maybe it's a permissions issue. Are you running it with root?

bethskurrie
2019-05-28 10:01
The new image doesn't need root.

s1apped
2019-05-28 10:01
let me try new image

s1apped
2019-05-28 10:07
now it

s1apped
2019-05-28 10:07
is better :wink: I was using dius image

s1apped
2019-05-28 10:08
now pactfoundation/pact-broker:edge

s1apped
2019-05-28 10:08
and way better

bethskurrie
2019-05-28 10:08
the new one is a fork of the dius one, which one of our contributors converted from nginx to puma, and made it a heap smaller.

s1apped
2019-05-28 10:13
thank you

antonello
2019-05-28 11:01
Hi! My client and I are investigating how do tagging in the Pact Broker during deploys/flips from blue to green in production. Since the `latest` tag is determined by the version number being tagged, we are unsure how to handle situations in which we decide to flip back to the old version. Here?s an example to illustrate this: 1. Latest `prod` tag is `2.5.0` ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.5.0 | prod``` 2. I deploy `2.6.0` and tag it as `prod`: ```$ pact-broker create-version-tag --pacticipant= a_pacticipant --broker-base-url=http://localhost:5080/ --version=2.6.0 --tag prod Tagging a_pacticipant version 2.6.0 as prod``` 3. Pact Broker is now reporting 2.6.0 as the latest `prod` tag. All good ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.6.0 | prod``` 4. Let?s assume something is wrong and I want to flip back to 2.5.0. I retag 2.5.0 as prod. (This is a no-op I assume) ```$ pact-broker create-version-tag --pacticipant= a_pacticipant --broker-base-url=http://localhost:5080/ --version=2.5.0 --tag prod Tagging a_pacticipant version 2.5.0 as prod``` 5. But the Pact Broker reports that latest `prod` is still 2.6.0` ! ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.6.0 | prod```

bethskurrie
2019-05-28 11:01
If you want to return to a previous version, you need to delete the prod tag from the version you un-deployed.

antonello
2019-05-28 11:02
I was looking for documentation on how to delete a tag, but couldn?t find any. Will the HAL browser give me the answer I?m looking for? :slightly_smiling_face:

antonello
2019-05-28 11:02
I haven?t looked yet

bethskurrie
2019-05-28 11:02
I have been considering altering the behaviour of "latest" so that it could work like you said.

bethskurrie
2019-05-28 11:02
Send a delete to the URL of the tag.

bethskurrie
2019-05-28 11:02
You will find the tags in the HAL browser.

bethskurrie
2019-05-28 11:03
DELETE `/pacticipants/:pacticipant/versions/:version/tag/:tag`

antonello
2019-05-28 11:03
awesome!

bethskurrie
2019-05-28 11:04
I was just checking if I'd done a delete in the CLI, but it seems not yet

antonello
2019-05-28 11:04
yep - I looked that first

bethskurrie
2019-05-28 11:04
if you raise an issue, i'll see if I can get it in some time.

antonello
2019-05-28 11:04
well, making an API call these days is cheap, but I will also suggest a PR :slightly_smiling_face:

bethskurrie
2019-05-28 11:05
warning, I'm crazy busy with Pactflow right now, but hopefully I'll get to it!

antonello
2019-05-28 11:06
I didn?t know anything about Pactflow! I?ll check it out!

bethskurrie
2019-05-28 11:06
It's a SAAS version of the Pact Broker, with extra bells and whistles.

bethskurrie
2019-05-28 11:07
Proper auth, better UI, Swagger support comming

bethskurrie
2019-05-28 11:07
http://pactflow.io if you're interested

antonello
2019-05-28 11:07
Well, the guys at Treatwell could look into creating a PR to add the ability to delete a TAG via che pact broker cli. It shouldn?t be too bad

bethskurrie
2019-05-28 11:08
that would be awesome!

bethskurrie
2019-05-28 11:08
it should be quite straightforward, though the code in that repo is a mix of old Beth code (6 years ago) and new Beth code (shiny!) so not all of it in there is a good pattern to copy!

bethskurrie
2019-05-28 11:08
I think the create-version-tag is recent enough though.

s1apped
2019-05-28 12:20
is there an option to change url root path from http://my.broker.com to http://my.broker.com/pact?

matt.fellows
2019-05-28 12:23
if you?re hosting your own, you?d probably need to do some magic with whatever reverse proxy you put in front of it (e.g. rewrite rules) or modification to the Ruby app itself (it?s probably possible with some magic in http://config.ru or a separate piece of middlelware)

matt.fellows
2019-05-28 12:23
but I?ve not tried myself

s1apped
2019-05-28 12:24
thanks :slightly_smiling_face:

matt.fellows
2019-05-28 12:29
np

daniel.tattan.birch
2019-05-28 16:02
has joined #pact-broker

pact.io
2019-05-28 16:42
has joined #pact-broker

diandra
2019-05-28 19:00
Hi , im starting with pact, I want to publish my pact in Pactflow, I have copnfiguration my publish.js file, when I run it I get an authentication failure (the username and password is correct), some idea that could be wrong :disappointed:

matt.fellows
2019-05-28 22:12
You should be authenticating using the bearer token mechanism. My guess is that you?re trying to use your username (email address) + password.

matt.fellows
2019-05-28 22:13
Head to settings, grab a token (read/write) and then user the `pactBrokerToken` property


detert
2019-05-29 06:11
Two thoughts: Did you try to fix the warning "Insecure world writeable"? And are you able to publish contracts using just CURL?

bart.schotten
2019-05-29 09:35
We're using version 2.31.0-1 of the dius/pact-broker docker image, no custom configuration. We using only Git hashes as pacticipant versions (no semver). According to https://github.com/pact-foundation/pact_broker/wiki/Configuration#ordering-versions-by-date it should sort by date by default, but... it doesn't. Even after uploading a new version. Am I wrong about the expected behavior here?

bethskurrie
2019-05-29 09:36
There's a bug if it doesn't.


bethskurrie
2019-05-29 09:41
What ordering are you seeing @bart.schotten? Random? Can you create a script to recreate the issue, and raise an issue in the pact-broker-docker repository, I'll have a look at it.

bart.schotten
2019-05-29 10:41
It seems to be completely random

bart.schotten
2019-05-29 10:47
It might be relevant that most of these were uploaded when we had an old version deployed (without the default sorting by date).

bethskurrie
2019-05-29 10:47
Ah. Yes. It won't resort the old versions.

bethskurrie
2019-05-29 10:48
As long as the new ones are going in the right order, it's working as expected.

bart.schotten
2019-05-29 10:48
Ok, that clears things up at least. I guess I'll have to delete older versions then.

bethskurrie
2019-05-29 10:49
Are they causing problems?

bart.schotten
2019-05-29 10:49
Yeah, old versions keep being listed as "latest"

bethskurrie
2019-05-29 10:49
Usually you only deal with the latest version, or the latest tagged version. Anything else becomes irrelevant.

bethskurrie
2019-05-29 10:49
That shouldn't happen.

bethskurrie
2019-05-29 10:50
But if you're OK with it, I would just delete them and start again.

bethskurrie
2019-05-29 10:50
If you notice any problems, with the clean env, raise an issue.

bart.schotten
2019-05-29 10:52
I'll do that. Thanks for the help.

bethskurrie
2019-05-29 10:52
Having semantic versioning at all turned out to be the wrong decision! It was written in an environment where everything was semantically versioned. You live and learn!


matt.fellows
2019-05-29 22:03
What do you mean by support?

matt.fellows
2019-05-29 22:04
Looks like a personal project of a maintainers, but if you had issues I'm sure they'll support it if it doesn't get answered here

bethskurrie
2019-05-30 04:35
The newer, smaller, sleeker, un-rootier, and downright sexier Pact Broker Docker image is now officially released. Get yours at `pactfoundation/pact-broker:2.32.0-2`. It is fully backwards compatible with the environment variables from the previous `dius/pact-broker` image, but now runs on port 9292 by default so it doesn't need root (and this port is configurable). Many thanks to @stipud for his work on this!

stipud
2019-05-30 04:35
has joined #pact-broker

abubics
2019-05-30 04:40
> downright sexier

bethskurrie
2019-05-30 04:41
It totally is.

bethskurrie
2019-05-30 04:42
While I've got your attention, some new features that have been added to the UI recently: ? Delete a single pact ? Delete all pacts between a consumer/provider ? Delete an entire integration and all related objects (consumer/provider/webhooks etc)

bethskurrie
2019-05-30 04:43
So go crazy, DELETE ALL THE THINGS! You can just republish them anyway...

tjones
2019-05-30 05:18
So great! Thanks @bethskurrie and @stipud

vitaliy.grigoruk
2019-05-30 05:25
just our of curiosity, did anybody deploy pact-broker to Heroku?

stipud
2019-05-30 06:38
Hey everyone! I'm glad I could help. :relaxed:

rafael.anachoreta
2019-05-30 07:29
amazing stuff! :heart_eyes:

oswald.quek
2019-05-30 08:44
Thanks @bethskurrie @stipud !

sankalan13
2019-05-30 09:24
Will these features be available in pactflow as well?

laverya
2019-05-30 17:33
has joined #pact-broker

pat.vongphrachanh
2019-05-30 18:58
has joined #pact-broker

bethskurrie
2019-05-30 23:42
The buttons haven't been added to the new UI yet @sankalan13, but you can always switch to the old (OSS) UI to access them. There's an "old ui" toggle button at the top of the page.

bethskurrie
2019-05-30 23:44
@vitaliy.grigoruk I can't remember anyone specific, but I can't see a reason why it wouldn't work.

bethskurrie
2019-05-30 23:45
The pact-jvm and ruby clients have retries built into them so if it takes a while to come up, there shouldn't be any noticeable side effects.

sankalan13
2019-05-31 05:52
Thanks Beth. Will have a look.

detert
2019-05-31 13:03
Does someone use Gitlab together with pact-broker? I am searching for ideas on how to integrate can-i-deploy before a merge request might be merged into master

bethskurrie
2019-06-01 03:45
This may help



bethskurrie
2019-06-01 03:49
If you want to get complex about it, this approach may help you @detert https://github.com/pact-foundation/pact_broker/issues/273#issuecomment-494184798

pact.io
2019-06-01 10:39
Hi @bethskurrie. Thank you very much. I'll take a closer look at it

bethskurrie
2019-06-01 21:51
Hey broker users. I'm coming up with a design for webhook secrets that can be substituted into the webhooks at runtime (eg tokens, passwords, auth headers). Can anyone see a use for *non-secret* user defined parameters in webhooks?

pact.io
2019-06-01 23:51
I am not sure if I understand what you are doing

bethskurrie
2019-06-01 23:57
You know how you can use predefined webhook template parameters? Eg ${pactbroker.consumerVersionNumber} ? I'm making user defined ones that will be encrypted and redacted from the logs for things like api tokens.

bethskurrie
2019-06-01 23:57
"secrets"

bethskurrie
2019-06-01 23:58
But that made me wonder if there was a use case for user defined template parameters that weren't secret. Like ${repositoryBaseUrl}

bethskurrie
2019-06-01 23:59
To dry up the webhook definitions.

pact.io
2019-06-02 00:35
Well, that is a good question. Do I understand it right that the main point is: "should all user defined variables be encrypted in the logs?"

thakkarjinal29
2019-06-03 04:02
has joined #pact-broker

vitaliy.grigoruk
2019-06-03 11:59
The only case where I would use ?non-secret? user-defined params are ?githubOrgName?, ?ci base url?, ?bot usernames for CI / github?. Are these user-defined params shared for all webhooks or maybe somehow scoped to consumer or provider?

bethskurrie
2019-06-03 12:06
They'd be global at this stage.

bethskurrie
2019-06-03 12:07
Yes, those are the kinds of things I'd imagine using global parameters for. But does anyone ever actually use them? :-P

bethskurrie
2019-06-03 12:09
@detert anything user defined that isn't secret would not be redacted from the logs, the way thing like pacticipant names are not redacted from the logs.

bheemreddy181
2019-06-03 18:28
Can I consider can-i-deploy something like can-i-merge? i don't want to merge bad contract changes to master

bethskurrie
2019-06-03 20:01
Yes @bheemreddy181

bheemreddy181
2019-06-03 20:06
Cool - Can you do a write-up regards to the same or if you have a write up can you share it for the workflow ?

bheemreddy181
2019-06-03 20:35
@bethskurrie Can i pass a dynamic tag name in here for consumer on provider_verification ? https://github.com/pact-foundation/pact-ruby/wiki/Verifying-pacts#fetching-pacts-from-a-pact-broker

bheemreddy181
2019-06-03 20:44
Something like this

bheemreddy181