1970-01-01 00:25
A file, which can't be shown because your team is past the free storage limit, was commented on.

1970-01-01 00:25
A file, which can't be shown because your team is past the free storage limit, was commented on.

rholshausen
2017-02-17 00:03
has joined #general2

trenthornibrook
2017-02-17 00:14
has joined #general2

matt
2017-02-17 02:29
has joined #general2

matt
2017-02-17 02:31
Hello! :slightly_smiling_face:

rholshausen
2017-02-17 03:02
Welcome!

trenthornibrook
2017-02-17 03:42
:wave:

lardcanoe
2017-02-17 23:41
has joined #general2

fitzoh
2017-02-17 23:45
has joined #general2

fitzoh
2017-02-17 23:46
hey there

sudhapatil3
2017-02-18 00:28
has joined #general2

abubics
2017-02-18 05:22
has joined #general2

abubics
2017-02-18 05:24
sup, y'all?

vijaynag
2017-02-18 22:22
has joined #general2

theresa
2017-02-18 22:58
has joined #general2

travi
2017-02-18 23:35
has joined #general2

andycampbell92
2017-02-19 00:32
has joined #general2

joel_a
2017-02-19 00:48
has joined #general2

sai.dileepjana
2017-02-19 21:06
has joined #general2

tmok01
2017-02-19 21:57
has joined #general2

mngau
2017-02-19 23:05
has joined #general2

kanchana
2017-02-19 23:44
has joined #general2

cass
2017-02-19 23:56
has joined #general2

stuparty
2017-02-19 23:58
has joined #general2

matt
2017-02-19 23:59
For those wanting to invite colleagues etc., you can refer them to http://pact-broker-slack-invite.herokuapp.com/ so they can signup instantly

matt
2017-02-19 23:59
@matt pinned a message to this channel.

trenthornibrook
2017-02-19 23:59
:thumbsup:

tigris
2017-02-20 00:00
has joined #general2

rob-manger
2017-02-20 02:07
has joined #general2

rob-manger
2017-02-20 02:09
greetings.

shahzadahmad
2017-02-20 12:22
has joined #general2

timothy.clifford
2017-02-20 22:40
has joined #general2

shahzadahmad
2017-02-21 10:01
Hello everyone!

shahzadahmad
2017-02-21 10:01
is anyone using pact in a microsoft service fabric world?

matt
2017-02-21 10:43
Not that I?m aware of, but i?d love to hear!

kevinkraus
2017-02-23 03:24
has joined #general2

jeanmarclai
2017-02-23 16:31
has joined #general2

timbailey
2017-02-28 22:03
has joined #general2

timbailey
2017-02-28 22:06
Hi


timbailey
2017-02-28 22:07
I assume that its a manual process to publish pacts to the broker (i'm in Pact-JS land)....

timbailey
2017-02-28 22:07
So when should I publish....in the consumer or provider "tests"

timbailey
2017-02-28 22:08
I think I've answered my own question....in the consumer as that is where the pacts are generated.....

matt
2017-02-28 22:09
:slightly_smiling_face:


timbailey
2017-02-28 22:14
Right, so does it make sense to publish on the finalize promise? ``` apiProvider.finalize() .then(() => { console.log('Writing PACT files') <-------Publish code goes here? done() }) .catch(err => { console.error('Error writing PACT files') done.fail(err) })```

matt
2017-02-28 22:14
potentially

matt
2017-02-28 22:14
Typically, it?s better to separate this out from the testing code itself.

matt
2017-02-28 22:14
This way, you can have your CI process determine whether to publish or not

timbailey
2017-02-28 22:14
Publish on CI build?


timbailey
2017-02-28 22:14
Snap

matt
2017-02-28 22:15
you probably don?t want your devs pushing changes on each unit test run, as this then provides an obligation to the Provider service (might be the same person/team) to meet that contract. Better to control that more carefully

matt
2017-02-28 22:16
also, you might want to tag the pacts (e.g. ?dev? or ?prod?) so that you can differentiate testing activities on the provider side

matt
2017-02-28 22:16
it might be OK for the provider to break a ?dev? tagged pact, but definitely not a ?prod? one

timbailey
2017-02-28 22:18
Right, thanks

matt
2017-02-28 22:18
:thumbsup:

timbailey
2017-02-28 22:19
Maybe offtopic, any plans for GRPC support?

matt
2017-02-28 22:19
not at this stage

matt
2017-02-28 22:19
from JS or Golang?

timbailey
2017-02-28 22:20
JS

matt
2017-02-28 22:20
or at least, not directly. We are looking at creating pluggable protocol engines. But this is probably a while away. We?d need to look at compatibility with other Pact language implementations etc.

matt
2017-02-28 22:20
but in theory it could be done

matt
2017-02-28 22:20
and fits the Pact model nicely

timbailey
2017-02-28 22:21
ok, so once your had the HTTP plugin....should be straigntforward to create GRPC imp also

matt
2017-02-28 22:22
what do you mean http plugin, sorry?

timbailey
2017-02-28 22:22
http protocol engine

timbailey
2017-02-28 22:25
ok, cool, thanks.

timbailey
2017-02-28 23:24
Soooo, me again, we love the HTTP Consumer Driven Contracts stuff that exists now.... we would like to use it with that and GRPC and RabbitMQ (as these are the transports we'll be using)

timbailey
2017-02-28 23:24
We could work on these and contribute back as PR's

matt
2017-02-28 23:25
Where are you based @timbailey? Perhaps we could organise a face to face / hangouts or something to work through it? Comminuty contributors would be great

timbailey
2017-02-28 23:25
Sydney

matt
2017-02-28 23:26
ah great

timbailey
2017-02-28 23:26
So we'd be interested in the JS interface to all this....

timbailey
2017-02-28 23:27
but i'd probably need to ready through the code to see where the plugins might interact. Perhaps start with some pointers for me to read? Then we could hangout?

matt
2017-02-28 23:27
both consumer and provider side?

timbailey
2017-02-28 23:27
Yep

matt
2017-02-28 23:27
Of course


timbailey
2017-02-28 23:28
Gut feel, how much work are we talking? Weeks/Months?

matt
2017-02-28 23:28
full or part-time?

matt
2017-02-28 23:28
:slightly_smiling_face:

timbailey
2017-02-28 23:29
For me, could be full time.....but boss might fall over if I say "6 months"!!

matt
2017-02-28 23:29
There are a number of different approaches, ranging from ?t& actical band-aids" to ?the one true solution"

matt
2017-02-28 23:29
ok definitely less than 6 months :smile:

matt
2017-02-28 23:29
Let me dig up some material and share with you

matt
2017-02-28 23:29
are you handy with Ruby or Rust perchance?

timbailey
2017-02-28 23:29
I'd say 1 month full time would be easy to arrange

timbailey
2017-02-28 23:30
ah nope, never touched

timbailey
2017-02-28 23:30
Cant be that hard??!!!!

matt
2017-02-28 23:33
(sorry man gotta run - work meeting)

matt
2017-02-28 23:33
but in short, it can?t be that hard :slightly_smiling_face:

timbailey
2017-02-28 23:35
k, chat later

timbailey
2017-03-01 04:02
Hey, sorry to keep going off topic....

timbailey
2017-03-01 04:03
I'm using Pact for verifying WebClient->Service contracts.....

timbailey
2017-03-01 04:03
So i'm using /node-modules/pact/dist/pact.web.js

timbailey
2017-03-01 04:03
But this is outof date in 2.2.2

timbailey
2017-03-01 04:04
ie doesnt have the .setup() method

timbailey
2017-03-01 04:21
hmm, forked and `npm dist` creates the same pact.web.js without the .setup() method....must eb missing somthing else

timbailey
2017-03-01 04:30
Yep, my fault. I'm using the Karma-Pact plugin, which does not have a .setup() method

abubics
2017-03-01 04:36
self-solving problems ;D

matt
2017-03-01 05:23
@timbailey yep, as Karma runs in the browser it can?t spawn open the mock service. I?m going to be looking at that in the next week or two, and probably rename it to `pact-web` or something for other web-browser-based testing frameworks

timbailey
2017-03-01 05:24
Cool, i'm having other wierd issues....tests all pass but I see incomplete calls to the http://127.0.0.1:8989/interactions/verification endpoint

matt
2017-03-01 05:25
If you have new interactions registered per test, you might need to clear out expectations between them with `removeInteractions ()`. Otherwise, each `verify()` is expecting all previous expectations to be met. The log file is your friend here.

timbailey
2017-03-01 05:26
I was tring to register them all on startup as per your e2e example....

matt
2017-03-01 05:26
ah ok, that?s fine. Each time you call `verify()` though you must have hit all of the endpoints you registered up until that point.

matt
2017-03-01 05:27
Either that, or move `verify()` into an `after()` type block that just runs once after all of the `it()` blocks pass

timbailey
2017-03-01 05:28
this is what i see....


matt
2017-03-01 05:29
cors maybe?

timbailey
2017-03-01 05:30
Maybe but then all the requests would fail?

matt
2017-03-01 05:31
yeah. Looks like it?s not going out at all based on that screenshot

matt
2017-03-01 05:32
3ms is very fast in comparison

timbailey
2017-03-01 05:32
(Is this the right place to be talking about this?)

matt
2017-03-01 05:33
it?s fine

matt
2017-03-01 05:34
ideally it?s public so we can share it

timbailey
2017-03-01 05:36
So i'm following the structure of the example here...


timbailey
2017-03-01 05:36
I have 2 test blocks, eachs adds interaction, does the test and then verifies

timbailey
2017-03-01 05:37
And I see 4 tests pass (2 tests + 2 "it verifies")

matt
2017-03-01 05:37
Worth asking, does the example in the pact-js repo work for you?

timbailey
2017-03-01 05:38
Yep `npm run test:karma:jasmine` == 8 passed. In PhantomJS....

timbailey
2017-03-01 05:39
Will try in Chrome now

timbailey
2017-03-01 05:43
3 failed....hmm...checking

timbailey
2017-03-01 05:45
I see the same "cancelled" status for the verification calls

timbailey
2017-03-01 05:45
and have some 500 errors on the unfriendme calls

timbailey
2017-03-01 05:45
Checking to see what is causing those

timbailey
2017-03-01 05:49
ok CORs issues...forgot to run without security

timbailey
2017-03-01 05:58
So i guess I dont get it!!

timbailey
2017-03-01 05:58
In your karma:jasmine tests

timbailey
2017-03-01 05:58
In order to see the netwrok requests....

timbailey
2017-03-01 06:00
I have to disable singleRun, run it in Chrome, then enable the devTools, then on the network tab click F5

timbailey
2017-03-01 06:01
But becuase I'm doing that the interactions are "accumulating" on the server, and the call to `http://localhost:1234/unfriendMe` then 500's with a "Multiple interactions found" error

timbailey
2017-03-01 06:01
But the tests still pass?

timbailey
2017-03-01 06:06
Right, so I think I see whats going on....

timbailey
2017-03-01 06:06
``` it("returns an error message", function (done) { //Run the tests client.unfriendMe().then(function() { done(new Error('expected request to /unfriend me to fail')) }, function(e) { done() }) })```

timbailey
2017-03-01 06:06
Here the test wants an error, which does happen, but not the error that the service should raise. Its a PACT mock error

timbailey
2017-03-01 06:07
`message: "Multiple interaction found for PUT /unfriendMe"`

timbailey
2017-03-01 06:08
I'd imagine that it should be poosible to have the same url registered for different states?

abubics
2017-03-01 06:10
for each interaction/scenario, you would define your expected state and response, so for one test you'd expect only one interaction

abubics
2017-03-01 06:11
can you not have your dev console open in Chrome before you start running your test?

timbailey
2017-03-01 06:12
This fixes the passing tests.... ``` it("returns an error message", function (done) { //Run the tests client.unfriendMe() .then(() => { done(new Error('expected request to /unfriend me to fail')) }) .catch(e => { expect(e.status).toEqual(404) done() }) })```

timbailey
2017-03-01 06:12
ie the error status should be 404

timbailey
2017-03-01 06:14
The refresh issue was a red herring. So now even if I refresh I see the correct results from the test

timbailey
2017-03-01 06:14
So the remaining question is why do the "verification" calls get cancelled

matt
2017-03-01 07:15
Will look at this tonight @timbailey

matt
2017-03-01 07:15
Looks like a logic problem

matt
2017-03-01 10:19
Updated that test and pushed to repo

matt
2017-03-01 10:19
not sure what?s going on with the ?cancelled? though!

timbailey
2017-03-01 21:18
Morning, so pulled your latest changes, 8 passes, great!!

timbailey
2017-03-01 21:18
Now looking at the 'cancelled' issue....

timbailey
2017-03-01 21:19
I *think* its something to do with overlapping requests....

timbailey
2017-03-01 21:19
as if, in `pact-js/src/common/request.js`, i change line 58 from

timbailey
2017-03-01 21:20
`const req = this._request` to `const req = new window.XMLHttpRequest()` then the calls dont get cancelled....but they instead 500 error

timbailey
2017-03-01 21:20
So not sure if thats progress!

timbailey
2017-03-01 21:21
The first verification call error is ...

timbailey
2017-03-01 21:21
```Actual interactions do not match expected interactions for mock MockService. Missing requests: GET /friends?age=30&children=Mary+Jane&children=James See /home/tim/Projects/timbailey-pnk/pact-js/logs/mockserver-integration.log for details.```

timbailey
2017-03-01 21:21
So now looking at that

timbailey
2017-03-01 21:25
Fixed it...if I move the provider.verify() to the `afterAll` ``` afterAll(function (done) { provider.verify() provider.finalize() .then(function () { done() }, function (err) { done.fail(err) }) })```

timbailey
2017-03-01 21:26
Does that make sense? Seems to me like the tests are being run non-sequentially so that the verifies are failing as the interactions are being added "out of order"?

matt
2017-03-01 21:27
Great news (i think?). Are you able to past the structure of your tests with any important / sensitive stuff removed?

timbailey
2017-03-01 21:28
its your test!


matt
2017-03-01 21:29
oh. that?s weird. Sorry I thought you said the tests are passing before?

timbailey
2017-03-01 21:29
They were, but with the "cancelled" reaquests

timbailey
2017-03-01 21:29
So my changes, now stop that and still have 8 passing tests

matt
2017-03-01 21:31
do you mind sharing the karma config so that I can compare notes? (assuming you?ve changed it for it to run in chrome, yeah?)

timbailey
2017-03-01 21:33
I have



timbailey
2017-03-01 21:34
`npm install karma-chrome-launcher`

matt
2017-03-01 21:46
So i?m no Karma expert, but it seems the tests all pass when you don?t run in debug. I?m probably fully catching up on your challenges, is this the case?

timbailey
2017-03-01 21:47
debug?

timbailey
2017-03-01 21:48
You mean pressing the debug button on the Karma UI?

matt
2017-03-01 21:51
yeah, but that?s a furphy never mind

matt
2017-03-01 21:52
sorry I?m still confused though. The tests all pass for me (i.e. if I enable `singleRun` it all runs and I get an exit code of 0)

matt
2017-03-01 21:52
``` Chrome 56.0.2924 (Mac OS X 10.11.6): Executed 8 of 8 SUCCESS (2.079 secs / 0.025 secs) 02 03 2017 08:51:24.803:DEBUG [karma]: Run complete, exiting. 02 03 2017 08:51:24.805:DEBUG [launcher]: Disconnecting all browsers 02 03 2017 08:51:25.004:DEBUG [launcher]: Process Chrome exited with code 0 02 03 2017 08:51:25.004:DEBUG [temp-dir]: Cleaning temp dir /var/folders/2p/c2fzdtmx6837gcbf314_x5rm0000gn/T/karma-87724249 02 03 2017 08:51:25.029:DEBUG [launcher]: Finished all browsers matt ~/development/public/pact-js ? echo $? 0 ```

matt
2017-03-01 21:52
It?s only with the browser console open (devtools) that I get those cancelled requests

matt
2017-03-01 21:53
but they definitely are being called when I look at the mock server logs

timbailey
2017-03-01 21:53
Yep, the tests succeed, the change I made was to resolve the cancelled requests

matt
2017-03-01 21:53
I haven?t pulled that in though

timbailey
2017-03-01 21:54
Yeah, so even with cancelled requests it passes, just feels ugly, so I was on a mission to track it down!

matt
2017-03-01 21:54
ahh, right

timbailey
2017-03-01 21:54
So I can fix the cancelled requests, but that means that I have to move the verification stuff to afterAll

matt
2017-03-01 21:55
it?s weird seeing that, I agree, but the calls are definitely coming in to the Ruby process to verify: ``` matt ~/development/public/pact-js ? tail -f logs/mockserver-integration.log | grep -i verif I, [2017-03-02T08:53:58.789041 #37484] INFO -- : Verifying - interactions matched for example "" I, [2017-03-02T08:54:09.463187 #37526] INFO -- : Verifying - interactions matched for example "" I, [2017-03-02T08:54:09.486408 #37526] INFO -- : Verifying - interactions matched for example "" I, [2017-03-02T08:54:09.507567 #37526] INFO -- : Verifying - interactions matched for example ??```

timbailey
2017-03-01 21:56
My guess is that the response is being sent and being read by chrome, but causes the "cancelled" to show as it reuses the XMLRequest object to start another request

timbailey
2017-03-01 21:56
So might be just a devtools issue?

matt
2017-03-01 21:57
could be

matt
2017-03-01 21:58
we should try for a failure to ensure the request/response is indeed working

matt
2017-03-01 21:59
hmm so maybe there _is_ a problem.

timbailey
2017-03-01 22:00
What are you seeing

matt
2017-03-01 22:02
I commented out the test body in the `should say hello` test so that it wouldn?t call the expected endpoint. The tests all still pass

matt
2017-03-01 22:03
Just toying with it now

matt
2017-03-01 22:35
ok getting it to fail was easy, looks like I?m assuming promises work the same here - clearly not

matt
2017-03-01 22:35
``` it("should say hello", function(done) { //Run the tests done() // client.sayHello() // .then(function (data) { // expect(JSON.parse(data.responseText)).toEqual({ reply: "Hello" }) // done() // }) // .catch(function (err) { // done.fail(err) // }) }) // verify with Pact, and reset expectations it('successfully verifies', function(done) { provider.verify() .then(function(a) { done() }, function(e) { throw e }) }) }) ```

matt
2017-03-01 22:36
_(that was from 30mins ago before I hopped off the train)_

timbailey
2017-03-02 00:20
Still having issues, not sure whats causing them

timbailey
2017-03-02 00:21
Some kind of timing issues, rerunning the tests sometimes succeeds, sometimes fails 1 test

timbailey
2017-03-02 00:21
When it fails I see this in the verification call... ```Actual interactions do not match expected interactions for mock MockService. Missing requests: PUT /unfriendMe See /home/tim/Projects/timbailey-pnk/pact-js/logs/mockserver-integration.log for details.```

timbailey
2017-03-02 00:22
I've tried various ways of trying to ensure the interactions are set, then the test is run, then the interactions are verified

timbailey
2017-03-02 01:08
Ok, can you have a look at this....

timbailey
2017-03-02 01:09
Reorganised the test to make sure the requests to the mockServer are happening in the correct order. This for me is 4/4 passed

abubics
2017-03-02 01:09
sounds like a job for screenhero, when someone's free :wink:


matt
2017-03-02 01:26
thanks @timbailey i?ll take a look tonight (sorry can?t do much whilst at work)

matt
2017-03-02 01:26
One thing I just thought of - does this work if you enable `singleRun`?

timbailey
2017-03-02 01:27
Yep

matt
2017-03-02 01:27
That would explain the need for: ``` beforeAll(function (done) { ... provider.removeInteractions() ```

matt
2017-03-02 01:28
because interactions from the last test (aka the `PUT /unfriendMe`) are still hanging around for the start of the next run

timbailey
2017-03-02 01:28
Yeah


timbailey
2017-03-02 01:28
Singlerun works.... PhantomJS complains of JS syntax error checking.

timbailey
2017-03-02 01:29
Perhaps you can send me the docs you were talkin gbaout yesterday regarding the "Plugable Protocol Engine", so I we can see whats going to be involved


matt
2017-03-02 01:30
ok there?s nothing yet on "Plugable Protocol Engine? but in terms of supporting other features in Pact i?d start at https://github.com/pact-foundation/pact-specification/tree/version-3



timbailey
2017-03-02 01:33
(PhantomJS issue seems to be because I used arrow functions....)


matt
2017-03-02 01:33
good to hear :slightly_smiling_face:


matt
2017-03-02 01:35
gotta run man. Should we organise a call \ hangouts or something? Keen to hear more about what you?re doing and see what we can do?

timbailey
2017-03-02 01:37
Groovy, will read the docs and we can chat about what we trying to do and what we need

timbailey
2017-03-02 01:37
Thanks

timbailey
2017-03-02 03:26
I made a PR for you to review....


timbailey
2017-03-02 03:27
But it breaks the unit tests for the "Request" object. So will need to figure out how to test that

matt
2017-03-02 08:16
Thanks @timbailey, I?ve taken a look at the tests. I?m not sure it?s all necessary but I?ll look in more detail. I can see why we might want to create a new request each time

matt
2017-03-02 08:17
in the meanwhile, I?ve pushed up a small change to allow the `singleRun: false` scenario

timbailey
2017-03-02 20:57
Hi, The only way I could get the tests to be reliable was to closely control the requests going to the mockservice, seems like in Karma/Jasmine occasionally the tests would be run overlapped and this would cause the verify/removeinteractions to happen in the middle of the next test causing "missing interaction" errors

timbailey
2017-03-02 20:59
It is possible that by "fixing" the cancelled requests in Chrome I've then allowed the requests to overlap? ie The old way of reusing the same XMLHttpRequest actually enforces some kind of serialization of requests.....

thadir
2017-03-24 14:05
has joined #general2

thadir
2017-03-24 14:20
Goodday, thanks for letting us be part of the PACT Hosted Beta. Next week ill start implementing some of our pact test to go to the broker. I did have one question, at the moment we got err a realy technical user and password system from you will there be a more user friendly system. (I know now for the beta its fine and my team are for now the only ones that use it) but if were going to let the whole orgonisation and in the future also our clients use Pact it would be a nice to have to have a form of account magement in the pact broker website.

matt
2017-03-25 09:44
Hi @thadir, you?re most welcome! The short answer is yes, we are looking into other forms of authentication and access controls. But for now, and at least the few months, the system user is all we have.

willmadison
2017-03-28 12:56
has joined #general2

thadir
2017-04-05 13:42
we have been playing around with the pact and were running in some issus about how the broker things versioning should be done. It seems it wants semantic version numbers. However we dont use that we use the date + hash of commit (for maser builds) and for pull request its <pull-request name> - build number-SNAPSHOT. Now it seems there is a mismatch. Any ideas I really don't want to introduce semantic versioning in our pipeline, because its weird for automated systems (only shared libraries get a semantic versioning in our system).

rholshausen
2017-04-06 05:18
@thadir I'm going to bounce this question to the Pact Broker main contributor, but my guess is that won't work at the moment.

vinny
2017-04-06 05:31
has joined #general2

abe
2017-04-06 11:47
has joined #general2

harryw
2017-04-06 13:15
has joined #general2

beth
2017-04-06 23:23
has joined #general2

beth
2017-04-06 23:26
@thadir You can write your own version parser - I made this configurable because I knew at some stage, people would want to use something other than semantic versioning. Let me throw together a page on the wiki, and I'll post the link.


matt
2017-04-06 23:41
Only problem is, you can?t customise the version parser on our hosted broker

matt
2017-04-06 23:41
?at least not yet

thadir
2017-04-07 07:43
@matt then we have a chalange there :wink:. For now we found a workaround. Becouse we realy want to use PACT but for its all good.


abe
2017-04-07 08:15
thx for granting access to the beta i look forward to getting my tests up and shared with the team :slightly_smiling_face:

abe
2017-04-07 12:37
I have gotten a moc and test working and made a pact file

abe
2017-04-07 12:38
but i now need to upload to pact broker

abe
2017-04-07 12:38
how ever the curl i constructed give me a 405

abe
2017-04-07 12:39
here is the formula i used

abe
2017-04-07 12:39
curl -v -u 'user:pass' -XPUT \-H "Content-Type: application/json" -d@pact.json brokerURL

abe
2017-04-07 12:40
based on the example from the http://pact.io documentation

abe
2017-04-07 12:41
i am very new to pact so i apologies if this is common knowledge

matt
2017-04-08 00:09
: Hi all, the OSS Pact Foundation team are conducting a short survey on Pact usage in order to improve the product and drive the roadmap. So far the feedback has been great and we have identified lots of pain points to addres. Please if you could spare 5 minutes, head over to https://goo.gl/JD5tuk - we?d _really_ appreciate it!

matt
2017-04-08 00:09
@matt pinned a message to this channel.


matt
2017-04-08 00:13
Might be a formatting issue on that page the slash in `\-H` is not necessary

fitzoh
2017-04-08 02:41
@thadir this was my stab at writing a custom versionomy parser (disclaimer: I don't know ruby at all) ``` def test_parsing_custom_snapshot_format format_ = ::Versionomy.default_format.modified_copy do field(:release_type, :default_value => :final, :requires_previous_field => false, :delimiter_regexp => '-') do recognize_regexp(:development, 'SNAPSHOT', :development) end end value1_ = ::Versionomy.parse('3.0.1-SNAPSHOT', format_) assert_equal(3, value1_.major) assert_equal(0, value1_.minor) assert_equal(1, value1_.tiny) assert_equal(:development, value1_.release_type) value2_ = value1_.format.parse('3.0.1') assert_equal(3, value2_.major) assert_equal(0, value2_.minor) assert_equal(1, value2_.tiny) assert_equal(:final, value2_.release_type) end end ```

fitzoh
2017-04-08 02:56
@abe do you have a path after your `brokerURL`?


fitzoh
2017-04-08 02:57
If you look at the example from there ^, you'll see it has a url path with the provider, consumer, and version ```curl -v -XPUT \-H "Content-Type: application/json" \ -d@spec/pacts/a_consumer-a_provider.json \ http://your-pact-broker/pacts/provider/A%20Provider/consumer/A%20Consumer/version/1.0.0```

thadir
2017-04-10 08:37
@fitzoh I had dabled in it a bit. But seeing its hosted, I think we need to make it dynamic and configurable. I know Ruby allouws for regex etc. Im more Java and Angular2 my self. But I think we can figure this out to make this configurable :slightly_smiling_face:

abe
2017-04-10 09:51
@fitzoh it was the path that i got wrong

abe
2017-04-10 09:51
i had not realised the url dictated so much

abe
2017-04-10 09:52
I take it there is no way to create users for the broker so each team can only edit there own pacts

abe
2017-04-10 09:54
@matt i was using the git hub read me but it was not very clear as to its requirements what solved it for me in the end was random blog post

matt
2017-04-10 09:54
Looks like we need to make things a bit clearer!

matt
2017-04-10 09:55
Thanks for letting us know. Which blog post btw?

matt
2017-04-10 09:56
If you think about it, your creating a resource so the path is important (there are other API end points also). We should publish an API doc I think

abe
2017-04-10 12:56
now that i know its really obvious

abe
2017-04-10 12:56
and when i go back to he documentation i see it now

abe
2017-04-10 13:01
is there a way to create users per consumer so each consumer can only upload there own pacts?

abe
2017-04-10 14:36
one other question out to the community but has any one got the provider test validation working with the:


abe
2017-04-10 14:37
we have tried stable and pre release

abe
2017-04-10 14:37
hacking it for certain URLs

abe
2017-04-10 14:37
by hard coding the /latest



matt
2017-04-11 09:05
@abe I?ll look into this, can you please raise a bug with logs/output etc.?

matt
2017-04-12 08:38
@abe did you raise that issue? I just pulled the latest binary and ran an integration test and that published just fine

matt
2017-04-12 08:40
If you check out the integration test in examples that might help


matt
2017-04-12 08:40
That contains a broker publish before verification

matt
2017-04-12 08:41
if you want to prove that publishing worked, run a delete on that consumer + provider: ``` curl -v -XDELETE -u 'dXfltyFMgNOFZAxr8io9wJ37iUpY42M:O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1' https://test.pact.dius.com.au/pacticipants/bobby curl -v -XDELETE -u 'dXfltyFMgNOFZAxr8io9wJ37iUpY42M:O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1' https://test.pact.dius.com.au/pacticipants/billy` ``` Then head over to https://test.pact.dius.com.au/ui/relationships to see that they?re gone before running the tests

patrick
2017-04-12 10:46
has joined #general2

marcevers
2017-04-12 12:51
has joined #general2

m.pleijte
2017-04-13 11:08
has joined #general2

gtondi
2017-04-14 10:13
has joined #general2

abe
2017-04-19 13:27
@matt we found the problem is slightly lacking in the documentation department

abe
2017-04-19 13:27
in the end we got it all working but there was a lot of trial and error

abe
2017-04-19 13:33
out of curiosity is there a way to access the pacts as consumable services

abe
2017-04-19 13:34
so we have a /login_customer end point

abe
2017-04-19 13:34
is there a way to access the endpoint mock via the broker?

matt
2017-04-19 22:31
No - but that is on the roadmap! I?m so glad you asked :slightly_smiling_face:

abe
2017-04-20 07:37
sweet sweet

abe
2017-04-20 07:37
that is going to probably be one of the most useful features

matt
2017-04-20 07:38
I reckon!

abe
2017-04-20 07:38
we hopeing to fully pact all endpoints in the next couple of weeks

matt
2017-04-20 07:38
oh wow, that?s amazing!


abe
2017-04-20 07:38
could be wishful thinking

abe
2017-04-20 07:39
fingers crossed :slightly_smiling_face:

matt
2017-04-20 07:39
:smile:

thadir
2017-04-25 09:57
I have been wondering is there a reason there is a version number in the pact-jvm-provider artifactID for maven?

matt
2017-04-25 09:59
Hmm not sure. Compatibility with other jobs I'm guessing. This question might be best asked on the gutter channel for that project tho

matt
2017-04-25 09:59
Jobs = Jars

matt
2017-04-25 09:59
Or libs (take your pick)

thadir
2017-04-25 10:00
:slightly_smiling_face:, eather is good, but for that I would expect difrent methods. Ill poke them about it. were slowly getting pact forged in our processes. How is the status on the custom versioning numbers for hosting? I know the pact-broker supports it but for the hosting its still a challange.

matt
2017-04-25 12:01
Ah sorry, I was on the go. From memory the versioning in the artifact ids relate to Scala stuff like 2_10/2_11 or something like that?

matt
2017-04-25 12:02
yup it?s to do with Scala runtime compatibility

matt
2017-04-25 12:03
As for the versioning, I?ve no update other than to say we?ve captured that request. Have you any suggestions as to how we might implement it to meet your needs?

matt
2017-04-25 12:04
I?m thinking it could be a toggle set via the UI from a set of pre-defined versioning schemes. Or potentially even better, the ability to specify a scheme via regex

lukvermeulen
2017-04-25 12:48
has joined #general2

beth
2017-04-26 01:15
Hi , I am looking for some broker users to try out a beta version of the pact broker that will include the ability to record and visualise provider verification results. Please join me in the #verifications channel if you are interested.

beth
2017-04-26 01:16
@thadir what sort of versioning scheme are you using?

thadir
2017-05-01 13:43
@beth ya dont wanna know :sweat_smile: bit messy how we do it. For master builds we use a part of the build of the Git HASH, for release builds we use symantic builds. So we need both options to work for us (sorry for the late response, it was a national holiday here in the netherlands)

mouser
2017-05-02 01:30
has joined #general2

trenthornibrook
2017-05-02 01:33
@mouser is the TL at Irexchange

mouser
2017-05-02 01:50
hey guys!

matt
2017-05-02 01:51
hey @mouser!

beth
2017-05-02 05:42
thadir: oh mah lord! Um. I can't think of a way to order git shas.

beth
2017-05-02 05:43
the only way to sort would be by date.

beth
2017-05-02 05:44
The version object needs to respond to sort, not just be parseable.

thadir
2017-05-02 09:04
I Warned you its not pritty :sweat_smile:, So master builds have the folowing: 2017-05-01_16-33-40dad2e 2017-05-01_16-25-40dad2e They have the time stamp in there, but it would be more convient that we could sort on the date setted in the system. Symantic versions for releases are like 1.0.1. Then snapshots are err even worse in our case: security-api-PR-17-20170502.080752-1

thadir
2017-05-02 09:04
security-api-PR-17-20170502.080752-2


thadir
2017-05-02 09:04
So yeah, its messy I have no controll on this. To big a thing to not have symantic versions in there.

mouser
2017-05-02 23:46
hey guys, we?ve noticed that the icon for accessing a PACT on the broker homepage seems to have gone walkabout after the upgrade? could someone take a look for us?

abubics
2017-05-02 23:53
mmm same here

abubics
2017-05-02 23:54
you can still get to it by drilling through a consumer/provider, then the arrow between the pair you want

matt
2017-05-03 00:04
Thanks guys

matt
2017-05-03 00:05
I?ll raise an issue on the pact_broker repo, I?ve noticed the same

matt
2017-05-03 01:24
I?ve submitted a patch for that display issue, I?m not _quite_ sure what is going on there, but it seems jq is not firing the right event to attach the icon


mouser
2017-05-03 08:26
Thanks!

matt
2017-05-03 08:45
No worries, we should be able to update the hosted version in the next day or two

thadir
2017-05-03 09:44
@matt about the hosted version, how far along are you guys with the user management at the moment we only have this basic http autentication protecting it all. And for now its good (Its still a pilot at all) but I sort of want the publisher to have the richts of publising and viewer to only see stuff etc.

matt
2017-05-04 00:27
mouser: I?ve just upgraded your instance, your links should have returned!

mouser
2017-05-04 03:44
It certainly has @matt - thanks again!

matt
2017-05-04 03:44
No worries!

beth
2017-05-05 00:52
@thadir I'm just working on creating separate read/write basic auth accounts, but they won't be resource specific.

beth
2017-05-05 00:53
both consumer and provider accounts will be publishing _something_ when we release the verifications stuff.

beth
2017-05-05 01:34
I've just released version 1.18.0.beta.1 of the broker gem with basic auth built in. The documentation is available here: https://github.com/bethesque/pact_broker/wiki/Configuration#using-basic-auth

matt
2017-05-05 01:34
nice one!

beth
2017-05-05 01:35
You can configure multiple users against multiple scopes (ie. read, write, diagnostics, all app)

beth
2017-05-05 01:35
We'll add it to the docker config as soon as we've given it a road test.

abubics
2017-05-05 01:36
sounds kinda like some people want read/write accounts (for provider/consumer publishers) and read-only accounts to just view everything on the broker . . . that sounds efforty

abubics
2017-05-05 01:39
but I guess full granular auth would be cool, too :stuck_out_tongue:

beth
2017-05-05 01:40
Yes, some people only want to protect the write requests. Some people want to allow devs to read/write and other users to just read. This will support all of those options.

beth
2017-05-05 01:41
One day we might add consumer/provider specific based auth.

beth
2017-05-05 01:41
but that day is not today!

beth
2017-05-05 03:50
Hm... I'll have a think. The sorting algorithm would need to have different arguments in your case - that's the complicating factor. At the moment, the version parsing code only needs the version itself. Then, we sort on the outcome of that parsing.

beth
2017-05-05 03:51
You need to sort on an entirely different column.

marcevers
2017-05-05 06:45
hi, yesterday we tried publishing a pact with an invalid version to the hoster broker and we noticed that error responses from the broker are not processed correctly any more by the pact-jvm-provider maven plugin (we're using version 3.3.8). It fails with "Execution default-cli of goal au.com.dius:pact-jvm-provider-maven_2.11:3.3.8:publish failed: No signature of method: groovy.json.internal.LazyMap.join() is applicable for argument types: (java.lang.String) values: [, ]"

rholshausen
2017-05-05 06:50
@marcevers Can you raise that as an issue at https://github.com/DiUS/pact-jvm

beth
2017-05-05 11:41
I've had a think about this, and you have two options. One is you can do a little code hack as per this example here: https://gist.github.com/bethesque/31c2d00f93bb6168cbbc645bcbc08688

beth
2017-05-05 11:43
The second is that you can append/prepend a consistent timestamp to every one of your version formats when you publish to the broker. Then you can configure the version parser to extract the consistent date part, and the rest of the code will use that to sort on.

thadir
2017-05-08 17:03
beth: Hmm the documatation link is a tad broken becouse its not on you repo or on the pact-foundation wiki it self

thadir
2017-05-08 17:04
@rholshausen We have issu can be found @https://github.com/DiUS/pact-jvm/issues/421

beth
2017-05-12 05:45
@thadir I've added in code to allow sorting by creation date of the application version.

beth
2017-05-12 05:45
I've made it configurable - we just have to decide how we're going to manage configuration for the saas brokers.

beth
2017-05-12 06:15
Sorry @thadir, after discussing with @matt and @rholshausen I decided to back the changes out and wait until we did proper user authentication. I meant to revoke my announcement on Monday, but I got sidetracked.

thadir
2017-05-12 08:31
Thats ok, no rusing, :slightly_smiling_face: just a feature I realy want :slightly_smiling_face: hence me asking.

thadir
2017-05-12 08:34
Ok, yeah I figured you sort of needed a new colmn. I think we sort of need a extra UI for configuring the broker in saas or somting (thats what we do with our hosted dockers as well btw).

matt
2017-05-12 12:51
Rest assure this is high on our roadmap @thadir. Verifications was something we needed to bring to the entire community first, but user management is in progress as it is a common feature request.

thadir
2017-05-12 12:52
I know, just telling it as it is. Were slowly ramping up the usage. So version if for us a bigger then then autentication. But thats becouse the nature for us how we do versions.

matt
2017-05-13 03:07
Please keep the feedback coming! This request came through in a couple of comments recently in our public survey. We are looking at strategies to enable multiple types of versioning and managing configuration via APIs or user interfaces. Keep your ears peeled, we will likely get in touch with you to discuss this further

beth
2017-05-16 05:01
Hi all. We're looking at adding "proper" auth to the pact broker. Please join me in the #auth channel and let me know what providers you'd like the broker to integrate with.

fitzoh
2017-05-17 05:14
I just saw this pr: https://github.com/pact-foundation/pact_broker/pull/88... Does that mean that custom version parsing is going away?

matt
2017-05-17 05:41
Beth assures me that custom version parsing is still there, as per before

beth
2017-05-17 05:44
Oh, right, now I get what you were saying @matt.

beth
2017-05-17 05:44
@fitzoh the default parser has been upgraded to work with semver2, but custom parsing still works as before.

matt
2017-05-17 05:45
I realised the way I sent it was probably a little bit misleading, but it all worked out :slightly_smiling_face:

beth
2017-05-17 05:45
You may not need custom parsing any more with the upgraded parser @fitzoh

fitzoh
2017-05-17 05:46
cool cool

beth
2017-05-17 05:46
Out of interest, what versioning scheme to you use?

fitzoh
2017-05-17 05:46
java: `-SNAPSHOT`

fitzoh
2017-05-17 05:46
but I just put in a PR that will make that a non-issue for me: https://github.com/DiUS/pact-jvm/pull/431 cc @rholshausen

beth
2017-05-17 05:46
Yeah, ok, you'll still need the custom one.

fitzoh
2017-05-17 05:48
I'd have to imagine that's a pretty common issue if any other java people are using the pact broker (unless they're just not publishing non-release pacts)

fitzoh
2017-05-17 05:48
or using gradle, which makes stripping the SNAPSHOT off a lot easier

beth
2017-05-17 08:33
Pretty close to getting your versions sorting by date @thadir

beth
2017-05-17 08:34
Hopefully deploy it on Friday

thadir
2017-05-17 08:35
Great to hear, looking forward to it :slightly_smiling_face:, I must say were quite happy how things are working out with Pact and the broker so keep up the good work.

beth
2017-05-17 09:13
The new version parser allows you to configure multiple patterns for it to look for. We could potentially get it to work around the SNAPSHOT. I'll have a look at it.

beth
2017-05-17 09:14
I'm not a java person, can you send me a couple of examples of the full string?

matt
2017-05-17 09:31
It?s a fully semver compatible string

matt
2017-05-17 09:31
usually like `1.0.0-SNAPSHOT`, but can have other metadata

matt
2017-05-17 09:32
e.g. `1.0.0-SNAPSHOT+127` for something like build 127



matt
2017-05-17 11:07
Thanks @thadir!

thadir
2017-05-17 11:08
@matt I think we should tahnk you origonaly the plan was to manage a docker in our own envyroment, and I think ousourcing it is a lot better helps the comunity and development of Pact and helps us help and you helping us. Its a nice 2 way street :wink:.

matt
2017-05-17 11:09
that?s the idea!

matt
2017-05-17 11:11
FWIW we want to be as transparent as we can. At some point, there will be a paid offering with some of these ?Enterprise? features, if you will. There will be a free tier, but in terms of pricing our aim is to make it cost neutral in order to support development efforts and cover hosting etc.

thadir
2017-05-17 11:12
@matt We filled in the form, and I am willing to pay for it (e.g. the comapny witch hired me as well) so no biggy :wink:. Beta is a nice play ground, but when its stable we want you to take the money to keep the service going.

matt
2017-05-17 11:13
That?s really great to hear, and thanks for being such a great promoter!

thadir
2017-05-17 11:14
I fixed it to do it totaly difrent @matt and @beth my snapshots are named like this: PR-20-20170516.134509-7 (where PR is the pull request number of the given articadt0 the date is the build date and the 7 is the amount of build attempt it is. Versioning in Maven is quite free flow tbh. So if you need input we got a java engineer here to spare to help out with questions.

matt
2017-05-17 11:15
oh deary me, looks like my advice was _way_ off!

thadir
2017-05-17 11:25
@matt its so flexible you can do it in many ways, in our company we dont think in snapshots for our test builds, but in pull request seeing a snapshot is local and pull request is part of our flow to bring it to master (and thus production)

matt
2017-05-17 11:25
yeah makes sense - i didn?t realise the scheme was that flexible!

thadir
2017-05-17 11:33
It is, its less flexable then Ant and Gradle but if you want you can go far -_-

eskimoquinn
2017-05-19 16:08
has joined #general2

eskimoquinn
2017-05-19 16:15
Hopefully this is the correct place for this. I am trying to download pact files from my hosted pack broker using pactbroker-maven-plugin. I am able to upload with this plugin, but cannot download. I receive an HTTP response of 406 NOT ACCEPTABLE. Any help? Known issue?

thadir
2017-05-19 16:44
@ you need to add the folowing to your maven config:

thadir
2017-05-19 16:48
In this case you should add the folwogin maven command to your commandline build: -Dpact.broker.username=<username> -Dpact.broker.password=<password>

eskimoquinn
2017-05-19 18:29
:+1: we are trying that now

matt
2017-05-20 01:42
How did you go @eskimoquinn?

beth
2017-05-21 05:50
@eskimoquinn @matt @rholshausen That might be to do with that content type issue issue that Ron discovered where it was returning a 406 when application/hal+json was being requested (and only "application/json" was provided). Let's upgrade the broker.

rob.lugton
2017-05-22 07:02
has joined #general2

rob.lugton
2017-05-22 07:09
Hi all, has anyone ever used pact with graphql (http://www.graphql.org) before?

trenthornibrook
2017-05-22 07:09
or pacts between some browser js like React and APIs?

rholshausen
2017-05-22 07:10
No, but we have discussed that graphql is maybe not a good candidate for contract tests

trenthornibrook
2017-05-22 07:11
why not a good candidate? Because theres some validation built in? like https://github.com/graphql/graphql-js/tree/master/src/validation

thadir
2017-05-22 07:24
@eskimoquinn I wonder did it work out?

rholshausen
2017-05-22 22:45
Yes, you define the schema so it validates it for you. Some for Google protocol buffers.

beth
2017-05-24 03:41
@trenthornibrook yes, I've used pact between a react UI and an api. The react is kind of irrelevant really.

beth
2017-05-24 03:41
Hi @rob.lugton! Welcome.

beth
2017-05-24 03:43
@thadir all going smoothly with the latest version?

abubics
2017-05-24 04:23
@beth @trenthornibrook: totally agree, React should be irrelevant for Pact. If your app is architected nicely, the services that talk to APIs shouldn?t be touching UI.

thadir
2017-05-24 08:20
@beth we didnt have a chance yet, but it will happen soon. No complains up to now but we didnt add new tests to the suite or masterbuilds.

jfeng
2017-05-25 06:31
has joined #general2

lardcanoe
2017-05-25 11:37
our services communicate using graphql and we are using pact just fine.

eskimoquinn
2017-05-31 19:07
Anybody know when the "last verified" time is updated for a pact in the broker UI? We are verifying the pacts on the provider side, but that time does not seem to be updated in the broker UI. We are using the pact-jvm-provider-maven plugin.

shashidesai
2017-05-31 20:42
has joined #general2

rholshausen
2017-06-01 00:05
@eskimoquinn pact-jvm doesn't support publishing verification info yet

eskimoquinn
2017-06-01 00:20
thadir: Yes we were able to get it working. Thanks!

eskimoquinn
2017-06-01 00:20
ok thanks!

eskimoquinn
2017-06-01 00:25
I raised an issue in github, but I am wondering if perhaps someone here would be able to help also. This link (https://github.com/pact-foundation/pact-provider-proxy/issues/7) has my code snippets, but basically I want to verify a pact against a remote service (from our CI test suite). The pact has provider states and I want to call the remote service to verify the pact. The pacts that do not have provider states work as I would expect, however, the pact with the provider state does not.

matt
2017-06-01 00:46
Looks like Ron has responded. Hopefully we?ll have the JVM verifications out soon - lot?s happening at the moment!

eskimoquinn
2017-06-01 20:22
In reply to the pact-provider-proxy, I was able to get things working by explicitly declaring the pact_states file in the rake task. So probably not a bug per se, but not quite how the documentation described it.

beth
2017-06-03 01:05
@eskimoquinn the documentation actually does describe it in the README. Is there somewhere else that contradicts this that I've missed?

eskimoquinn
2017-06-03 01:39
@beth I did see the original note but I think we were having two simultaneous problems which were obscuring that we mis-configured the helper. The README is clear. Thanks for the help!

eskimoquinn
2017-06-03 01:41
And for everyone here, we are going to be adopting pact on our team and trying to spread it to the other devs in our org. Excited to use pact.

matt
2017-06-03 01:42
That?s great to hear @eskimoquinn - feel free to reach out if you need any help with that!

coco
2017-06-05 05:42
has joined #general2

stein
2017-06-05 22:26
has joined #general2

stein
2017-06-05 22:33
Hi guys, what?s the correct way to delete a webhook? I am using the hosted broker and calling `DELETE https://<subdomain>.http://pact.dius.com.au/webhooks/DDrB0LyxhMmEDKeQos3U8Q` gives me ``` { "message": "undefined method `delete_executions_by_webhook_uuid' for #<PactBroker::Webhooks::Repository:0x000000040925c8>", "backtrace": [ "/home/app/pact_broker/vendor/bundle/ruby/2.2.0/bundler/gems/pact_broker-0d2479decb12/lib/pact_broker/webhooks/service.rb:34:in `delete_by_uuid'", "/home/app/pact_broker/vendor/bundle/ruby/2.2.0/bundler/gems/pact_broker-0d2479decb12/lib/pact_broker/api/resources/webhook.rb:27:in `delete_resource'", "/home/app/pact_broker/vendor/bundle/ruby/2.2.0/gems/webmachine-1.4.0/lib/webmachine/decision/flow.rb:399:in `m20'", ... } ```


matt
2017-06-05 22:38
Could be a bug in the broker, if you DM me I can look into it for you and we can look to create a patch.

mouser
2017-06-09 10:33
Love the new feature in the broker to create/edit webhooks. Thanks!

eskimoquinn
2017-06-09 20:06
Hey PACT folks, we would love to be able to add specific notes about using the service to our autogenerated pact documentation in the broker. We currently add usage notes which provide additional explanatory text about the service. Is there anyway to do this currently?

matt
2017-06-10 04:25
This has come up a few times, actually were you asking this on Gitter by any chance? At the moment, this feature doesn?t exist but we?ll pop it into a backlog and see where we might be able to fit it in. Which language do you use?

eskimoquinn
2017-06-12 20:11
@matt we are using java on the consumer side and ruby on the provider side. So of immediate use for use would be the jvm-consumer

matt
2017-06-12 23:18
Thanks @eskimoquinn

beth
2017-06-12 23:53
@eskimoquinn Great idea.

beth
2017-06-13 00:08
eskimoquinn: At one stage I was planning to add a consumer/provider documentation URL to the configuration. Given that the text could be quite long, would a URL meet your needs?

eskimoquinn
2017-06-16 17:02
I ran into what I think is a bug with the JVM consumer. When I supply an example value in the matchHeader method of the fragment, the reponse body is escaped in the pact JSON: ``` .willRespondWith() .status(200) .matchHeader("Content-Type", "application/json", "example")``` produces: ```"body": "{\"jobId\":\"345\"}",```. Without the example, the JSON looks like ``` "body": "{"jobId":"345"}",```


matt
2017-06-18 07:09
That?s a bit weird, although this _seems_ familiar. Thanks for raising

beth
2017-06-18 22:09
eskimoquinn: I'm guessing it's because it uses the example header to determine the content type of the body, and your example suggests it's not json, so it's being encoded as a string.

eskimoquinn
2017-06-19 14:45
Yes confirm that to be true. I assumed that example would not actually control anything other than a display. Thanks!

jdbann
2017-06-22 13:48
has joined #general2

jdbann
2017-06-22 13:50
hi! just been sent over from the pact gitter

jdbann
2017-06-22 13:51
has anyone used pact with graphql? looking at setting my teams up but we?re migrating the api to graphql later in the year and don?t want to create a headache at a later date

rholshausen
2017-06-22 22:27
@jdbann as far as I understand, GraphQL uses HTTP so you could in theory use Pact. But my thoughts are that, as the schema is defined as part of the protocol, you don't need a contract test.

phil
2017-06-23 10:30
has joined #general2

phil
2017-06-23 10:32
Hi People. I've used the Pact Broker a few times in the past but never set one up. I've just asked for (and got) your free hosted pact server. I want to publish to it using 'scala pact'. Do you know if that is possible (I'm having problems setting up the credientials)

beth
2017-06-23 10:42
@rholshausen should be able to help you.

beth
2017-06-23 10:43
What is the issue?

phil
2017-06-23 10:55
Thanks for responding! It's a pretty simple issue: there doesn't appear to be a way using scala pact to specify credentials. I've looked at the manuals and quickly looked at the code. I wondered if anyone had any experience with this? At the moment I've just dropped back to using curl to push the files which works well enough

beth
2017-06-23 11:04
Ah, that is quite possible. The Scala pact stuff was written a while ago, and hasn't been updated as often or as recently as the other jvm code. It shouldn't be too hard to add though. Can you raise an issue in the repo?

phil
2017-06-23 11:06
I'll make a pull request first and then raise it


beth
2017-06-23 11:06
Thanks Phil! Even better.

phil
2017-06-23 11:06
What auth do you take?Basic Auth sucks but it is really simple.

beth
2017-06-23 11:08
Basic for now. We're just doing a JWT spike for an authentication service we're evaluating for use with the hosted broker.

beth
2017-06-23 11:08
Proper authentication is the first priority on our feature list.

phil
2017-06-23 11:09
Probably a good idea. Well thank you. Good luck with your JWT

beth
2017-06-23 11:10
Cheers.

fitzoh
2017-06-25 15:05
Is there an easy way to make a "read-only" view of a pact broker?

fitzoh
2017-06-25 15:06
I was thinking it'd be kind of a cool showcase if there was a publicly viewable pact broker which managed pacts for the pact ecosystem

fitzoh
2017-06-25 15:07
I should be able to go there to see the interactions between a `pact-broker` provider and a `pact-jvm` consumer

j03w
2017-06-26 01:32
has joined #general2

j03w
2017-06-26 01:34
hi folks, our broker has been returning 500 since this morning any ideas how we can debug this?

beth
2017-06-26 01:37
I'll have a look at it now.

beth
2017-06-26 01:38
Can you pm me your subdomain please?

beth
2017-06-26 01:51
Ok, should be fixed now.

beth
2017-06-26 01:58
Apologies, I got a bit overexcited deploying an authentication spike image.

fpelletier
2017-06-28 22:20
has joined #general2

fpelletier
2017-06-29 18:38
is it possible to modify the initial credentials?

rholshausen
2017-06-29 22:26
@fpelletier there is no self-service for credentials yet (we're working on it), but I'm sure @matt could help you out there

matt
2017-06-29 23:45
@fpelletier dm me privately and we'll sort you out


beth
2017-06-30 08:26
He's a looker, our Ron.

timothy.clifford
2017-07-02 23:26
_Lead QA_ :joy:

acooper106
2017-07-03 12:04
has joined #general2

mlk
2017-07-03 12:06
has joined #general2

beth
2017-07-04 03:46
Hey broker users, I'm looking at adding verification badges like this to the broker. Given that the badge would be accessed over the public internet, and you can't use basic auth in README markdown, would you consider it a privacy leak to access a badge without authentication?

abubics
2017-07-04 04:15
If all you?re leaking is a guid (or similar), I think it?s fine. (same leak as buildkite, which doesn?t mean it?s ok, but I also haven?t heard of any exploits)

fpelletier
2017-07-04 15:04
the documentation links for `pb:latest-provider-pacts` and `pb:latest-provider-pacts-with-tag` are broken :four: :zero: :four:

beth
2017-07-05 04:51
I probably haven't made them. Thanks for the reminder.

beth
2017-07-05 04:52
The documentation link shows whether or not a document actually exists at the given URL.


finkingma
2017-07-05 07:24
has joined #general2

mattcoder
2017-07-05 10:29
has joined #general2

mattcoder
2017-07-05 10:55
hey guys, great to join this group, i am stuggling with connecting dots with pactnet and pact broker, this is a cool place we can chat and meet with community poking this technology.

mattcoder
2017-07-05 10:56
:wink:

beth
2017-07-05 11:02
Hey Matt, happy to help out. Where are you getting stuck?

beth
2017-07-05 11:04
FYI, most of the core pact team lives in Australia, so if we are slow to respond, it's because we're asleep! But there should be some other people around who are awake if we aren't.

mattcoder
2017-07-05 11:15
Great to meet you Beth, i have an issue with connecting and post pact file to the pact broker

mattcoder
2017-07-05 11:17
the email i got from suggesting that using the curl command to post

mattcoder
2017-07-05 11:17
that is for linux but what about for microsoft platform

matt
2017-07-05 11:18
Hi Matt!

matt
2017-07-05 11:18
For reference, the APIs are documented here in case you haven?t seen https://github.com/pact-foundation/pact_broker/wiki/Publishing-and-retrieving-pacts

mattcoder
2017-07-05 11:18
hey matt, how are you doing

matt
2017-07-05 11:19
You?ll obviously need to transpose curl into `Invoke-WebRequest` or `Invoke-RestMethod` or similar

matt
2017-07-05 11:19
very well thanks - and you?

mattcoder
2017-07-05 11:19
oops, little strange with 2 matt greeting each other:-)

matt
2017-07-05 11:19
:slightly_smiling_face:

beth
2017-07-05 11:24
I believe there is a publish task in the pact net library.

mattcoder
2017-07-05 11:24
understood, using powershell script

beth
2017-07-05 11:24
Or you could have a play with the built in HAL browser.

matt
2017-07-05 11:26
I think something like this is what you want: ``` $JSON = Get-Content "path\to\pact.json" $response = Invoke-RestMethod -Uri "http://your-pact-broker/pacts/provider/A%20Provider/consumer/A%20Consumer/version/1.0.0" -Method Put -Body $JSON -ContentType "application/json" ```

beth
2017-07-05 11:27
I should add that to the docs somewhere.

matt
2017-07-05 11:28
I?ll see if I can get a working example here on a VM

beth
2017-07-05 11:35
Just pinged Neil to ask if there is a pact net task for publishing.

beth
2017-07-05 11:37
The publishing link for dot net here seems broken https://docs.pact.io/documentation/sharings_pacts.html

mattcoder
2017-07-05 11:37
@beth, yes, it is broken

beth
2017-07-05 11:37
It doesn't work on my phone anyway.

beth
2017-07-05 11:39
Will have a look at it tomorrow. Heading off now.

mattcoder
2017-07-05 11:40
thank you guy!!, truly appreciate your great response here

beth
2017-07-05 11:41
No problems.

matt
2017-07-05 11:56
@mattcoder here?s a working PoSH example:

matt
2017-07-05 11:56
``` $Headers = @{ Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("dXfltyFMgNOFZAxr8io9wJ37iUpY42M:O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1")))" } $res = Invoke-WebRequest -Uri "https://test.pact.dius.com.au/pacts/provider/Animal%20Profile%20Service/consumer/Matching%20Service/version/1.0.0" -Headers $Headers -Method Put -InFile .\matching_service-animal_profile_service.json -ContentType "application/json" ```

matt
2017-07-05 11:57
Pact file to go with it

matt
2017-07-05 12:00
you can then assess the result object e.g. ` $res.StatusCode`

finkingma
2017-07-05 12:13
hey guys, I started playing around with the new pact broker. However I am having trouble getting the 'last verified' option confirmed. 1) I started with an empty broker. 2) published a new pact. 3) had it validated with my provider. Everything went great so far (shown that it was verified). 4) published a new version of the pact.

finkingma
2017-07-05 12:14
However, once I tried confirming the changed version. The warning symbol kept showing up

matt
2017-07-05 12:15
I actually had this issue the other day myself, hoping Beth can clarify what?s happening here!

matt
2017-07-05 12:16
You might be able to use the HAL browser to navigate to the verifications API and see what it has to say

finkingma
2017-07-05 12:20
when posting a verification result using postman, I get a normal 201 status code with a nice json response, but my pactbroker still shows the warning sign

matt
2017-07-05 12:21
I?m suspecting maybe it?s something to do with versions, perhaps we?ve verified _a_ version but not the latest or something?

finkingma
2017-07-05 12:23
ow you're right. I've got two versions now. But the response I get when publishing shows the old version

finkingma
2017-07-05 12:29
same for the pact versions btw. I publish verification results for generated pact version '2b6a47a161a4141e76940912794301f9272a4070' (which is my latest pact). However, in my response I get a different pact version '2ba1d0b6642f276aec8ed56230a8bc48cf54efed' (which is my initial pact).

matt
2017-07-05 12:30
hmmm intriguing

matt
2017-07-05 12:30
I don?t know the underlying model well enough to understand, we?ll have to wait for @beth

matt
2017-07-05 12:30
I also need to run I?m afraid, I need to get this fixed also so will report back any findings!

matt
2017-07-05 12:30
all the best :slightly_smiling_face:

finkingma
2017-07-05 12:30
sure np, thx for help so far

abubics
2017-07-05 12:31
I?ve had a similar problem with version numbers

abubics
2017-07-05 12:31
when someone posted a high semver version, then posting 1.0.0 again seemed like nothing was wrong, but never updated in any of the UI

abubics
2017-07-05 12:32
but that was for a pact latest version, not verification

beth
2017-07-05 20:09
Yup, it's designed that way. The "latest" version is calculated by the semver, not the time stamp, unless you configure it to use the time stamp.

beth
2017-07-05 20:11
That sounds like a bug. I'll have a look at it as soon as I can.

beth
2017-07-05 20:12
I have been considering changing the default however.

matt
2017-07-05 22:13
If you want a test case, the `test` broker has the same problem for the `billy->bobby` relationship :slightly_smiling_face:

beth
2017-07-05 22:13
i fixed it already. just deploying.

matt
2017-07-05 22:14
you?re a freak

beth
2017-07-05 22:15
i hate outstanding bugs in my code! fixed it in my pjs :stuck_out_tongue:

fpelletier
2017-07-05 22:15
@beth good thing, thank you!

matt
2017-07-05 22:15
The best way!

beth
2017-07-05 22:24
as a sweetener folks, you can beta test the new verification badges I've just added. Here's one from the http://test.pact.dius.com.au server: https://test.pact.dius.com.au/pacts/provider/Activity%20Service/consumer/Foo%20Web%20Client/latest/badge.svg




beth
2017-07-05 22:27
And if you only want to see the consumer or provider name because you already know who *you* are, you can add `label=consumer` or `label=provider`: https://test.pact.dius.com.au/pacts/provider/Activity%20Service/consumer/Foo%20Web%20Client/latest/badge.svg?label=consumer


beth
2017-07-05 22:27
Or you can use both params to only have the consumer or provider initials.

beth
2017-07-05 22:28
Try it out and let me know what you think.

matt
2017-07-05 22:28
Is there a way to just check the status of all verifications for a single consumer i.e. ?pact|verified? implying all providers for the current consumer have been verified?

beth
2017-07-05 22:29
I was trying to work out the logic for that, and it became so complicated, I started with the simple pact status first.

beth
2017-07-05 22:30
If we can work out the logic, then I can easily add them. The problem is, there's no way of knowing which "latest" pact is the one that is the important one. Latest untagged? Latest master?

fpelletier
2017-07-05 22:30
simple question, does PactNet have the capability to publish a pact to a given pact broker?

beth
2017-07-05 22:30
I suspect not. I couldn't find it.

beth
2017-07-05 22:31
I only had a quick look last night on my phone though. Let me check if Neil has gotten back to me (he's one of the pact net authors)

matt
2017-07-05 22:31
@fpelletier see https://pactbroker.slack.com/archives/C47D4FGPR/p1499255790852938 for an example publishing via PoSH

matt
2017-07-05 22:31
I tested last night on the test broker account and it worked

matt
2017-07-05 22:31
@matt pinned a message to this channel.

fpelletier
2017-07-05 22:31
that would be a neat feature :slightly_smiling_face:

matt
2017-07-05 22:32
@matt pinned a message to this channel.

beth
2017-07-05 22:32
No reply from Neil yet, I'll let you know when he does. If there isn't one, we'll raise an issue and get it done.

matt
2017-07-05 22:32
It?s a pretty simple API, for a .NET superstar it shouldn?t take too long - PR?s are welcome :slightly_smiling_face:

matt
2017-07-05 22:33
With a cursory look at the code base, I don?t think publishing is supported

fpelletier
2017-07-05 22:33
we're currently exploring our testing strategies for our SaaS project

fpelletier
2017-07-05 22:33
Pact seems neat for our current needs

fpelletier
2017-07-05 22:34
thanks for the quick feedback :slightly_smiling_face:

matt
2017-07-05 22:34
You?re most welcome. Is it just a .NET project or do you have other languages also?


fpelletier
2017-07-05 22:37
@matt we're trying to restrain ourselves to supported M$ techs, but it doesn't mean that we will not go with other options if the .NET library is not good enough

matt
2017-07-05 22:38
OK. So all of the services you?ll be testing are in a single language, that will be helpful to know.

matt
2017-07-05 22:39
Woah - when did Pact NET become 2.0 compliant @beth ?? That?s awesome

beth
2017-07-05 22:39
Just the other day.

matt
2017-07-05 22:39
That?s amazing!

matt
2017-07-05 22:39
We should update the docs at http://docs.pact.io

fpelletier
2017-07-05 22:39
we don't have any implemented microservices yet, but sooner or later yeah

fpelletier
2017-07-05 22:40
I'm doing a proof of concept that will be reviewed by my colleagues

fpelletier
2017-07-05 22:41
probably driven by a .NET core stack

matt
2017-07-05 22:41
gotcha. Any JS/other front-ends that might consumer those services?

abubics
2017-07-05 23:38
it?s not a behaviour problem, it was just confusing . . . a warning that I?m doing something dumb might be all that?s needed :stuck_out_tongue:

beth
2017-07-05 23:47
Hm. I'll have a think about it.

abubics
2017-07-05 23:48
no rush, I think . . . although I don?t know how often it bites people

beth
2017-07-05 23:49
Someone else has mentioned it before. I think it mostly bites people when they're testing it, not irl.

beth
2017-07-05 23:51
I've been considering removing all restrictions on the version format, and just sorting by date.

beth
2017-07-05 23:51
Which is currently available, it's just not the default.

abubics
2017-07-05 23:56
that might be a better default for iteration-0 work, but maybe less good the rest of the time . . .

abubics
2017-07-05 23:57
or maybe working on backwards compat isn?t the normal use case for anyone :stuck_out_tongue:

abubics
2017-07-05 23:57
even though it was a significant design decision

beth
2017-07-06 00:02
99% of the time, I imagine the latest sem version will be the most recently published

beth
2017-07-06 00:03
And would be less confusing.

beth
2017-07-06 00:04
If you go backwards with your sem ver, you've probably made a mistake, and you want the most recent one anyway.

abubics
2017-07-06 00:11
totes

thadir
2017-07-06 07:43
wow, that looks great

thadir
2017-07-06 07:46
beth: This could also be a way to make the build cycle for java apps to go round. And also make sure a consumer validates the Provider (in a build agent or somting like that).

mattcoder
2017-07-06 08:02
@matt, i run the ps

mattcoder
2017-07-06 08:02
$Headers = @{ Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes('gzLoGGOFaNQrLtkXRMyfGKCrdJVzNH:SS7iSXHmV7iQYjFvtX6linbFFtf9Iwzh')))" } $response = Invoke-WebRequest -Uri 'https://arris.pact.dius.com.au/pacts/provider/api/consumer/consumer%20event/version/1.0.0' -Headers $Headers -Method Put -InFile .\consumer-event_api.json -ContentType 'application/json'

mattcoder
2017-07-06 08:02
in the format you sent me

mattcoder
2017-07-06 08:02
the passcode and id are correct

abubics
2017-07-06 08:03
mattcoder: Might want to put those credentials in env vars :wink:

mattcoder
2017-07-06 08:03
but the server return 401

mattcoder
2017-07-06 08:04
yep, i was just spiking

abubics
2017-07-06 08:04
I mean, more for ?public? chat :stuck_out_tongue:

mattcoder
2017-07-06 08:06
you mean i jsut hide the credential?

mattcoder
2017-07-06 08:06
from other viewers?

abubics
2017-07-06 08:06
maybe, up to you . . . I doubt there are any malicious users in here, but it?s good to have safe habits

beth
2017-07-06 08:07
What do you mean by the consumer validating the provider Martin?

mattcoder
2017-07-06 08:07
understood, btw, r u working for http://pact.dius.com?

abubics
2017-07-06 08:08
no, but I have made some sample projects

abubics
2017-07-06 08:08
nothing .net, sorry :slightly_smiling_face:

abubics
2017-07-06 08:10
hm, I only get 404s for your path

abubics
2017-07-06 08:10
and you have no uploaded pacts yet?

mattcoder
2017-07-06 08:11
not a problem at all, great reminding though, matt sent me the cmdlet that is with the credential he is owning, so i wud assume thiis is safe, but you right, better be careful;-)

mattcoder
2017-07-06 08:12
no, nothings there

abubics
2017-07-06 08:13
I have to go, but I definitely get a 404 from ``` curl "https://$user:$pass@arris.pact.dius.com.au/pacts/provider/api/consumer/consumer%20event/version/1.0.0" ``` , not 401

mattcoder
2017-07-06 08:13
thanks dude, that was a great help already

abubics
2017-07-06 08:13
401 suggests the creds aren?t getting through correctly

mattcoder
2017-07-06 08:14
401 not authorized

abubics
2017-07-06 08:15
you might want to not base64 encode the credentials

abubics
2017-07-06 08:17
you could also try putting the username and password in the url, as in my `curl`

abubics
2017-07-06 08:17
not the best approach, but should still work

mattcoder
2017-07-06 08:21
yep, jsut tried, same 401

abubics
2017-07-06 08:26
guess you?ll have to wait for a PoSh person to help :slightly_smiling_face: soz

thadir
2017-07-06 08:30
nvm. we already fixed this. Were still strugeling with the fact that in java you cant autmaticly trigger the provider to make sure the pact is fully verified. So were experimenting. I saw the badges and touch we could use this. But the badges is more for the status page of a project intended so it was a early no coffee moment for me.

beth
2017-07-06 08:44
Do the webhooks not work for the ci of the provider?

beth
2017-07-06 08:45
Why would it be different for Java than any other language?

matt
2017-07-06 08:45
Unfortunately there is no such option for `Invoke-WebRequest` @abubics, you need to either create a `Credential` object or manually construct the `Authorization` header as we?re doing here

matt
2017-07-06 08:45
Also, I will issue you a new set of creds later @mattcoder



abubics
2017-07-06 08:48
they?ve made it so clever it?s unusable ;D


matt
2017-07-06 08:53
@mattcoder I?ve DM?d you a new set of creds

matt
2017-07-06 09:24
FWIW I?ve published a pact to your broker using the below command. @mattcoder, please check your pact dashboard

matt
2017-07-06 09:24
for others, the magic looks like below: ``` $Headers = @{ Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes('YOURUSERNAME:YOURPASSWORD')))" } $response = Invoke-WebRequest -Uri 'https://YOURHOST.pact.dius.com.au/pacts/provider/YOUR%20PROVIDER/consumer/YOUR%20CONSUMER/version/1.0.0' -Headers $Headers -Method Put -InFile ./pact.json -ContentType 'application/json' ```

matt
2017-07-06 09:25
It?s _really_ important that the provider and consumer in the path match those in the pact files (but of course converted to URL friendly values)

beth
2017-07-06 09:26
Mwah ha ha, yes, I put in some very strict validation, otherwise it would be a mess.

matt
2017-07-06 09:26
:slightly_smiling_face:

finkingma
2017-07-06 10:10
neat job on the quick fix, publishing new verifications work like a charm


finkingma
2017-07-06 10:14
btw, is there a way to get the badge for specific tags as well? I tried using using https://XXXX.pact.dius.com.au/pacts/provider/MapMakerApi/consumer/ExploratoryTestingGame/latest/prod/badge.svg but that didn't work. Would be great if we could see if specific latest tags would be verified

beth
2017-07-06 10:14
It's next on my list.

beth
2017-07-06 10:16
Then will think about logic for a "whole provider/consumer" status.

finkingma
2017-07-06 10:16
awesome! And if its not verified, the badge shows 'unknown' text.

beth
2017-07-06 10:17
Wondering whether it's useful to put the "3 days ago" text that is shown on the index page, or to just keep it simple.

beth
2017-07-06 10:17
Yes. The verification status is "unknown". Is that unhelpful?

beth
2017-07-06 10:18
I used never, failed, verified and unknown. But happy to take suggestions for improvements.

finkingma
2017-07-06 10:19
I'd expect something like 'changed' or something. Gives more info about what action is required from team

beth
2017-07-06 10:19
"stale" is another option

finkingma
2017-07-06 10:19
also its more in line with the warning message on the index page

beth
2017-07-06 10:19
Good point.

finkingma
2017-07-06 10:20
ow and personally I would prefer the badge without the days


beth
2017-07-07 01:02
@ I've also added the /latest-untagged and latest/tag badges.

beth
2017-07-07 01:03
New feature announcement - if you're using tags, there is now an endpoint to retrieve the latest untagged pact. The url is `/pacts/provider/PROVIDER/consumer/CONSUMER/latest-untagged`

mattfaries
2017-07-07 03:07
has joined #general2

beth
2017-07-07 03:49
Welcome another person called matt, @mattfaries

beth
2017-07-07 03:50
@mattcoder Neil, the main http://pact.net maintainer says there is no .net code for publishing, however, he points people to this script that he wrote: https://gist.github.com/neilcampbell/bc1fb7d409425894ece0

mattfaries
2017-07-07 03:50
Thanks @beth

travi
2017-07-07 04:15
so many matts :slightly_smiling_face:

timothy.clifford
2017-07-07 04:33
Might have to change my name...

beth
2017-07-07 04:33
'Mind if we call you "Matt" to keep it clear?'

timothy.clifford
2017-07-07 04:37
I assumed we already were

finkingma
2017-07-07 07:25
thx @beth works like a charm.!

beth
2017-07-07 07:29
Glad you like it. It was a fun little piece to write. It's using http://shields.io behind the scenes to dynamically create the badges, but we might stand up our own shields server if required.

fitzoh
2017-07-10 03:20
@beth and @matt , I've got a sort of complicated use case if you guys want to hear it


fitzoh
2017-07-10 03:21
So we've got a monolith we've been working on untangling for a while that has a bunch of logical services in it

fitzoh
2017-07-10 03:22
and a couple services which have been split out and are now deployed separately

fitzoh
2017-07-10 03:22
and we have pact tests between the logical services and the microservices

fitzoh
2017-07-10 03:23
this makes tagging a little difficult

fitzoh
2017-07-10 03:23
because when we deploy the monolith, we're deploying a bunch of services instead of just one

fitzoh
2017-07-10 03:24
so we would need to maintain a manual list of all of the services contained within that deployment, and then tag all of those on a deploy

fitzoh
2017-07-10 03:24
I've got a workaround, but it's janky

fitzoh
2017-07-10 03:24
we use a naming convention for all of our pacticipants

fitzoh
2017-07-10 03:25
it's either `microservice-name`, or `monolith_logical-service-name`

fitzoh
2017-07-10 03:26
and the deploy job kicks off a parameterized job and passes in either `microservice-name` or `monolith`, then a gradle task parses that, fetches every paticipant from the broker, filters for ones that match the service name/prefix, and then tags all of them

fitzoh
2017-07-10 03:27
not sure if hierarchical/linked pacticipants are common/something you should necessarily design around, but thought you might be interested

beth
2017-07-10 03:29
Thanks for sharing your usecase @fitzoh. We always like to hear how the broker is being used in the wild to work out what features to build. People always use things in a way you'd never expect, and it's kind of delightful to hear about.

beth
2017-07-10 03:29
If you don't mind, I'll copy that it an issue for our list of future feature ideas.

fitzoh
2017-07-10 03:29
go for it

beth
2017-07-10 03:30
At one stage, I wondered about adding pacticipant tags.

beth
2017-07-10 03:30
would that help you at all?

fitzoh
2017-07-10 03:31
potentially? would tagging a service essentially mean that it's an alias of the tag?

beth
2017-07-10 03:32
Hmm... no.

beth
2017-07-10 03:33
You could tag a pacticipant with an arbitrary string, and then retrieve them by that string.

fitzoh
2017-07-10 03:33
I think I meant the same thing :stuck_out_tongue:

beth
2017-07-10 03:33
Like "get me all the pacticipants tagged "ios""

fitzoh
2017-07-10 03:33
more or less

beth
2017-07-10 03:34
Would being able to say "get me the services tagged 'microservice'" help?

fitzoh
2017-07-10 03:34
yeah, I think that would cover it

beth
2017-07-10 03:35
I do wish I'd called "tags" "labels" instead, as I think it would have been less confusing with git tags.

mattcoder
2017-07-10 03:36
thank you Matt and Beth, all are works out just like magic:-)

fitzoh
2017-07-10 03:36
tags still makes sense for individual pact files

fitzoh
2017-07-10 03:37
we're treating them exactly like we're treating docker tags

fitzoh
2017-07-10 03:37
when we deploy to `stage`, we tag that docker image as `stage` and add a `stage` tag to the corresponding pact files

fitzoh
2017-07-10 03:37
and so on for all our environments

beth
2017-07-10 03:40
Perfect!

beth
2017-07-10 03:40
That's exactly how I'd hoped it would be used.


fitzoh
2017-07-10 03:41
hmm... maybe it would make more sense to have tags for pacts and labels for consumers?

fitzoh
2017-07-10 03:42
I feel like the use cases are probably different enough for the two that it might make sense to use different names

beth
2017-07-10 03:50
A fair point.

beth
2017-07-10 03:50
Less confusing in terms of the functionality.

beth
2017-07-10 03:51
I've updated the issue with "label" instead of "tag"


thadir
2017-07-10 09:27
Were slowly ramping up our usage of the pact broker. And as usual im loving it. But i see a slight ui improvement we could use. You can go to the network graph of an pact. And thats great and all but i would also love to have a filter or somting of witch patcht versions there are and stuff like that. Now its a nice flow diagram but its quite quick confuluded.

beth
2017-07-10 09:42
You're very polite. It needs more than a slight improvement.

beth
2017-07-10 09:42
It's on our list of things to improve.

beth
2017-07-10 09:43
Can you explain more about how you'd like to filter them?

beth
2017-07-10 09:44
My original plan was for the selected service to be in the centre, and then show you all the services it used. Then, as you selected each other service, it would become the centre one.

beth
2017-07-10 09:44
Unfortunately my js skills/time ran out before I could make that happen.

beth
2017-07-10 09:46
We've got some extra people on the team now, with more UI foo than I have, who will be putting some polish on the whole thing.

ngbrown
2017-07-11 04:49
has joined #general2

thadir
2017-07-11 12:26
@beth ill dm you a few things somere this weak, (with some screen shots and ui ideas)

matt
2017-07-11 21:15
that?d be awesome, thanks @thadir!

thadir
2017-07-12 08:16
@matt its in our own selfish interest if we give good input you can get swayed to do it in a way we prefere :wink:.

matt
2017-07-12 08:20
it?s a win win :smile:

matt
2017-07-12 08:20
and pretty much, yes

finkingma
2017-07-12 14:57
was just wondering something: the homepage of the pact broker now shows the latest published / last verified status for this pact, regardless of tags. Is there also a way to see if the latest prod version is still verified? Besides badges :slightly_smiling_face: I'm currently using the broker just in my own personal project, but while working on a feature I kinda miss that information on the homepage of the broker

beth
2017-07-13 00:15
There isn't yet because I didn't know what information would be most useful.

beth
2017-07-13 00:16
And the tags might differ per project.

beth
2017-07-13 00:16
I think we need to add some config

kunwardeep
2017-07-13 03:44
has joined #general2

kunwardeep
2017-07-13 04:05
Just curious about the usage of PACTs . Given that its contract testing... how do we test the contract between the app and the db(s3 to sql). Or do we use other strategies for it

rholshausen
2017-07-13 04:07
@kunwardeep I wouldn't test the contract between an app and a data store. But I have tested the contract via a data store (Dynamodb) where one service wrote a document and another then consumed it.

kunwardeep
2017-07-13 04:51
so does that mean that you mocked the dynamo layer somehow or wrote and read from an actual db?

rholshausen
2017-07-13 06:16
On the provider side, we got the provider to write to the DB and then generated the pact from that. On the consumer side, the Pact test populated the DB from the pact file and invoked the consumer to read it.

kunwardeep
2017-07-13 07:04
:thumbsup:

kunwardeep
2017-07-14 00:35
Can some one point me in the direction of some documentation regarding writing a new implementation of PACT?

beth
2017-07-14 00:56
kunwardeep: Hopefully we can, which language are you using?

kunwardeep
2017-07-14 01:09
elm for front end and ruby for back end

beth
2017-07-14 01:11
So you'll want the javascript docs here: https://docs.pact.io/documentation/javascript.html


kunwardeep
2017-07-14 01:19
elm compiles into javascript but is not used the same way as javascript(when making api call)

kunwardeep
2017-07-14 01:19
so was wondering if there are any docs as such to create a new pact library

beth
2017-07-14 01:20
Ah! Sorry, I misunderstood you.



kunwardeep
2017-07-14 01:21
Perfect :thumbsup:

beth
2017-07-14 23:10
@kunwardeep I realised after I'd sent you that link that the guidelines were heavily out of date. I've done a major re-write of them. Can you have another look please?

matt
2017-07-15 07:37
For those on Windows, Pact .NET just released an update to publish pacts via the library: https://github.com/SEEK-Jobs/pact-net#publishing-pacts-to-a-broker

matt
2017-07-15 07:37
:point_up: @mattcoder


kunwardeep
2017-07-16 23:41
sure

kunwardeep
2017-07-16 23:41
version 3 is the one we should be using...?

beth
2017-07-17 00:13
Not the spec, the implementation guidelines.


mattcoder
2017-07-18 03:00
@matt, what a speedy response for this request, thank you dude.

beth
2017-07-24 00:44
@fitzoh I've added labels to pacticipants, and added the /pacticipants/label/{label} endpoint. I'm just trying to work out what templated URLs to add to the resource to make your use case work as simply as possible.

beth
2017-07-24 00:44
Do you use the HAL links to create your URLs, or do you hardcode them?

fitzoh
2017-07-24 13:43
That's awesome

fitzoh
2017-07-24 13:44
and hardcoded for the most part

fitzoh
2017-07-24 13:44
although most interactions are via `pact-jvm`

sheetal
2017-07-24 19:28
has joined #general2

beth
2017-07-24 22:13
So if we added these calls to pact jvm, it would be useful?

shenahas
2017-07-26 22:57
has joined #general2

shenahas
2017-07-26 23:02
need some help on multiple provider version support in PACT broker

shenahas
2017-07-26 23:04
I am using JUnit for generating Pacts and Pacts maven plugin to post the pact into pact broker. I am using below plugin Configuration.While Consumenr pact is getting uploaded in broker, I am able to see only single entry of consumer pact of version 2.0. Eirlier I have uploaded version 1.0 eirlier, which is not present in the UI. Is there any way to see the multiple version of same provider pact in HAL browser and get different version of PACTS by Https GET request? Currently I am getting only latest consumenr pact version by http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/latest Please provide some info regurding this and let me know if you need any informaiton.

shenahas
2017-07-26 23:05
posted same question here <https://stackoverflow.com/questions/45338491/multiple-pact-version-support-from-pact-broker>

beth
2017-07-26 23:22
I have answered on stackoverflow.

shenahas
2017-07-28 21:48
Thanks a lot Beth , It really helps.

king-smith
2017-08-01 00:05
has joined #general2

prudhvi
2017-08-01 14:00
has joined #general2

kale.mcnaney
2017-08-02 22:12
has joined #general2

kale.mcnaney
2017-08-02 22:15
need some help. just got beta access but my host is 503ing https://goodwaygroup.pact.dius.com.au/

kale.mcnaney
2017-08-02 22:15
thanks!

matt
2017-08-02 22:15
Hi @kale.mcnaney, i?ll take a look now

kale.mcnaney
2017-08-02 22:16
ty, @matt!

mouser
2017-08-02 22:30
we may be experiencing a similar issue?


mouser
2017-08-02 22:30
Getting a ?Service Unavailable: Back-end server is at capacity? error when trying to fetch PACTs from the broker

matt
2017-08-02 22:32
On it team - looks like a hiccup with the AWS stack. Shouldn?t be too long

matt
2017-08-02 22:32
Also - my sincere apologies!

matt
2017-08-02 22:35
There is a small DNS change coming your way, TTL on the main load balancer is 60s so things should be coming back up shortly

mouser
2017-08-02 22:42
:thumbsup:

matt
2017-08-02 22:43
I?m still seeing some timeouts so bare with me

matt
2017-08-02 23:04
System is stabilising folks, please send any feedback or issues if you have any new issues. We?ll continue to monitor progress throughout the morning

matt
2017-08-02 23:05
thanks for your patience :pray:

mouser
2017-08-02 23:10
thanks matt

mouser
2017-08-02 23:17
all looking good from our perspective - thanks for getting onto it so quickly @matt!

matt
2017-08-03 00:03
excellent - no worries!

kale.mcnaney
2017-08-03 12:10
all good here as well. thanks @matt

matt
2017-08-03 13:37
For what it?s worth, we?re having a retro on this on Monday and we?ll probably look to re-architecture some of the system as a result. We?ve had a lot more customers join the platform and we need to work through some peculiarities with Kubernetes that underlined the problem.

shenahas
2017-08-04 01:40
HI Beth, I am facing issue while connecting with dockerized pact-broker to non-dockerized postgresql. I have raised a question to https://stackoverflow.com/questions/45496934/pactbroker-docker-image-connection-issue-with-non-dockerized-postgresql Please answer if possible

beth
2017-08-04 02:01
Sure, will have a look as soon as I can. I always use a non docker postgres installation, so there should be no problem.

gareth
2017-08-07 01:28
has joined #general2

fergusstrange
2017-08-08 19:30
has joined #general2

fergusstrange
2017-08-08 19:34
Hey from the :uk: all :wave:

bangn
2017-08-11 01:13
has joined #general2

beth
2017-08-11 02:07
Hey everyone. Just letting you know that things have been a bit quiet on the feature development as @matt and I have been working out on client sites, but we haven't forgotten about you all!

beth
2017-08-11 02:08
We've selected a provider for implementing our social logon feature, and it will be the next thing we implement.

beth
2017-08-11 02:09
The first two 3rd party authentication providers will most likely be github and google.

matt
2017-08-11 06:54
Yep! And we?re also going to be rolling out some platform changes in the background over the coming weeks. One will be going through this evening to improve stability in performance and throughput

matt
2017-08-11 07:36
Change has gone out successfully, you may have noticed a couple of blips on your radars as containers were shuffled about, but there is now a bit more capacity in the cluster which should hopefully create more consistent performance

beth
2017-08-11 07:36
:raised_hands:

cormac
2017-08-15 14:41
has joined #general2

v.lukoyanov
2017-08-15 15:08
has joined #general2

neil
2017-08-18 21:47
has joined #general2

beth
2017-08-22 07:28
Welcome @neil

shamilton
2017-08-30 13:11
has joined #general2

acooper106
2017-08-30 18:19
hello

acooper106
2017-08-30 18:24
I am trying to publish to a local pack broker with @pact-foundation/pact-node@4.12.0. When I run the publishPacts function I am not getting a pact on the broker. It does work when I publish with pact-jvm using mvn pact:publish. Does anyone know how to fix this issue? Also, there are no errors in the terminal.

eskimoquinn
2017-08-30 19:32
Hello here, I am wondering if there is a way to manipulate the request when using the pact-provider-proxy https://github.com/pact-foundation/pact-provider-proxy

eskimoquinn
2017-08-30 19:33
I'd like to modify the request like this document suggests, but I do not think it is possible when using the provider proxy: https://github.com/realestate-com-au/pact/wiki/Verifying-pacts#modifying-the-request-with-live-data

jeffutter
2017-08-30 22:33
has joined #general2

shamilton
2017-08-31 15:06
:wave: hi all. i'm very excited at the potential of Pact for our project.

shamilton
2017-08-31 15:08
anybody know of others writing microservices in Elixir? our first Provider is being written in Elixir and the Consumer is a Ruby app.

matt
2017-08-31 21:08
Welcome!

matt
2017-08-31 21:09
I've heard rumors of an old colleague here in Melbourne, I'll look into it. It's doable if you use the provider verifier docker container

shamilton
2017-08-31 22:33
thanks @matt yeah we saw the provider verifier via Docker. definitely something we'll pursue at first. after that just wondering if there's an active project or any other contributors we can work with.

shamilton
2017-08-31 22:34
...work with on a native Elixir lib.

matt
2017-08-31 23:55
Great! I'm not sure where the last group got to, but if not far we'd be happy to see you up a repo on pact-foundation to get it started and a hangouts to take you through our recommended approach

kunwardeep
2017-09-01 00:55
@shamilton @matt I'd like to see that happen . We do have a fair few services in elixir, but tests are still end2end.

matt
2017-09-01 00:57
Hello! Well you guys were who I was going to approach. Shall we organise a hangouts next week some time and see what we can come up with? @kunwardeep @shamilton

kunwardeep
2017-09-01 00:59
sure @matt.. preferably during business hours . I am not an elixir person.. but willing to learn it

matt
2017-09-02 06:17
Hi @acooper106, if you?re not getting any output at all it?s going to be hard to diagnose! As a starting point, could you please raise an issue on the `pact-node` (https://github.com/pact-foundation/pact-node/) javascript repository and we can track it there?

matt
2017-09-02 06:18
IIRC you are on Windows, so perhaps it?s a compatibility issue (we?re aware of some Windows issues, the cause of them and are working to resolve)

matt
2017-09-02 06:18
As discussed last time, perhaps a simple work around for the time being is to publish using the PoSH script (https://pactbroker.slack.com/archives/C47D4FGPR/p1499255790852938)

beth
2017-09-02 07:16
Yes, absolutely. You can use rack middleware and wrap it around the provider.

beth
2017-09-02 07:18
Oh, I see what you mean. The app is abstracted. You can set up the proxy yourself if you want to verify a running app. I'll send you some sample code.


beth
2017-09-02 09:48
Note the check to ensure that the original value of the header matches the expected format.

beth
2017-09-02 09:49
Are you sure you want to use the provider-proxy? If you have a ruby app, you'd be better off using the normal provider verifier, and if you don't have a ruby app, you'd be better off using the pact provider verifier https://github.com/pact-foundation/pact-provider-verifier

beth
2017-09-05 05:56
who is using webhooks? I'm adding webhook statuses to the index page, and I'd like some beta users to give feedback.

abubics
2017-09-05 05:56
will be soon (starting in the next week or two)

rholshausen
2017-09-05 05:58
@mouser, you up for being a guinea pig?

tjones
2017-09-05 05:58
has joined #general2

mouser
2017-09-05 06:13
Of course, where do I sign up? :grin:

beth
2017-09-05 06:13
I'll ping you when I've pushed the feature @mouser

mouser
2017-09-05 06:14
Excellent - thanks @beth

thadir
2017-09-05 08:23
@beth were not sure yet, i havent had the chance to look at them. But were thinking of using it to use it when a consuemr publishes a contract to triger the provider.

beth
2017-09-05 08:24
That's their purpose!

thadir
2017-09-05 08:34
@beth, atm im realy focusing on getting the teams to use pact. Ill look in to it but my time is a bit close :slightly_smiling_face: but ill will try

fergusstrange
2017-09-05 10:06
@beth we are using and happy to feedback

shamilton
2017-09-05 12:41
sorry just saw this. yeah i could do a hangout. this week is a little crazy. we got Elixir conf. in Seattle

shamilton
2017-09-05 12:44
i'll be available again Sept. 14, or 15. though I could squeeze in a quick call today.

shamilton
2017-09-05 12:44
@matt @kunwardeep where you located? i'm in Texas.

kunwardeep
2017-09-05 12:56
i am in Melbourne... and i think so is @matt

shamilton
2017-09-05 13:11
ok. so about a 15 hour difference then. well i could do either late at night or early in the morning. i do have some coworkers that would like to join too.

shamilton
2017-09-05 13:13
any particular day you want to shoot for?

shashidesai
2017-09-06 19:15
I was curious to know how people are using the webhooks ? Is it possible to see some examples ?

kunwardeep
2017-09-07 00:47
has anyone had any experience in testing event/queue based system using some kind of contract based testing. The scenario is System A writes to a database/queue a job to be done. System B monitors this and if there is a new job, picks up the request and processes it. For us to test this we need an end 2 end system. But was wondering if some one had any experience in implementing some contact based testing for such a platform. The idea would be something similar as pact.

abubics
2017-09-07 00:49
I haven?t, personally, but @rholshausen has been talking about it a bunch recently

abubics
2017-09-07 00:50
Pact isn?t specifically for testing http interfaces, that?s just one transport that?s implemented

beth
2017-09-07 01:03
Ron is able to publish a blog post about this. We'll post it here when it's public.

gareth
2017-09-08 00:49
have you considered a pact emoji for buildkite? :wink:

rholshausen
2017-09-08 00:54
@beth :point_up:

beth
2017-09-09 10:34
Great idea @gareth


beth
2017-09-11 01:58
@shashidesai Webhook are used to kick of provider builds when a new version of a pact is published


beth
2017-09-11 02:01
@mouser @fergusstrange @abubics can you PM me your broker subdomains please?

mouser
2017-09-11 08:24
Ours is 'irexchange' @beth

beth
2017-09-11 10:53
I've updated your broker @mouser. All the webhooks now say "not run" because the amount of work to migrate the old data structure was not worth it, but they'll be accurate once you've triggered the next execution. @rholshausen

mouser
2017-09-11 21:13
Excellent - I?ll let you know how it goes!

thadir
2017-09-12 09:17
@beth how are the things going with the securety part? I still have one super user for em all, witch is a bit scary seeing some of my developers are a bit eager in there clean ujp.

beth
2017-09-12 09:59
Slowly :-( I'm out on client site, so I only get time to work on the broker on the train.

beth
2017-09-12 10:06
I've just been doing little things in dribs and drabs.

matt
2017-09-12 11:13
@thadir would having multiple brokers help you as a shorter term solution? We'd happily create you others if that's the case (I know, it's not ideal)

thadir
2017-09-12 14:16
@matt nah, its more like a thing that process wise is a problem. ATM working on some mock inprovmetns for the UI

abubics
2017-09-13 00:50
feedback on provider verifications: `pact-jvm-provider-gradle` automatically verifies (if using broker pactfiles), so I didn?t even have to change anything :stuck_out_tongue:

rholshausen
2017-09-13 01:06
So what's the feedback @abubics?

abubics
2017-09-13 01:09
um . . . it was exceedingly easy to implement :thinking_face:

abubics
2017-09-13 01:10
there is a risk of people running `pactVerify` with local code changes, and the CI build still being broken . . . but that?s kinda always a risk

abubics
2017-09-13 01:10
although, it?s hard to tell how to avoid it now

rholshausen
2017-09-13 01:12
I set the version to 0 in the build, so the local builds will always be the oldest. Bit of a hack, but it seems to work

rholshausen
2017-09-13 01:12
Then CI sets the version to the build number

abubics
2017-09-13 02:09
ah . . . guess I?ll hit more interesting cases soon . . . looking at versions, the only one I can find is `1-SNAPSHOT` :stuck_out_tongue: maybe something to fix

beth
2017-09-13 02:14
Ron, I'm moving to a timebased approach, because the ordering by version seems to cause more problems than it solves. So this approach might break.

beth
2017-09-13 02:17
Andras, I recommend using some flag based on an env variable that is only set on the ci

beth
2017-09-13 02:18
Would it make more sense to do have a separate "publish verification" task?

beth
2017-09-13 02:18
That only ran on ci? The way the pact are done?

abubics
2017-09-13 02:18
yep, I think that?s what we?ve got on CI, I?m not sure where the `SNAPSHOT` is coming from on local, but I?ll hunt it down soon


abubics
2017-09-13 02:18
maybe

beth
2017-09-13 02:18
The verification could be written to a file in between.

beth
2017-09-13 02:20
@rholshausen what do you think? Two step process on the consumer and the provider?

abubics
2017-09-13 02:20
that?s kinda what I was expecting, mostly from the 2-step consumer side

abubics
2017-09-13 02:21
but that?s a legacy expectation :wink:

rholshausen
2017-09-13 04:03
Hmm, I've just only finished implementing the verification stuff, and you want to change it :disappointed:

beth
2017-09-13 04:11
I know. I'm a bad person.

abubics
2017-09-13 04:14
I don?t think semver should be a problem . . . but highlighting when people may be causing inadvertent issues might go a long way

beth
2017-09-13 04:14
Having a separate publish task would definitely make the behaviour clearer.

beth
2017-09-13 04:17
The asymmetry of the configuration bothered me when I wrote it, but for some reason it didn't occur to me to make a task for it in the ruby.

beth
2017-09-13 04:18
If the verification was written to a file in between the tests and the publication, it would need the url to post it to to be stored as well, as this is dynamic.

beth
2017-09-13 04:19
The task would also have to have access to the credentials set in the code that fetched the pact.

beth
2017-09-13 04:19
It does get a bit trickier, because all that context would need to be maintained

abubics
2017-09-14 04:29
yeah, auto (in the same task) is the easiest for configuration, as long as everything is following conventino

abubics
2017-09-14 04:50
Is there a way to list the pact versions of a consumer-provider pair in the broker? I can?t find anything in the HAL browser

abubics
2017-09-14 04:51
(I was having an issue where `1-SNAPSHOT` was uploaded and verified, so I couldn?t see any of the `0.0.740` etc versions)

abubics
2017-09-14 04:54
right, so I can manually type ``` https://<account>.http://pact.dius.com.au/hal-browser/browser.html#https://<account>.pact.dius.com.au/pacts/provider/<provider>/consumer/<consumer>/versions ``` but I couldn?t find a link to that through the HAL browser

abubics
2017-09-14 04:54
good enough for now


rholshausen
2017-09-14 04:56
Ok, so the `versions` is missing from the links

rholshausen
2017-09-14 04:56
Maybe raise an issue

abubics
2017-09-14 04:56
no, it?s in the consumer page, I just must have missed it

beth
2017-09-14 05:28
I'll put an "all pact versions" relation on the pact resource if it's not there already

d.van.dijk
2017-09-18 09:39
has joined #general2

d.van.dijk
2017-09-18 09:53
I have a unittest that runs with PactRunner. When I use "failIfNoPactsFound = false", I get java.lang.Exception: Did not find any pact files for provider security-api-system-users When I use "@IgnoreNoPactsToVerify", I get au.com.dius.pact.provider.junit.loader.NoPactsFoundException: No consumer pacts were found for provider <provider> and tag 'null'. (URL []) Only when I use both, I get the desired result WARN PactRunner uopId= - Did not find any pact files for provider

d.van.dijk
2017-09-18 13:46
By the way. This happens on pact-jvm-provider-junit_2.11 3.5.3, pact-jvm-provider-junit_2.11 3.5.5 and pact-jvm-provider-junit_2.12 3.5.5

tom
2017-09-18 22:58
has joined #general2

beth
2017-09-18 23:05
@rholshausen will be able to help you with that.

beth
2017-09-18 23:05
@abubics I've added "pb:all-pact-versions" to the pact resource

beth
2017-09-18 23:05
It's deployed

rholshausen
2017-09-18 23:09
@d.van.dijk I'll have a look, with the `@IgnoreNoPactsToVerify` annotation your test should not fail

beth
2017-09-18 23:32
@mouser @fergusstrange @abubics the webhook status feature has been deployed. You'll now see a "last run" time in the webhook status column. If the webhook fails, you'll be able to click through and find the logs from the failing webhook (there will be a link relation called "pb:error-logs")

beth
2017-09-18 23:33
One thing that's missing is some indication that a webhook did NOT run because the pact hadn't changed. Therefore, you may see that the last pact was published more recently than the webhook fired. I'm not sure how to show this, and would welcome feedback.

beth
2017-09-18 23:41
I'm thinking that the mouseover text could explain this.

kong
2017-09-19 01:59
has joined #general2

abubics
2017-09-19 02:20
bad news for us, I?m afraid . . . we?ve got internal-only IPs for TeamCity, so webhooks can?t even route :disappointed:

beth
2017-09-19 02:44
Bugger!

beth
2017-09-19 02:44
Is there some other communication channel?

abubics
2017-09-19 03:35
not easily . . . but this will lead to upgrading the (2+ year-) old internal broker, I hope

abubics
2017-09-19 04:30
you know what might be cool (if not difficult) . . . some visual indicator in the HTML pact page that shows if an interaction has changed (or been added) since the last version of a pact

beth
2017-09-19 04:45
You can see that in the hal browser currently, but not in the html view.

beth
2017-09-19 04:46
go into the hal browser, and then select the "pb:diff-previous-distinct" relation.

beth
2017-09-19 04:46
I like the HTML view idea though.


abubics
2017-09-19 04:52
ah cool . . . I was wondering what those links did :stuck_out_tongue: they didn?t show anything when we had the same pact uploaded 14 times :joy:

beth
2017-09-19 04:54
yeah, not much to show really.

beth
2017-09-19 04:54
the annoying thing is that pact jvm uses a lot of randomly generated data, so there's going to be a lot of noise.


abubics
2017-09-19 04:54
guess I?ll find out in a minute

matt
2017-09-19 04:55
You can avoid the random data though, you just need to make sure you supply the examples rather than rely on the Pact lib to do it



beth
2017-09-19 04:55
and anything based on the ruby impl doesn't use random vaulues.

beth
2017-09-19 04:55
so .net will be fine

abubics
2017-09-19 04:56
well, we?re in Scala- and JS-land, so . . . *shrugs*

alexei
2017-09-20 08:24
has joined #general2

alexei
2017-09-20 09:03
Hello! I have a problem with hosted (.au) Pact Broker. There are several PACTs published, the most of them working (seemingly) as intended. But one particular PACT doesn't get updated in Web UI when republishing. Response 200, everything in response looks just fine. Just changing the name of e.g. Provider with exactly the same data - everything works fine with it.


alexei
2017-09-20 09:09
It looks like the record dosen't not updated despite of this response that update was successful (200). Server side bug? Looking for your help, thanks.

alexei
2017-09-20 09:34
Update. https://grenke.pact.dius.com.au/pacts/provide/<provider>/consumer/<consumer>/versions - shows all the updates. But Web UI doesn't show the latest...

alexei
2017-09-20 09:43
Update 2. https://grenke.pact.dius.com.au/pacts/provide/<provider>/consumer/<consumer>/latest returns that wrong version back (what is definition of "latest"?) which is then shown in WebUI, and https://grenke.pact.dius.com.au/pacts/provide/<provider>/consumer/<consumer>/latest-untagged shows the latest-request version.

beth
2017-09-20 09:43
What versioning scheme are you using?

alexei
2017-09-20 09:43
there are tagged and untagged versions....

beth
2017-09-20 09:43
Semantic or git sha?

alexei
2017-09-20 09:44
x.y.z.f


beth
2017-09-20 09:44
I think it's because the semantic version gem is incorrectly parsing the version.

alexei
2017-09-20 09:45
Correction. While playing, the most versions are like x.y.z.f but some are just x.y.z

beth
2017-09-20 09:45
Someone submitted a PR to change the parsing, and it had unexpected consequences.

beth
2017-09-20 09:45
PM me your broker subdomain and I'll switch it to sort by date created.

beth
2017-09-20 09:51
Ok, try republishing now. It should order by date. You'll need to publish new versions as the existing versions already have an order assigned to them.

beth
2017-09-20 09:52
If you've just been messing around, delete the consumer, and all the pacts will be removed with it.

alexei
2017-09-20 09:59
Worked for the first request, but not for the consecutive....

alexei
2017-09-20 10:00
There is some more infos, and questions. Q. I could not figure out, what is the API call for publishing with a tag?

beth
2017-09-20 10:01
Check out the wiki

alexei
2017-09-20 10:01
I've just published a version 2.0.0.5 with a tag, then the same with a changed pact.

alexei
2017-09-20 10:01
Tried to find there, without success :slightly_smiling_face:

beth
2017-09-20 10:02
It's not really designed for republishing with the same number, however, it should still work, so I'll look into it.

beth
2017-09-20 10:02
Can you send me the instructions to recreate the issue, and I'll have a look at it as soon as I can (night time in Australia)


alexei
2017-09-20 10:05
:thumbsup: Yes, sure. I am using .NET Client and Postman in parallel. Hope to find out how to tag with Postman Reqs (to eliminate problems with the framework)

beth
2017-09-20 10:06
I've just sent you the link for tagging

alexei
2017-09-20 10:06
there are examples for Ruby (or of cause I can use .NET) but I still did not found right format for plain old HTTP Calls

alexei
2017-09-20 10:07
PUT .../pacts/provider/abc/consumer/cde/version/x.y.z/...?

alexei
2017-09-20 10:07
where does the tag goes

beth
2017-09-20 10:07
As an example, to tag Foo consumer version 2.3.0 as the production version, do a PUT to the resource /pacticipants/Foo/versions/2.3.0/tags/prod.

alexei
2017-09-20 10:07
aha...

alexei
2017-09-20 10:08
so it is a separate call?

alexei
2017-09-20 10:08
which goes on consumer, you mean...

alexei
2017-09-20 10:08
If it is, than I got semantic wrong

alexei
2017-09-20 10:09
I can then basically only tags consumer/version? (provider/version) combinations?

beth
2017-09-20 10:09
Yes. You tag an application version, not the pact directly

alexei
2017-09-20 10:09
My thought was about tagging a pact (consumer/provider/version)

alexei
2017-09-20 10:10
Oookay:)

beth
2017-09-20 10:10
Because the tag applies to all pacts of that version eg. Production, Master, Development

alexei
2017-09-20 10:10
That could be also the root cause of problems with WebUI

alexei
2017-09-20 10:12
> Note that the tag is actually placed on the consumer version resource, not the pact itself (conceptually, you are indicating that that particular version of the consumer application is a "prod" version, or a "feature-a" version). The URL structures, however, then allow you to retrieve pacts by the tags on their associated versions.

alexei
2017-09-20 10:13
I see. Those who can read have benefits :slightly_smiling_face:


w.everse
2017-09-21 06:03
has joined #general2

beth
2017-09-21 22:43
@alexei how did you go? Have you got the steps to recreate your issue worked out? Please raise an issue on the pact broker repository when you do.

alok.pandey
2017-09-22 08:08
has joined #general2

veganjenny
2017-09-23 01:35
has joined #general2

alok.pandey
2017-09-25 10:59
Hi evryone

alok.pandey
2017-09-25 11:01
i have my pact files ready.....i wanted to know what happens at provider side ?

alok.pandey
2017-09-25 11:02
pact file is ready means consumer side is done..


alok.pandey
2017-09-25 11:34
Hi @beth i need to publish my pact file to the free broker--- $res = Invoke-WebRequest -Uri "https://royalcyber.pact.dius.com.au/" -Method Put -C:\Users\user\Documents\WORKSPACE\microservice1\target\pacts\test_consumer-test_provider.json -ContentType "application/json" is it right or else what should i do?

alok.pandey
2017-09-25 11:35
i need to have some auth i think

beth
2017-09-25 11:35
There's a windows script for it in the pact net repo

alok.pandey
2017-09-25 11:36
ohk


beth
2017-09-25 11:38
Can I recommend you browse the pact docs site to get a feel for all the documentation? It won't take long, and it should answer most queries that will come up.

beth
2017-09-25 11:39
It useful having some new eyes over it to let us know what is missing or could be improved.

alok.pandey
2017-09-25 11:41
ohk @beth and Thanks .....i will resd whole docs first

alok.pandey
2017-09-25 11:41
*read


matt
2017-09-26 05:52
For the Java/JVM users out there, our very own @rholshausen just published a neat little article on contract testing serverless and async applications with Pact: https://dius.com.au/2017/09/22/contract-testing-serverless-and-asynchronous-applications/

alok.pandey
2017-09-26 14:59
Hi @beth i am trying to upload files to pact broker.... The remote server returned an error: (405) Method Not Allowed.....could u please tell the issue?

alok.pandey
2017-09-26 15:40
Sorry @beth it worked by using -usebasicparsing.

alok.pandey
2017-09-26 15:40
Thanks

kunwardeep
2017-09-27 00:23
can't wait for part 2 of this.

alexei
2017-09-28 10:15
Hi Beth, it is postponed, because we have unfortunately other problems with consumer test itself. My first impression after that day, I?ve used the broker is, that Broker API should not offer tags parameter for ?publish pact? operation at all, because it is designed, that tag is consumer-version related, and not pact related. Parameter in publishPact is then misleading. I?m afraid, I can go into it in depth in the next week at earliest.

jsilver
2017-09-28 22:11
has joined #general2

zerocooljs
2017-10-01 15:02
has joined #general2

beth
2017-10-02 04:15
Open the latest pact (or /latest-untagged or /latest/TAG) in your browser, and click on the badge icon to display the markdown to add to your README.

beth
2017-10-02 04:18
@alexei you are tagging the consumer version (ie. you are saying version 1.2.3 is the production version, or 3.4.5 is the master version) however, the tags are used for looking up the pacts. To get the pact for the latest production version between Foo and Bar, you use `/pacts/provider/Bar/consumer/Foo/latest/production`

beth
2017-10-02 04:21
The reason the version is tagged and not the pact is that 1. the tag "production" should apply to all pacts that belong to version "1.2.3" of the consumer. It doesn't make sense to have the production version of the pact with provider-1 being at version "1.2.3" and the production version of the pact with provider-2 being at version "4.5.6"

beth
2017-10-02 04:22
2. It allows you to tag provider versions as well, which is used when we want to indicate that a provider has been released to production. This will allow us to know whether a pact is compatible with the _production_ version of a provider, not just the development version.

mzacharska
2017-10-03 21:22
has joined #general2

alok.pandey
2017-10-04 11:30
hi guys ...how to set the provider states?

alok.pandey
2017-10-04 11:33
i am using maven plugin in the provider side so i have given my databse url in <stateChangeUrl>....so does the provider runs all the services in pact file with this url?

beth
2017-10-06 02:32
@alok.pandey did you get this working?

alok.pandey
2017-10-06 09:16
@beth yeah its working thanks again.....actually i have one doubt suppose we have to set up the datasource in the consumer side then what should we do?

beth
2017-10-09 03:14
Sorry, can you explain more @alok.pandey? I don't understand what you mean.

beth
2017-10-09 03:15
Do you mean, how to do you set up your data for the consumer side of the pact test? Just the way you normally would for any test.

beth
2017-10-09 03:16
It's best to test just the client code using pact ie. put all the code that makes the calls to the provider into one class, and just test that class. If you start using pact to test your entire consumer stack, you tend to get bloated and hard to maintain tests.

alok.pandey
2017-10-09 12:53
Yes i get it @beth very much informative....

alok.pandey
2017-10-09 12:53
Thanks

nic
2017-10-09 13:01
has joined #general2

nic
2017-10-09 13:02
quick request for help, I'm getting a 401 on my provider when I run rake pact:verify

nic
2017-10-09 13:03
I have env vars set for my username/password and can see them being passed into pact helper

nic
2017-10-09 13:03
if I copy the url it says its trying to access from the console into my browser it works fine


thadir
2017-10-09 13:10
@nic question is it maven based or other language in what lang is the provider?

nic
2017-10-09 13:14
thanks @thadir its ruby, don't worry I found it in the docs eventually! https://github.com/realestate-com-au/pact/wiki/Verifying-pacts#with-basic-auth

thadir
2017-10-09 13:15
np, most of the pact folks are from Australia so time zone is a thing here :wink:.

nic
2017-10-09 13:15
yeah realised that - thought I'd chuck it in anyway and eventually somebody would read it

thadir
2017-10-09 13:17
Welp im in a EU time zone but use mostly the Java + JavaScript so yeah cant help you a 100% but the docs help

beth
2017-10-09 20:26
Yeah, sorry @nic, we were all asleep. Thanks @thadir. Glad you found an answer. If you can't find something in the docs, please let us know so we can add it.

beth
2017-10-09 20:27
It seems it was hard to find @nic. Is there some way to make it easier to find?

thadir
2017-10-10 15:34
before I forget (we had a great discusion about contract testing here :)) and one question I could not answer was well when somone asked when will the "beta" period end and when will we switch to a subscription and what pricing model will be used. There were also some discussion how to handle contracts ouside the span of your controll. When you start making a public API, we like the idea of the HAL browser and the insight the broker gives us. But we do not like the idea of some unkown force breaking our builds.

alexei
2017-10-16 12:48
Using Pact .NET Framework (which contain Ruby HTTP/S Engine?), I got the error message, when retrieving the PACT File for Provider verification. ``` Error reading file from https://xxx.pact.dius.com.au/pacts/provider/yyyy/consumer/zzzz/latest SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed C:/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect' ```

alexei
2017-10-16 12:49
with any https:// address

alexei
2017-10-16 12:50
please help to figure out, what the pact is going on?.

alexei
2017-10-16 12:51
uploading pact works fine.

alexei
2017-10-16 12:57
I found in pact-win32 ruby directory a ca-bundle.crt which is referenced by some config files of ruby, and which ist expired in 2015?.

alexei
2017-10-16 13:08
exchanged - nothing changed?.

alexei
2017-10-16 17:10
Solved: the environment blocked access to SSL certificates validation, Turned off SSL Certificate validation in Code for this to work. Probably an option (don?t check SSL Certificates for validity) for that could be helpful for some projects.

abubics
2017-10-16 22:31
don?t you ideally want the opposite of that? i.e. stop blocking cert validation

alexei
2017-10-17 09:01
@abubics I guess in many of test environments self-signed certificates are very common. Pact would not be able to work with the broker and (probably, did not check yet) internal https services this way.

beth
2017-10-17 09:04
@alexei glad you've fixed it, but I'm not sure why you've encountered this problem at this time. I wonder if it's a windows specific error. Is this the first time you've run this code on windows?

alexei
2017-10-17 17:15
no, it?s environment specific (I mean, restrictive firewalls here). Like if I execute - ?curl https://amazon.com? - SSL Certificate Error is returned. It is not very common for small companies, but could happen at large enterprises.

alexei
2017-10-17 17:17
I have the next question which is Pact related, but not PactBroker related.

alexei
2017-10-17 17:17
I have a pact which tells, that an array of objects is expected, size >1

alexei
2017-10-17 17:20
`MinType(new {id=type("abc")},2)`

alexei
2017-10-17 17:21
meaning, this response should match [ {id=?string?}, {id=?string2"},?] etc.

alexei
2017-10-17 17:26
in my ConsumerTest the mock is doesn?t generate concrete values, though, so that assertion: assert mockService.method().count > 1 fails (.count is 0)

alexei
2017-10-17 17:39
O_o actually pact file looks fine, hier are some snippets

alexei
2017-10-17 17:45
``` Body= new { entities = PactNet.Matchers.Match.MinType( new { properties = new { id = PactNet.Matchers.Match.Type("id"), description = PactNet.Matchers.Match.Type("desc") } }, 2) } ```

alexei
2017-10-17 17:46
Pact file: ``` "body": { "entities": [ { "properties": { "id": "id", "description": "desc" } }, { "properties": { "id": "id", "description": "desc" } } ] }, "matchingRules": { "$.body.entities": { "min": 2 }, "$.body.entities[*].*": { "match": "type" }, "$.body.entities[*].properties.id": { "match": "type" }, "$.body.entities[*].properties.description": { "match": "type" } } } ```

alexei
2017-10-17 17:48
actually expected, that ``` "entities": [ { "properties": { "id": "id", "description": "desc" } }, { "properties": { "id": "id", "description": "desc" } } ] } ``` will be returned by mock? Okay will try to debug a bit, ideas are welcomed. If I hardcore the exact two elements in Pact, then mock if returning them just fine.

eskimoquinn
2017-10-17 20:17
@beth was either my suggestion or your suggestion something that was ever implemented? If so can you point me to the version?

beth
2017-10-17 22:57
Can you log out the live body in your code? What do you get?

alexei
2017-10-18 12:25
Guess what. It wasn?t Pact Bug, it was a Pact feature! Response should have had another parameter, which I thought is not related to this pact, but it actually was! So that Consumer UnitTests failed with the right reason, perfect Pact job!

alexei
2017-10-18 12:29
The next hurdle. I want to UnitTest the Consumer method `doSmthWithServiceResponse()`, which looks reasonable at the moment. This method calls the Service (or Pact Mock in our case) and does a bit more with its response.

alexei
2017-10-18 12:31
Response has an ?entities?-array (above) - and the UnitTest fails, as ?postprocessing? of response requires that id-s (above) are different.

alexei
2017-10-18 12:33
so instead of ``` "entities": [ { "properties": { "id": "id", "description": "desc" } }, { "properties": { "id": "id", "description": "desc" } } ] } ``` I would need: ``` "entities": [ { "properties": { "id": "id1", "description": "desc" } }, { "properties": { "id": "id2", "description": "desc" } } ] } ``` to be returned. How (and if) I can implement that in Pact?

alexei
2017-10-18 12:36
Still for this same pact (type matching, no hardcoded values)

cornelia.zintl
2017-10-18 13:40
has joined #general2

alexei
2017-10-18 13:45
https://github.com/SEEK-Jobs/pact-net/issues/117 - basically the same, but simpler example

thadir
2017-10-19 10:52
A col fact for PACT users consumer driven contact testing is back on the ThoughtWorks techradar


jsilver
2017-10-19 18:12
Hey All, I'm integrating Pact testing and have a question: Let say I'm writing a contract to retrieve `zoo/cats/:id` and that contract expects the cat to have exactly 2 stripes, one blue eye, and one green eye. If our provider generates this exact cat, but with a nondeterministic ID, how can the consumer know which id to include in the request when generating a pact?

abubics
2017-10-20 04:32
Generally, you would set up whatever entities in the state pre-step. So, if the state is `special cat (2 stripes, blue eye, green eye)` you would make sure to set your data to have the expected ID, too.

abubics
2017-10-20 04:33
but, that?s a very specific scenario

abubics
2017-10-20 04:34
it?s probably more useful to generalise on the shape of the data, and only be so specific about data you?re explicitly setting

abubics
2017-10-20 04:35
like, if you have an endpoint that returns some of the data you send it, you could make sure that the response has the same literals

matt
2017-10-20 07:12
@jsilver typically you'll have a standard test data fixture for the provider which will have these entities created already.

matt
2017-10-20 07:13
You'll use provider states to manage the delta

mende
2017-10-20 15:08
has joined #general2

kevin.meiresonne
2017-10-26 11:55
has joined #general2

kevin.meiresonne
2017-10-26 11:56
Hi, I just found you can configure how to compare pact versions on https://github.com/pact-foundation/pact_broker/wiki/Configuration Is there a way I can change the version parser of a hosted pact broker at Dius?

eskimoquinn
2017-10-26 15:03
@matt is it possible to change values in the request before the call is made to the provider in the provider verification? I cannot create ids on the system that that I am verifiying, so the typical way to set of the provider states will not work for me.

eskimoquinn
2017-10-26 15:42
that is, we have a rest service that sits on top of a read only database, therefore we cannot create records with specific IDS. So ideally the consumer would supply a provider state, which we then could create a record of the id stated in the example from the PACT. However, we cannot do that because of the read only limitation. Can we change the request to put in another ID before the pact verification?

matt
2017-10-27 05:57
Hi @kevin.meiresonne, it can be done. Let us know offline and we'll set it for you.

matt
2017-10-27 05:58
You could in Java using request filters. What language are you again? If the values are known / static in the provider, why not just update the consumer tests with those values?

kevin.meiresonne
2017-10-27 09:36
Is there a way to query verification results based on a tag?

kevin.meiresonne
2017-10-27 09:39
I only find how to do it on a version e.g. /verification-results/consumer/{consumer}/version/{consumerApplicationVersion}/latest

eskimoquinn
2017-10-27 13:43
In this case, we are using ruby. For the second question, we did end up doing what you suggest but it increased the coordination needed between the consuming team the providing team, which while that works, its not ideal.

eskimoquinn
2017-10-27 15:06
@beth, @matt et. al. We are using the pact-provider-proxy gem and we would like to publish our verification results to the pact broker. However, when we set up our pact_helper to include the app_version and the publish_verification_results boolean, we get an error that indicates that our rack config is missing (http://config.ru). Is this a bug, or do we have something configured incorrectly? Also the tests do not run, yet it still sends a verification to the pact broker. Something seems amiss here.

eskimoquinn
2017-10-27 15:06
Actual error message

eskimoquinn
2017-10-27 15:08
Without this block, our test verify as we would expect.

matt
2017-10-27 21:35
Verification is still sent to broker on test failure, the status is different though (ie. A failure instead if a success)

matt
2017-10-27 21:36
Did you create a http://config.ru as the error suggested? (I'm just shooting in the dark here..)

matt
2017-10-27 21:37
@kevin.meiresonne I'm not sure if it does yet. @beth might know. We have something cooking on the horizon that will help in that space though

kevin.meiresonne
2017-10-30 08:06
@matt Great to hear. Happily be a beta tester for that.

beth
2017-10-31 03:55
@eskimoquinn I would recommend using the pact-provider-verifier gem instead

beth
2017-10-31 03:57
I haven't actually looked at the proxy gem for ages, as most people use the provider-verifier gem instead. The main difference between the two is that the proxy gem requires the provider states to be declared in a ruby file, where as the provider-verifier changes the states by hitting a url.

beth
2017-10-31 04:00
ok, I've had a look at the code. with the proxy gem, you should be configuring a rake task, not a service_provider block. You're overriding the default service provider configuration, which is why it's complaining about not finding the http://config.ru. the app_version and the publish_verification_results flag haven't been exposed in the rake task interface yet. I'll add them now.

beth
2017-10-31 04:30
@kevin.meiresonne I'm working querying verifications by tag at the moment. You can find this information currently but it takes a few calls. Have a look at this issue: https://github.com/pact-foundation/pact_broker/issues/141

beth
2017-10-31 04:32
@eskimoquinn I believe this feature will be available in the future, when we move to a shared rust implementation.

beth
2017-10-31 04:33
Oh, cool. I thought we were so old that we'd dropped off it!

beth
2017-10-31 04:44
I've also almost got a version of the index page that has the prod tag info on it, but the person asking for it stopped responding to me, so I've let it drop.

beth
2017-10-31 05:04
@eskimoquinn I've put out a new version of the provider-proxy gem with the new fields in the rake task.

kevin.meiresonne
2017-10-31 08:43
@beth Thanks for the update. I've been sharing some information with @matt on how we intend to use the broker, with some feature requests on the UI dashboard side. Happy to challenge what you've been working on on the index page :slightly_smiling_face:

beth
2017-10-31 09:33
There is a repositoryUrl available on the pacticipant resource. That's been in there since day 1, I'm surprised I didn't remember it.

beth
2017-10-31 09:37
Ah... that would be because it's in the database, but not in the resource.

beth
2017-10-31 10:08
I've updated the code to allow the repositoryUrl to be set, will deploy it some time in the next few days.

fergusstrange
2017-10-31 22:27
Seeing issues with the broker just now, any one else?

beth
2017-10-31 22:27
@kevin.meiresonne there is an alpha feature in the broker now that shows you the "matrix" of pacts and verifications. The URL is /matrix/provider/PROVIDER/consumer/CONSUMER

beth
2017-10-31 22:27
I just deployed

beth
2017-10-31 22:28
It may take a while to come up

fergusstrange
2017-10-31 22:28
Ah

beth
2017-10-31 22:28
let me check

fergusstrange
2017-10-31 22:28
:thumbsup: no worries, I'm off to bed anyway

fergusstrange
2017-10-31 22:28
:wave:

beth
2017-10-31 22:28
it looks like it's takeing longer than usual to recover, will check

beth
2017-10-31 22:34
Found the problem, redeploying now

beth
2017-10-31 22:41
Brokers back up, apologies for the outage.

beth
2017-11-01 01:04
Ok broker users, I have a new feature for you to beta. I haven't had time to give it a good shakeout yet, but I'm putting it out there because a few people have been asking for a similar thing, so I'll put it out and see how it goes. It's a tool set that allows you to check the verification results before you deploy a consumer.


beth
2017-11-01 01:05
Here are the usage instructions: ``` Usage: pact-broker can-i-deploy -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL Options: -a, --pacticipant=PACTICIPANT # The pacticipant name. Use once for each pacticipant being checked. -e, [--version=VERSION] # The pacticipant version. Must be entered after the --pacticipant that it relates to. -l, [--latest=[TAG]] # Use the latest pacticipant version. Optionally specify a TAG to use the latest version with the specified tag. -b, --broker-base-url=BROKER_BASE_URL # The base URL of the Pact Broker -u, [--broker-username=BROKER_USERNAME] # Pact Broker basic auth username -p, [--broker-password=BROKER_PASSWORD] # Pact Broker basic auth password -o, [--output=OUTPUT] # json or table # Default: table -v, [--verbose], [--no-verbose] # Verbose output. Default: false Returns exit code 0 or 1, indicating whether or not the specified application versions are compatible. ```

beth
2017-11-01 01:06
Here is an example of a query using the test broker (you can all play around with the data in there): ``` ./pact-broker can-i-deploy --pacticipant "Foo Web Client" --version 1.0.2 --pacticipant "Activity Service" --latest --broker-base-url https://test.pact.dius.com.au --broker-username dXfltyFMgNOFZAxr8io9wJ37iUpY42M --broker-password O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1 Computer says no \_(?)_/ CONSUMER | CONSUMER_VERSION | PROVIDER | PROVIDER_VERSION | SUCCESS ---------------|------------------|------------------|------------------|-------- Foo Web Client | 1.0.2 | Activity Service | 1.0.1 | false One or more verifications have failed ```

beth
2017-11-01 01:07
@kevin.meiresonne you can specify the version for the latest tag also by doing `--pacticipant PACTICIPANT --latest TAG`

beth
2017-11-01 01:12
For use in conjunction with the above tool, there is a `pact-broker create-version-tag` command. ``` Usage: pact-broker create-version-tag -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION Options: -a, --pacticipant=PACTICIPANT # The pacticipant name -e, --version=VERSION # The pacticipant version -t, [--tag=TAG] # Tag name for pacticipant version. Can be specified multiple times. -g, [--tag-with-git-branch], [--no-tag-with-git-branch] # Tag pacticipant version with the name of the current git branch. Default: false -b, --broker-base-url=BROKER_BASE_URL # The base URL of the Pact Broker -u, [--broker-username=BROKER_USERNAME] # Pact Broker basic auth username -p, [--broker-password=BROKER_PASSWORD] # Pact Broker basic auth password -v, [--verbose], [--no-verbose] # Verbose output. Default: false Add a tag to a pacticipant version ```

beth
2017-11-01 01:15
The recommended usage of these tools would be to tag the pacticipant version every time it is deployed to a stage (dev|test|staging|production) so that you don't have to know the exact version of the other services, but can refer to them as `--latest TAG` eg `--latest prod`

beth
2017-11-01 01:16
eg. on deploy of any pacticipant to prod `pact-broker create-version-tag --pacticipant Foo --version ${VERSION} --tag prod ...`

beth
2017-11-01 01:18
before deploy of a consumer to prod `pact-broker can-i-deploy --pacticipant "Foo Consumer" --version ${VERSION} --pacticipant "Foo" --latest prod`

beth
2017-11-01 01:22
Let me know if you have any questions, and what you think of it if you try it. It's just in dark release, so there's plenty of room for any necessary changes.

matt
2017-11-01 01:24
@matt pinned a message to this channel.

thadir
2017-11-01 09:47
@beth this looks interesting, we could use this in buildpipes like Jenkins to validate if somting can work in production. But this means the taging interface needs some TLC

thadir
2017-11-01 09:49
Nope you got updated, it helps that the microservice comuniety is loving it, im going to talk about it in a dutch tech meat up soon :slightly_smiling_face:. It has some downside as its a tool for a process and a mind set and when its not fully adapted there are a few snags.

eskimoquinn
2017-11-01 17:19
Thanks so much! Trying it out soon.

eskimoquinn
2017-11-01 17:21
Thanks!

jsilver
2017-11-01 19:09
I've been experiencing a flakey pact test while running tests in CircleCI. The Pact Server fails to boot, and throws an ` ECONNREFUSED`. I am yet to experience this locally but it's come up quite a bit while running in Circle. We're using `pact-js` and `jest`. Anyone seen this before?

matt
2017-11-01 20:11
@jsilver I haven?t seen that, no. My guess is that perhaps there is a race condition with starting the server and it being available for the jest test. I don?t know Jest very well, does it run in the browser?

matt
2017-11-01 20:12
it?s possible jest thinks the server is up, and the pact tests start (which involves sending http requests to the server). If the server is not yet available on the port that could cause that error

matt
2017-11-01 21:20
hi all, sorry for the interruption! We are looking to get some testimonials about Pact and the Broker from our most loyal users - you! We?d like to put this on our website and other marketing collateral going forward, so you?ll practically be famous... Whilst we appreciate any feedback, here are some options to consider, in descending order of complexity/effort: 1. Record a video hangouts type thing with a Q & A style interaction (we could obviously somewhat prepare this in advance) 2. Written case study (e.g. The tech stack, the environment, number of services etc. and how Pact and, ideally, the broker, was critical to your success) 3. Guest blog post type thing 4. Brief testimonial e.g. ?We use pact to move faster, safer? blah blah blah at <your organisation>? - <name> <title> Oh, and did I mention that we?ll be speaking at the popular YOW! Tech conference in Australia (Melbourne, Brisbane and Sydney) on Integration Testing strategies in early December? We?ll have a marketing campaign built around this that will likely include this material which could be great brand exposure. If this interests you, please contact me offline or drop me a note a .

pivison
2017-11-01 22:56
has joined #general2

jsilver
2017-11-02 20:56
Hey @matt, that's what we figured was happening. We're wondering if there's some kind of health check endpoint we can wait on to check the status of the server. I see that this package is deprecated, but it looks like there was some chatter on this issue: https://github.com/DiUS/pact-consumer-js-dsl/issues/32

matt
2017-11-02 22:14
You don?t really need a health check endpoint, simply knowing the port is available is all that is required - when the port is up, the service is up

matt
2017-11-02 22:14
make sense @jsilver?

beth
2017-11-02 22:58
@jsilver you can poll the root url with the header 'X-Pact-Mock-Service: true' and once the mock service is up, it will return a 200.

matt
2017-11-02 22:59
:point_up: even better

matt
2017-11-02 22:59
@beth is it possible the port is available but not the service?

beth
2017-11-02 23:00
Yup. I've been adding the tags to both the pact publishing and verifying code so that it's all done as part of the normal process. In regards to the tagging CLI `pact-broker create-version-tag`, what features would you like to see?

beth
2017-11-02 23:01
Could you explain your tagging/branching/release process?


beth
2017-11-02 23:20
So you can check the port any way you like. I've just tended to poll until that HTTP response came back 200 because otherwise you get an error response in the logs.

beth
2017-11-02 23:20
(if you try and it any url without an interaction being set up it will error)

beth
2017-11-02 23:21
I guess you could do a tcp connection without actually making a response as well.

matt
2017-11-03 07:44
That's what pact js does (tcp Conn)

matt
2017-11-03 07:44
Thanks, that's really helpful to know though

thadir
2017-11-03 13:29
@beth, sure ill do that later today when i have some time to explain this prity Java, C# process. For full automated release processes.

jsilver
2017-11-06 19:39
Hey @ and @, I'm still trying to debug the non-deterministic pact server failures and came across something interesting. Our `integration.log` shows the correct flow for the each test in the suite (interaction registered, request received, matching request found, interaction verified). However, the test fails with a Jasmine timeout error. We are using `pact-js` and Jest.

jsilver
2017-11-06 19:48
It appears that the above error has to do with the resolution of promises in the pact-js code. I'm looking into it further, but would appreciate any directional guidance

timothy.clifford
2017-11-06 22:31
@jsilver I?ll try and have a look later this evening

matt
2017-11-06 22:34
@jsilver I might be able to look a little later today, a PR would be most welcome if you can track it down. Thanks for your digging this far

matt
2017-11-07 12:10
@jsilver any chance you could please create an issue to track this on the `pact-js` repo? + Ideally a repro

alexei
2017-11-07 12:17
Using .NET Pact Framework, is there any feature for choosing arbitrary free port for the mocks, built-in in the framework? The reason is, that when some CI Jobs running in parallel for different services, ports collision is possible when the ports are hard-coded.

kevin.meiresonne
2017-11-07 13:42
not that I'm aware of, but it's pretty easy to implement that yourself.


jsilver
2017-11-07 15:27
@matt, I created an issue that includes the test file, and two log files as gists: https://github.com/pact-foundation/pact-js/issues/124. Thanks again for the help!

matt
2017-11-07 20:16
I?m not sure, sorry @alexei. You might need to ask on the Pact Net repo where Neil can answer (not sure he?s on here)

thadir
2017-11-08 10:49
We see this at random happen so now and then. If we kick the build ofthen enogh it will work. But it seems there are some small bugs. I cant see the brokers logging. But me thinks we found somting rare.

alok.pandey
2017-11-08 13:09
Hi @beth

matt
2017-11-08 13:57
has joined #general2

matt
2017-11-08 14:01
Is it common to have one broker for the entire company? Or should each team have a dedicated broker?

thadir
2017-11-08 14:06
@matt depens how you want to do it. We disided to use a broker for the whole company internal. So we all can see how things are tied and dependent. But were also going to as soon as we get a good feeling make a broker to help our clients to connect to get the full API structure of our clients depended on our API's in chart.

matt
2017-11-08 14:10
have you run into any issues sharing a broker with the whole company?

matt
2017-11-08 14:13
I'm wondering if the UI gets a bit messy with many pact files and no way to organize them.

kevin.meiresonne
2017-11-08 14:16
The current pact broker UI only shows the latest versions of the different pacts, so I think that's manageable. How many pacts does your company have (how many service to service dependencies?)

matt
2017-11-08 14:18
we are just getting started but have many teams (and lots of engineers)

matt
2017-11-08 14:18
I think i'm going to try a shared broker server and see how that goes

matt
2017-11-08 14:19
is there an option to pay for a professionally hosted broker? if so, is there pricing info available?

thadir
2017-11-08 14:48
@matt yeah it gets a bit clutterd. But the UI is the leaset of my concerns.. The test are the things im interested in and were starting to use the badges that @beth implemented a while back so they can see if its ok. The UI is more a thing we use to have the talk how our eco system looks like.

matt
2017-11-08 14:54
cool. thanks for the info.

matt
2017-11-08 14:54
maybe one day we'll have folder support in the UI

matt
2017-11-08 14:54
to organize all the pacts

thadir
2017-11-08 14:55
That will happen, there realy working on it. But there other concerns for now :slightly_smiling_face:. And still there doing a splended job in givin support

matt
2017-11-08 14:55
awesome

thadir
2017-11-08 14:56
just wished they would tell me when the beta was going to end. I sort of need to get time to arrange the money for the tool We realy want to pay it so they can even focus more on it.

matt
2017-11-08 14:57
yeah, I'd be happy to pay. Especially if that means features get developed faster


thadir
2017-11-08 15:19
:slightly_smiling_face:

beth
2017-11-08 20:42
Bargain

andrew.nicholson
2017-11-09 20:32
has joined #general2

andrew.nicholson
2017-11-09 20:44
Hello! I have a question about the pact-provider-proxy gem. Is there any way to get it to output a report file that could be read by a Jenkins job? I have Jenkins running my pact verification tasks, and would love to see the verification failures surfaced in the Jenkins interface.

andrew.nicholson
2017-11-09 20:47
Rspec tests are able to produce Junit output XML, which works perfectly -- is there anything like that?


matt
2017-11-09 20:57
Is there any reason why you?re using the `pact-provider-proxy` gem in the first place?

matt
2017-11-09 20:58
but the short answer (from me) is I?m not sure, but if not I think we would like to support this sort of thing

andrew.nicholson
2017-11-09 21:35
So, we're using the `pact-provider-proxy` gem in order to have our pact verification run against an external URL -- we aren't using a rack app. Is there something else we should be using for this purpose?

beth
2017-11-11 02:42
@andrew.nicholson use the pact-provider-verifier instead. There is an --format json option.

beth
2017-11-11 03:04
I've just added the --format RspecJunitFormatter option. You'll need pact-provider-verifier 1.10.0

matt
2017-11-11 05:50
@beth loving the JSON formatter on the verifier, we can now properly break down the provider tests in Go land and see specifically where things failed


beth
2017-11-13 02:17
@thadir @matt we wish we knew when the beta was going to end too! DiUS is a consulting company, not a product company, so we haven't had dedicated time in the past to work on it. This year should be different, as Pact and the Broker are becoming more central in DiUS' overall business plan.

beth
2017-11-13 02:18
The plan is to make Pact and Pact Broker development self funding, by charging for the features that will make pact work "at scale" (but still leaving the core product open source).

beth
2017-11-13 02:20
Talking of the open source product, somebody was wanting to view tags in the index page. I can't remember who it was. @kevin.meiresonne? I've just released this feature, and the documentation for it is here: https://github.com/pact-foundation/pact_broker/wiki/UI-Documentation

beth
2017-11-13 02:59
@matt in the backlog of features for the "pact at scale" version of the broker is proper authentication, authorization, user administration and permissions.

matt
2017-11-13 03:13
thanks. At work i've run into a bit of push back on using the DiUS hosted broker. The preference is for self hosted instances to minimize any security concerns.

beth
2017-11-13 03:14
Sure. At the moment, the docker one is basically the same product.

beth
2017-11-13 03:14
It's unlikely to get proper auth or user management any time soon however.

matt
2017-11-13 03:14
has DiUS dealt with larger companies before that have a security review process for vendors?

matt
2017-11-13 03:15
i'm wondering if there's already some marketing style PDFs to help persuade decision makers about DiUS

beth
2017-11-13 03:15
We've probably been involved in reviews from the other side! But the broker hasn't gone through that yet. You raise an excellent point.

beth
2017-11-13 03:15
Let me have a chat to @matt and see what we can come up with.

beth
2017-11-13 03:16
At the moment, all the material we have is on the http://pact.dius.com.au page.

matt
2017-11-13 03:16
i was super excited when DiUS provisioned our broker since we'd be able to get started immediately with Pact and not have to maintain yet another server. the initial reaction however was who is DiUS and why should we trust them with any of our data

beth
2017-11-13 03:16
That is a fair point! Trust must be earned.

matt
2017-11-13 03:17
a bunch of our APIs are open source so they don't raise any security concerns. I'm starting there for now with the hosted broker, other teams have already started spinning up internal servers. I think having one broker per team though isn't a great use of resources.

beth
2017-11-13 03:18
Given that the point is to share contracts between teams, you do loose some of the value.

beth
2017-11-13 03:18
You really want all the contracts for each service to be in the same broker, otherwise the can-i-deploy tools won't work.

beth
2017-11-13 03:18
Or rather, you want all the services that talk to each other to use the same broker.

matt
2017-11-13 03:18
that's great to know. i will keep this in mind when discussing pact internally

beth
2017-11-13 03:19
It's not such a bad thing to have a broker per "bounded context" however.

matt
2017-11-13 03:19
i love the idea of DiUS providing pact via software as a service. teams don't have to worry about server upgrades and can focus on testing. and then there'd be paid support available as well.

beth
2017-11-13 03:20
As in, if there are services that can be separated into groups that only talk internally, they could have their own broker. You'd lose value if you started spreading services that talked to each other across different brokers.

beth
2017-11-13 03:20
Exactly. Quite a few of the places where we have implemented pact are using old versions of the broker, and as it's moving quite quickly with feature addition at the moment, they're not getting the full value proposition out of pact.

beth
2017-11-13 03:21
As an example, the verification results and can-i-deploy tool (which I think are some of the most important features of the broker) have only been implemented in the last 6 months.

beth
2017-11-13 03:22
Also, the README badges... they're missing out on readme badges!!! :open_mouth:

matt
2017-11-13 03:22
:slightly_smiling_face:

matt
2017-11-13 03:22
we are just getting started with pact. here's a simple example of how we're using it on one team via Ruby: https://github.com/instructure/test_advisory_board/tree/master/pact

matt
2017-11-13 03:23
any idea what the consulting rate is for some high level advice? i think it'd save us a ton of time to have an expert explain the best use of Pact

beth
2017-11-13 03:24
Send an email to and we can have a chat about it.


beth
2017-11-13 03:24
It's a topic we like talking about, we're more than happy to do some consulting on it.

matt
2017-11-13 03:26
email sent :slightly_smiling_face:

beth
2017-11-13 03:27
Whereabouts is your team located @matt?

matt
2017-11-13 03:27
most of us are in salt lake city, utah

matt
2017-11-13 03:28
I work remotely


beth
2017-11-13 03:29
We're based in Melbourne, Australia, so there's the potential for us to do some online collaboration.

matt
2017-11-13 03:29
we're trying to figure out how to test APIs as we move to a microservices architecture. pact seems like an awesome fit.

beth
2017-11-13 03:29
That's what pact was written for, so yes, it is.

matt
2017-11-13 03:29
https://github.com/instructure/canvas-lms :arrow_left: is the main project we're working on

beth
2017-11-13 03:30
I threw together this the other day if you're interested: https://docs.pact.io/about_pact/history.html

matt
2017-11-13 03:30
one nice thing about Instructure is a bunch of the software is open source, so it's a bit easier to collaborate.

matt
2017-11-13 03:30
i read through the history, thank you for linking that on github

matt
2017-11-13 03:30
i think rust FFI for sharing code is interesting.

matt
2017-11-13 03:31
rust isn't a language i have any experience with, i'm more familiar with golang.

beth
2017-11-13 03:31
Yeah, it will be an interesting part of the journey.

matt
2017-11-13 03:31
we have some teams using Rust at instructure though and they like the language.

matt
2017-11-13 03:32
we had a similar issue at work recently, trying to figure out how to share a common server across many different languages. ended up selecting gRPC


beth
2017-11-13 03:33
Interesting!

matt
2017-11-13 03:33
i like gRPC because we are using a Kotlin server on Android/iOS/Desktop

matt
2017-11-13 03:33
if we used C++ or some other low level language, that's a bit more difficult to find contributors for.


matt
2017-11-13 03:34
I'm not sure if pact works with protocol buffers, GraphQL, or other more exotic API technologies.

matt
2017-11-13 03:34
most of our APIs are standard REST

beth
2017-11-13 03:35
No, it's not very exotic yet. HTTP for all implementations, and message support for JVM currently.

matt
2017-11-13 03:39
swagger + pact is also interesting, I wonder if there are any success stories with that approach beyond Atlassian.

beth
2017-11-13 03:39
I haven't actually used it myself yet, but you could try asking on the gitter channel.

beth
2017-11-13 03:43
Really interesting slidedeck @matt, thanks.

matt
2017-11-13 03:50
we looked at a *ton* of options for reusing code across arbitrary languages :slightly_smiling_face:

matt
2017-11-13 03:50
nice part about gRPC is all the code gen is for free from the protobuf.

matt
2017-11-13 03:51
pretty sure they support all the languages Pact uses as well.

matt
2017-11-13 03:51
i wish kotlin native was a bit further along in development, that seems like an interesting option.

matt
2017-11-13 06:51
@thadir @matt I know it wasn't necessarily what you meant, but I am here to assure you that beta doesn't mean we don't take responsibility of your data and the platform seriously. We do.

matt
2017-11-13 06:53
As Beth mentioned, things are starting to move and we should have more traction coming into the new year. All going to plan I'll have some dedicated time in my schedule permanently on improving and growing this product. We do really appreciate your patience in the meanwhile

matt
2017-11-13 06:54
One thing we could be better at is publishing the many new features incorporated into the broker which are cooking in weekly or better.

abubics
2017-11-13 06:59
Maybe it?s worth mentioning, too, that it?s unlikely that there?s anything sensitive in your test data.


abubics
2017-11-13 07:00
If there is, perhaps you?re relying on security through obscurity, which is a whole other class of problem :wink:

abubics
2017-11-13 07:01
Hopefully there are no algorithmic-detail trade secrets leaking out through APIs :thinking_face:

matt
2017-11-13 07:01
It's normally structure of APIs etc that people concerned about. But I suppose we don't want to be seen as deflecting responsibility either!

matt
2017-11-13 07:02
Well, if you think of APIs as products they could be quite revealing of a companies strategy

abubics
2017-11-13 07:04
true . . . new pact tests for features under development could always be a leak risk. Especially for internal APIs.

kevin.meiresonne
2017-11-13 08:08
@beth Thanks for the initial support for tags on the broker UI! Already helps me a lot in verifying results across our branches!

thadir
2017-11-13 09:21
@matt and @beth im quite sure you do. And im loving you folks so mutch, im goin to do a meetup in the Nehterlands all about pact and why we want to use the service. And there a few feature request ill have when we start paying :innocent:

matt
2017-11-13 09:32
Request them now and you might get them for free :grin:

thadir
2017-11-13 09:41
Lol, it has to do with autentication and richts, I want to be aible to mark pacts for "public" and "private" groups. MOre in the sence like we got our internal API's and then we got the API's we expose to uor clients.. Its a payed feature eather way for the broker :slightly_smiling_face:

beth
2017-11-13 09:41
That makes sense. We've had a few discussions along similar lines.

beth
2017-11-13 09:42
Do you use github for your repo?

matt
2017-11-13 09:43
Yep, we've been thinking about how to deal with this. Lots of ideas, we'll definitely run ideas by you

thadir
2017-11-13 09:46
Also, we been working with a lot of AIM sulutions as for our product, so if you need to figure out what kind of autentication protcol you want I can help with that my skils in Ruby are non existanced but im prity god at scala and java these days. We do not use git, we use bitbucket for our software and most is closed sorce alas. But im hoping to change that a bit :slightly_smiling_face:

beth
2017-11-13 09:47
Does bitbucket do social login?

thadir
2017-11-13 09:48
Not any more, let me check. It alouwes google login

beth
2017-11-13 09:48
that's a pity. Are you interested in using google as a social login?

thadir
2017-11-13 09:52
Nope, not for our source, were going to us federation based autentication to unlcok some of those features this would be openid connect or somting in those lines (were still looking in to it). The big idea is that were going to be the Autenticaiton Broker for the european harbor market. And you want to keep social (life) and corparate (work) seperate. Were still doing the design session on those tho.

beth
2017-11-13 09:54
So, you're still working on a federated identity server then? So you'd just want a "local" pact broker login for each user to start with.

thadir
2017-11-13 09:59
@beth sor tof, were goin gto implement an federation setup based on openid connect. This is a good protocol and thats how we want to help our clients to work with our sytems. And thus also for the pacts. But were still in the product picking phase of figuring out where to buy the solution seeing that openid connect is quite new and no one relay supports it 100% to spec atm. So there looking at road maps etc seeing who fits the bill the best.

beth
2017-11-13 10:00
Understood.

andrew.nicholson
2017-11-13 14:16
I am looking at migrating our current provider setup to use the `pact-provider-verifier` gem -- it looks like to setup provider states we will now need to put an HTTP endpoint on our provider to handle that setup?

andrew.nicholson
2017-11-13 14:16
Previously with the `pact-provider-proxy` we were able to define that setup in a ruby file

matt
2017-11-13 14:40
Yeah, that's the primary concern. Leaking new features.

jsilver
2017-11-13 14:47
Hey @matt. After some experimenting I found that the Jest's parallelized test running was causing the flakiness / non-determinism. I've added a comment to the issue I filed (https://github.com/pact-foundation/pact-js/issues/124). Any ideas of why this might be happening?

rolyat.wilson
2017-11-13 18:21
has joined #general2

matt
2017-11-13 20:17
Replied on the issue itself, thanks Jeff

beth
2017-11-13 22:25
We need to put some warning front and centre on the JS repo about running in parallel @matt

matt
2017-11-13 22:28
I added to troubleshooting section, and also to section on Jest tests

beth
2017-11-13 22:29
@andrew.nicholson yes, that's the language independent way of setting up provider states. Note that the URL doesn't have to be in the application itself, it could just be a little rack server running with the same connection to the db.

beth
2017-11-13 22:30
There was some functionality that the proxy didn't have that you wanted, that the verifier gem did, just trying to find what it was.

beth
2017-11-13 22:31
Ah, right, it was the XML output.

beth
2017-11-13 22:34
ok, I'm not sure if this will work, but give this a go with your original pact-provider-proxy gem. Add the `rspec_junit_formatter` gem to your bundle.

beth
2017-11-13 22:38
In your pact_helper.rb file ``` require 'rspec_junit_formatter' ::RSpec.configuration.add_formatter RspecJunitFormatter, "rspec.xml" ```

beth
2017-11-13 22:39
If that doesn't work, I'll have a look at adding it officially to the API so you can keep using it.

beth
2017-11-13 22:39
(Really, most of the support goes in to the verifier these days though)

andrew.nicholson
2017-11-13 23:20
@beth Noted re: the provider states. I'll try that out -- thank you!


andrew.nicholson
2017-11-14 14:58
@beth that appears to work -- thanks so much for the quick, helpful response. we are looking at upgrading to the verifier gem in the future

thadir
2017-11-14 16:53
Hmm been digging trough the pact-jvm project and the documentation so i can do a presentation on the Pactbut the doucmentation for JVM is a bit a hard read. If you go blank in to it.

matt
2017-11-14 20:25
@thadir we have a few slide decks we use, perhaps we could share with you as a starting point? What?s the purpose of your talk?

thadir
2017-11-14 20:50
The name is to pact or not to pact. And the purpose is explaining how we ended up with pact and choosing for it. And the pitfalls around it if you think it's a magic bullet

matt
2017-11-14 20:52
cool, that is a pretty standard talk for us. In fact, we?ve done 2 of them in just the last 2 business days :slightly_smiling_face: @rholshausen @beth - any thoughts?

thadir
2017-11-14 20:57
And of course the things we think why folks need to work with it :slightly_smiling_face:. Im prity happy the flow were sorta going for a story telling style (well my first ddraft got 9 days to finish it XD). Also making some cool demo code that ill put on github for folks to play with.

thadir
2017-11-14 21:02
But im going to turn in for the night :slightly_smiling_face:. cya later folks



beth
2017-11-15 04:01
I'm a bit wary of the sharpened pencils however. Seems like a recipe for disaster with toddlers.

beth
2017-11-15 04:01
@thadir my slides are pretty old now, and tbh, quite ugly!

timothy.clifford
2017-11-15 04:05
#2 pencils - that?s very precise.

thadir
2017-11-15 15:49
@beth ill restyle them its just inspiration im looking for

fkoner
2017-11-15 16:03
has joined #general2

andrew.nicholson
2017-11-15 17:48
Whoa! I was going to ask for a feature to have showing pacts by tag on the front-page of the pact-broker, but I see now that it's already implemented in the newest version! Super rad!

beth
2017-11-15 21:54
It's all going on at the moment in the broker @andrew.nicholson. Like a frog in a sock.

beth
2017-11-15 21:56
@thadir The animations on slide 11 I find are very helpful in explaining the steps of pacting: https://docs.google.com/presentation/d/15Be5WOS6CTGDh_9aHEmpgrh69U0QedFxfhSTJnyXPNo/edit?usp=sharing

matt
2017-11-15 21:59
I hope that Aussie colloquialism lands :grin:

thadir
2017-11-15 22:31
Thx ill look in to it :slightly_smiling_face:


beth
2017-11-16 05:06
@andrew.nicholson you don't happen to live in Melbourne do you? I know an Andrew Nicholson, but I imagine there are a few around.

andrew.nicholson
2017-11-16 14:17
@beth no go, I'm in Ann Arbor, MI USA

kevin.meiresonne
2017-11-17 08:59
Question: is there an easy way to only publish pacts to the broker if they have actually changed? Currently we publish everytime our build succeeds which leads to a lot of published pacts which are actually identical to previous versions.

beth
2017-11-17 09:24
Yes, that's ok. The underlying content is not recreated.

beth
2017-11-17 09:25
You want to publish each time, because otherwise you won't get a result from the can-i-deploy tool for that version.

beth
2017-11-17 09:28
The broker is designed to work with CI, and it assumes that a great number of the pacts will be identical. When you publish a verification, it's actually linked to the underlying content, not the publication. This is why, if you publish an identical pact, it will be "pre verified" if the version before it was already verified.

kevin.meiresonne
2017-11-17 09:57
Oh, so if I push the same pact multiple times with a different version (git sha), it won't store the contents of that pact multiple times if it's the same?

kevin.meiresonne
2017-11-17 09:58
That's brilliant!

beth
2017-11-17 10:20
I like to think so :wink:

beth
2017-11-17 10:22
But really, it's just that it was designed to work with CI, so it made sense.

matt
2017-11-17 10:36
The pre verification that we achieve as a result of this magic is one of the biggest benefits. It means your consumers aren't constantly having to wait for providers to reverify a contract for each trivial build.

kevin.meiresonne
2017-11-17 12:13
Is this explained somewhere? Wasn't aware of this at all, and it's a key benefit!

matt
2017-11-17 12:26
I think it's on the wiki, but we definitely need to start communicating the features better for sure

beth
2017-11-17 20:45
Good point @kevin.meiresonne. There's a high level mention of verifications on the README, and a how-to on the wiki, but I don't think I've explained the versioning and pre-verification anywhere properly.

thadir
2017-11-22 19:32
So been going trough the motion, tomrow ill be holding the presentation and also finsihg up the demo code box for PACT. For the ones interested this is the flow im going for its a rough scetch: https://docs.google.com/presentation/d/1ETU1XXXZ9UEQT8aWPVcN7pj7x1afYlyCvx3FcKQzSLw/edit?usp=sharing

beth
2017-11-22 21:40
Love the sub title

beth
2017-11-22 21:44
Looks good!

thadir
2017-11-22 22:20
:slightly_smiling_face: yeah, stole it from your slides @beth good inspiration :wink:

rholshausen
2017-11-22 22:28
@thadir Awesome visualisation on the complexity of micro-service interactions, well done!

thadir
2017-11-22 22:30
That was the reason we wanted to go this route. Tomorow ill make more demo code (get my scala on etc )

thadir
2017-11-23 22:34
Wel did the talk was a sucsess (ended up doing it dutch bc all english speakers didnt show up on the meet up :)). But was asked to do it again. Will update the demo code, is there also a demo packt broker I could use for this so we actealy have a real life test example of the many pact test there are posible?

rholshausen
2017-11-23 22:37
I'm sure @matt could get one setup for you

matt
2017-11-23 22:38
yep, I can do that. Or you can use the `http://test.pact.dius.com.au` broker which is a bit of a free for all

matt
2017-11-23 22:39
also, awesome!!

thadir
2017-11-23 23:46
@matt ill use that one, were going ot make the consumer in most suported language and then I want to keep it up to dat so you got a good example of how to use pact (and thus somting in the way of the spring-boot examples) repo

beth
2017-11-24 00:52
The creds are ``` Broker user: dXfltyFMgNOFZAxr8io9wJ37iUpY42M Broker password: O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1 ```

thadir
2017-11-24 08:57
Thx, ill do that thi sweekend :slightly_smiling_face:

raghunandanjahagirdar
2017-11-26 11:02
has joined #general2

zac.sims
2017-11-28 11:11
has joined #general2

zac.sims
2017-11-28 11:36
Hi :)

thadir
2017-11-28 12:02
Hey @zac.sims and @raghunandanjahagirdar welcome to the PACT hangout for the guys who like to pact :wink:

zac.sims
2017-11-29 09:55
@beth thanks for the quick account verification, much appreciated

beth
2017-11-29 09:56
My pleasure. Let me know if you have any queries.

beth
2017-11-29 09:58
If you don't get a response for a while, it's because we live in Australia, and we're probably asleep! But we've got a really great and experienced group of users who should be able to give you an answer if we're not around.

beth
2017-11-29 10:02
@thadir I'm madly practising for my YOW talk now, and it just occurred to me how tricky it would be to practice a talk in one language, then present it in another. I'm impressed!

thadir
2017-11-29 10:04
@beth english was the practiced one :slightly_smiling_face:. But english and dutch are a bit close so no worries.

zac.sims
2017-11-29 10:06
I'm in Melbourne :)

zac.sims
2017-11-29 10:08
Good luck for YOW! (tomorrow? Or the Sydney one?)

kevin.meiresonne
2017-11-29 10:25
English and dutch are close? Dat is de eerste maal dat ik die hoor! :slightly_smiling_face:

thadir
2017-11-29 10:50
Kevin, natuurlijk wij zijn angolsacties en we hebben zo veel engelse woorden in onze eigen taal :wink:.

zac.sims
2017-11-29 18:58
See, this is why we need contracts :joy:

thadir
2017-11-29 19:04
Exactly :wink:

beth
2017-11-29 22:51
Tomorrow in Melbourne, then Brisbane and Sydney next week.

beth
2017-11-29 22:51
Thanks!

beth
2017-11-29 22:53
I'm interested to know, from the developers who work in non-english speaking countries, what proportion of code is english based vs local language?

thadir
2017-11-29 22:56
Hmm, code base is a mix between dutch and english. Seeing that the "language for perticular things in the harbor" is so Tipacly dutch that we disided that most stuff wil be english. But if it reperesents soming so particular to the market we sort of mix it up. Code is mostly english seeing thats natural. Java DOC to but some of the prosess analys documents are dutch

beth
2017-11-29 22:57
Hello, neighbour.

beth
2017-11-29 22:58
Interesting. Thanks.

thadir
2017-11-29 22:59
But @beth I must say it is difrent per company. For example I worked for banks mandatory english bc the european legestatrion is english. etc.

beth
2017-11-29 23:00
Ah, I see.

kevin.meiresonne
2017-11-30 08:44
Our code base is 100% english

kevin.meiresonne
2017-11-30 08:45
But we're a global company, so we have many different nationalities

thadir
2017-11-30 12:13
So a calouge taged me on this http://cloud.spring.io/spring-cloud-contract/ quite interesting. It feels very PACT based tho.

dniles
2017-11-30 13:54
has joined #general2

matt
2017-12-01 11:14
@thadir yeah we chat to them a bit. Nice people, and they've added support for Pact contacts too!

matt
2017-12-01 11:15
I don't do much Java these days, but if you try we'd be keen for feedback etc

thadir
2017-12-01 11:24
We will pock it @matt we use PACT and i sort of like it mostly and the cross platform part. (And yes I don't like the fact I get Scala for my test but I can live with it). Ill defently will try it but its already PACT wise here :wink:.

kevin.meiresonne
2017-12-04 09:56
I'd like to put pact verification badges on our build dashboard. I found in the documentation how to get the badge of the latest verification of a tag of a certain consumer. However, I want to put a badge for the latest verification of a certain tag of my provider. In other words: I want the latest verification badge of the "master" tags of my consumer and provider. Is that possible?

beth
2017-12-04 09:59
That makes perfect sense. Not yet, but let me make an issue for it. It shouldn't be hard.


kevin.meiresonne
2017-12-04 10:00
Great! Thanks!

beth
2017-12-04 10:02
Just thinking about the URL. `https://your-broker/pacts/provider/PROVIDER/consumer/CONSUMER/latest/TAG/badge.svg` We don't currently have an example of anything that specifies both a consumer tag and a provider tag.

kevin.meiresonne
2017-12-04 10:03
yes, indeed

beth
2017-12-04 10:03
We're really not looking up the status of a pact now, we're looking up the status of a verification that is selected by both consumer and provider tags.

kevin.meiresonne
2017-12-04 10:04
I thought as much, a URL with tags for both provider and consumer would make sense though

beth
2017-12-04 10:04
Actually. It's almost like a status badge for a matrix row.

kevin.meiresonne
2017-12-04 10:04
at least for us

kevin.meiresonne
2017-12-04 10:04
exactly

beth
2017-12-04 10:04
I could reuse that URL definition.

kevin.meiresonne
2017-12-04 10:04
except that the matrix doesn't show tags yet

kevin.meiresonne
2017-12-04 10:05
which makes it VERY large after a while :slightly_smiling_face:

beth
2017-12-04 10:05
Yeah, sorry. I havne't forgotten about it. I'm just snowed under.

beth
2017-12-04 10:05
Presenting at a conference this week.

beth
2017-12-04 10:06
Yes, the matrix does become large quickly! I didn't put paging on the UI resource initially, and I tried to load one of the pages, and it took AGES AND AGES and I was like, oh, there's something wrong with the kube stack... but no. Just the effect of a many to many relationship!

kevin.meiresonne
2017-12-04 10:07
no worries

kevin.meiresonne
2017-12-04 10:07
trying to get the company to adopt pact across the platform

beth
2017-12-04 10:07
You know how to query the matrix by tags right? It's just that they don't come back in the results.

kevin.meiresonne
2017-12-04 10:08
so things like these do help make my case :slightly_smiling_face:

beth
2017-12-04 10:08
indeed.

kevin.meiresonne
2017-12-04 10:09
is the querying the same as on the "home"?

kevin.meiresonne
2017-12-04 10:09
?tags=mytag

kevin.meiresonne
2017-12-04 10:09
or something else?

beth
2017-12-04 10:16
I haven't written up the user docs yet, but here is the pact between the broker client (the `can-i-deploy` tool) and the broker https://github.com/pact-foundation/pact_broker-client/blob/master/doc/pacts/markdown/Pact%20Broker%20Client%20-%20Pact%20Broker.md

beth
2017-12-04 10:18
You would do `q[][pacticipant]=PROVIDER&q[][pacticipant]=CONSUMER&latestby=cvp&latest=true&tag=master`

kevin.meiresonne
2017-12-04 10:27

kevin.meiresonne
2017-12-04 10:27
I'm probably doing it wrong :slightly_smiling_face:

beth
2017-12-04 10:28
No, the two URLs don't go together.

beth
2017-12-04 10:28
There are two formats.


beth
2017-12-04 10:29
I haven't made a fully queryable UI page yet.

beth
2017-12-04 10:30
To do the full query, do a curl and set your content type to "text/plain".


kevin.meiresonne
2017-12-04 10:31
ah right

beth
2017-12-04 10:31
You'll need to use -g to stop it interpolating the [] if you're on mac

kevin.meiresonne
2017-12-04 10:31
I thought you referred to filtering on the UI

beth
2017-12-04 10:32
I developed the API for the can-i-deploy, then did a very basic UI on top of that just to be able to visualise it properly, but I didn't put the full querying into it (yet).

beth
2017-12-04 10:32
Then, I was finding it hard to visualise the JSON returned by the API, so I added a text/plain content type that returns a table.

beth
2017-12-04 10:33
I need to properly document the format for querying the matrix.

beth
2017-12-04 10:34
You can reverse engineer it by looking at the queries generated by the different scenarios in the can-i-deploy documentation here: https://github.com/pact-foundation/pact_broker-client#can-i-deploy

beth
2017-12-04 10:36
We want the badge to be the same as the results for `pact-broker can-i-deploy --pacticipant CONSUMER --pacticipant PROVIDER --latest TAG`

beth
2017-12-04 10:36
Anyway, gotta head to bed now. I'll get on to it ASAP. Working on verification hooks now, because I may have said in my talk that they already existed...



siaynoqmage
2017-12-04 22:37
has joined #general2

siaynoqmage
2017-12-04 22:44
Hi - I'm looking for a working example with Pact (in .NET) using AMQP (RabbitMQ) protocol - can anyone provide me one? :slightly_smiling_face: thanks in advance!

beth
2017-12-04 22:45
Hi Zoltan. Unfortunately, the message pact is currently only implemented for the JVM.

beth
2017-12-04 22:45
We're working on adding it to the other implementations.

siaynoqmage
2017-12-04 22:45
I see

beth
2017-12-04 22:45
However, it's not that hard to write a message contract yourself.

beth
2017-12-04 22:46
You can still use the broker to exchange the contracts.

beth
2017-12-04 22:46
I know it's not .net, but here's an example of writing your own contract: https://github.com/DiUS/diy-contract-example

siaynoqmage
2017-12-04 22:46
no worries, thanks for the info :slightly_smiling_face:

beth
2017-12-04 22:46
Message contracts are super simple, because there's no interaction, just a list of messages.

beth
2017-12-04 22:47
If you have a look at the pact specification v3, you'll see the format that pact uses for serialising the messages. It's pretty similar to the http pact, except the "interactions" key is called "messages".

beth
2017-12-04 22:49
The key is to separate your message writing and handling code from your message sending and retrieving code. Then you write the contract between the writer and handler, effectively ignoring the protocol.


siaynoqmage
2017-12-04 22:51
great, I'll have a read and let you know if something is still unclear :slightly_smiling_face:

thadir
2017-12-05 10:02
Hmm, I got a good question to day.. PACT is realy json based but some of our old webservices use XML and SOAP that is actealy also interesting to put under pact to see who provides and who conusmes. Is this posible with PACT

matt
2017-12-05 10:50
The principle is the same yes, however as you guessed we only really support JSON matching at this point. I think JVM supports XML but none of the matchers. PR welcome :grin:

thadir
2017-12-05 11:02
Lol I use JVM biger problem for me is that the i get SCALA for free with the JVM version test. Not that i mind but its just a lot of data for a test.

pfajardo
2017-12-05 18:13
has joined #general2

matt
2017-12-05 21:29
:slightly_smiling_face:

sharding
2017-12-08 00:08
has joined #general2

sharding
2017-12-08 00:09
Hello, I am new to Pact and Brokers. I am curious if it is possible to publish a broker to heroku?

sharding
2017-12-08 00:09
Thanks

beth
2017-12-08 00:10
I think there's an example in the code base.

beth
2017-12-08 00:10
Have a look in the example folder.

sharding
2017-12-08 00:11
Sorry I forgot to say on node js.

sharding
2017-12-08 00:11
I saw the one with ruby.

beth
2017-12-08 00:12
No. There's only a ruby implementation.

sharding
2017-12-08 00:12
So, it is not possible to use node js?

beth
2017-12-08 00:12
Do you mean, running a broker on node, or using Pact with node?

sharding
2017-12-08 00:13
running a broker on node with heroku.

beth
2017-12-08 00:13
No. It's written in Ruby.

matt
2017-12-08 00:13
But you could definitely host it on Heroku

matt
2017-12-08 00:13
I?ve thought about making a one-click deployment for it, just never got around to it

sharding
2017-12-08 00:14
So, in order to use a broker it has to be written in ruby?

matt
2017-12-08 00:14
no, the Broker is written in Ruby. It has an API, so in theory you could use any language

matt
2017-12-08 00:14
we have first class support for the broker in Ruby, JVM, JS, Python, Golang and probably others too

beth
2017-12-08 00:14
It uses a JSON api, the implementation language is irrelevant.

sharding
2017-12-08 00:15
sorry... So I can use js with heroku to publish a broker?

sharding
2017-12-08 00:15
I have been researching how to do this all day, with no luck.


beth
2017-12-08 00:18
Have a look at that example

matt
2017-12-08 00:20
@sharding can you provide some more background on what you?re trying to do? The broker is (simplified) a repository of pact files, with an API on top of it. It is written in Ruby, and so has to be running in a Ruby runtime - you could host it on Heroku. Pact more broadly is a testing framework, that requires pact files to be generated (from the consumer) and validated (by the provider). The broker is one, and the recommended way, to share and collaborate on those files

matt
2017-12-08 00:20
Those tests will be written in whatever language your consumer/providers are written in (e.g. JVM, Go, Ruby etc.)

matt
2017-12-08 00:21
If you don?t want to host your own, you could signup for one at http://pact.dius.com.au/

beth
2017-12-08 00:21
Any reason why you wouldn't use a hosted one?

sharding
2017-12-08 00:22
@matt I am trying to do this in js ```const opts = { pactUrls: 'PACT_URL', pactBroker: 'HEROKU_URL_HERE', pactBrokerUsername: keys.PACT_BROKER_USERNAME, pactBrokerPassword: keys.PACT_BROKER_PASSWORD, tags: ['prod', 'test'], consumerVersion: '1.0.0' } pact.publishPacts(opts) .then(() => { console.log('Pact contract publishing complete!') }) .catch(e => { console.log('Pact contract publishing failed: ', e) })```

sharding
2017-12-08 00:23
but if I create a node based heroku app then use that url, it will not work.

sharding
2017-12-08 00:24
Maybe I am thinking about this wrong.

matt
2017-12-08 00:25
ok so can I assume that you have a local consumer test similar to https://github.com/pact-foundation/pact-js/blob/master/examples/e2e/test/consumer.spec.js ?

matt
2017-12-08 00:25
?and that you have some local pact files ready to publish?

beth
2017-12-08 00:29
I think we're all getting confused about the distinction between deploying a pact broker (an application that is written in Ruby and has a JSON api) and publishing a pact to the broker using node.

sharding
2017-12-08 00:42
@matt yes. I have all of the above.

matt
2017-12-08 00:42
OK cool, so it?s just the Broker you are trying to deploy to Heroku? And as Beth asked, any reason not to just get a free managed one from https://pact.dius.com.au?

sharding
2017-12-08 00:43
No reason just want to set out to finish what I started.


sharding
2017-12-08 00:44
and yes trying to deploy a broker to heroku.

sharding
2017-12-08 00:45
when I setup a heroku instance in node, it will not let me publish it.

sharding
2017-12-08 00:45
I keep getting an error.

matt
2017-12-08 00:46
OK, so can you confirm your broker is running in Heroku? Can you cURL it or something to see if it is responding?

matt
2017-12-08 00:46
How have you set the Heroku instance up?

sharding
2017-12-08 00:46
heroku create, then push to master.

sharding
2017-12-08 00:46
with express.

matt
2017-12-08 00:47
It sounds like you?re trying to deploy your application/API to heroku, not the broker

sharding
2017-12-08 00:48
ok. I am not quite following.

matt
2017-12-08 00:49
You are talking about express, which is a Node libarry. So you can?t be deploying the broker, which is a Ruby app. What are you deploying to Heroku?

sharding
2017-12-08 00:51
ok. so basically I need to setup a heroku instance using ruby on heroku, then use the pact api to connect to the instance?

matt
2017-12-08 00:51
I think there is a more fundamental confusion, which perhaps we should clear up

matt
2017-12-08 00:52
I?m wondering if perhaps you?re mixing up the publishing of the contract part from the consumer test, from the verifying the contract part on the provider API. What is the express app that you?re publishing to Heroku?

sharding
2017-12-08 00:53
the provider.



matt
2017-12-08 00:54
The code from above has nothing to do with the provider, it is about taking the pact file (a `.json` file somewhere in your code base probably) and publishing it to the Broker. In that snippet of code above, you are telling it to publish the contract to `HEROKU_URL_HERE`, which isn?t a Broker, but your provider API

matt
2017-12-08 00:56
the workflow should look more like this 1. Consumer test runs, producing a `my-consumer_my-provider.json` type file 2. Publish this file somewhere (e.g. a broker) 3. Verify that your provider API meets the contract, by downloading all contracts (from a broker) and running the pact verifier against your running api (in this case, you wanted to run it against an API deployed to heroku)

beth
2017-12-08 00:57
Though if you can run your provider locally, it will make your life easier

matt
2017-12-08 00:57
JS example of those three steps are in https://github.com/pact-foundation/pact-js/tree/master/examples/e2e/test 1. consumer.spec.js 2. publish.js 3. provider.spec.js and as beth says, you probably don?t want to be doing step 3 against a Heroku published app, but one running locally

matt
2017-12-08 00:58
Might I suggest you have a run through https://github.com/DiUS/pact-workshop-js to understand all of these concepts better, including publishing to a broker (last step)

sharding
2017-12-08 00:59
thats exactly what I am following. I did the entire thing.

sharding
2017-12-08 00:59
except the broker part will not work the way I am trying.

sharding
2017-12-08 00:59
so can I do the `pactBroker:` from my example, with a localhost url?

matt
2017-12-08 01:00
only if you have a running pact broker on your localhost, which I?m guessing you don?t

matt
2017-12-08 01:00
that parameter needs to be pointed to a running pact broker instance, which is this Ruby app: https://github.com/pact-foundation/pact_broker

sharding
2017-12-08 01:01
point to a running pact broker using ruby, even if it is localhost?

beth
2017-12-08 01:02
That sentence is ambiguous!

beth
2017-12-08 01:02
The broker is running on ruby. Your pact publishing code is node.

sharding
2017-12-08 01:02
gotcha.

sharding
2017-12-08 01:03
So if I create a ruby server locally I can point my js api to that?

sharding
2017-12-08 01:03
using local host.

beth
2017-12-08 01:04
You can use the locally running broker as a way of exchanging the pact.


sharding
2017-12-08 01:05
and then point to it from my js code.

beth
2017-12-08 01:05
If you let us know which hosted broker you have we can tell you what the configuration should look like.

sharding
2017-12-08 01:05
`hosted broker`?

matt
2017-12-08 01:05
You could run the broker locally. But for real apps you wouldn?t do that. Think of the pact broker as a database for your Pacts. It needs to be a long lived application running somewhere that all of your consumers and providers publish and read from. So if it?s only on your machine it won?t enable the collaboration you need.

matt
2017-12-08 01:06
https://pact.dius.com.au <- get a FREE hosted broker here (that?s what this Slack channel is about) and you don?t need to manage your own broker _at all_

beth
2017-12-08 01:06
This is a slack channel for the DIUS hosted broker product.

sharding
2017-12-08 01:09
k. Thanks for the help

beth
2017-12-08 01:13
Happy to help. Even if we were a bit confused about what we were helping with! Do let us know if you can't work past this. Having your code in a public repo or a gist would make it easier to pinpoint problems.

beth
2017-12-18 04:32
@kevin.meiresonne I've made you a Christmas present. You can get your matrix badge at `/matrix/provider/PROVIDER/latest/PROVIDER_TAG/consumer/CONSUMER/latest/CONSUMER_TAG/badge.svg`

alok.pandey
2017-12-18 12:43
Hi

alok.pandey
2017-12-18 12:43
Guys

alok.pandey
2017-12-18 12:45
If suppose we are running pacts consumer with junit ....can these be ran with maven tests like a normal test which run with maven test command...

thadir
2017-12-18 16:03
Ow yeah easy peasy

thadir
2017-12-18 16:05
As long as you fit to the JUNIT sceme name it works fine. This is the provider. Consumer is even more convienten as its a @Rule for a unitest. You should to add some asserts.

sharding
2017-12-20 22:26
I know this is a pact broker channel, but I am curious if it is possible to do multiple interactions in pact with just one server?

sharding
2017-12-20 22:27
When I try to do multiple interactions I am gettting this error `Error: done() called multiple times`

matt
2017-12-20 22:28
Hi Otis, could you jump on gitter and share your code?

matt
2017-12-20 22:28
We can answer there.

sharding
2017-12-20 22:29
gitter?

matt
2017-12-20 22:29
Even better, ask on StackOverflow

matt
2017-12-20 22:29
This way the answer is searchable for others

sharding
2017-12-20 22:30
Is there a pact area in gitter?

sharding
2017-12-20 23:57
Thanks

sharding
2017-12-22 19:02
I am having an issue with pact headers in the interactions. Is it necessary to have the request header in the interaction, or does pact automatically create them per the request?

rholshausen
2017-12-22 22:43
@sharding what headers are you having an issue with?

sharding
2017-12-22 23:37
@rholshausen it was a problem with my code, not pact. I got it figured out. Thanks

matt
2017-12-23 02:12
Anything to share with others in terms of lessons?

beth
2017-12-23 02:13
And recommendations for improving the docs?

dennis
2017-12-27 13:59
has joined #general2

dennis
2017-12-27 14:10
Hi, I don?t know if this is a question pact broker related, or just pact. But we are trying to figure out if the provider is the application, or the controller or event the complete endpoint ...

dennis
2017-12-27 14:10
Or will this create one big clutter in the network graph

beth
2017-12-28 23:39
@dennis typically the provider is the application

beth
2017-12-28 23:40
However, in your unit tests, you may choose to verify an interaction against a particular controller (if you're using junit)

thadir
2018-01-03 10:12
First off: Happy new year folks lets make 2018 the year of PACT (instead of DOG). Here is a interesting chalange, we now have a conumser that fully a SQL database that does the request. It somthing totaly untestable (oracle SQL doesnt rely know unitest). So were opting to make a side project just to make the pact visable. Now the challange is that the contract is reversed engineerd based on the code :sweat_smile:. Makes you hate that idea :thinking_face:

eskimoquinn
2018-01-03 18:37
Any word on this feature?

eskimoquinn
2018-01-03 18:38
is this something that has now been implemented?

eskimoquinn
2018-01-03 18:39
bump

lihongmei
2018-01-04 08:43
has joined #general2

alexei
2018-01-04 19:20
Our webhook for pact-broker uses POST to HTTPS site with self-signed certificate. Is there an option to turn SSL-Check off at creation of the web-hook?

travi
2018-01-04 19:26
would be better to tell the server to trust the self-signed cert :wink:

alexei
2018-01-04 19:37
I think that is an issue waiting on a commiter:) https://github.com/pact-foundation/pact_broker/issues/153

alexei
2018-01-04 19:38
How that? I will try the workaround linked with the issue, changing ruby code.


alexei
2018-01-04 19:53
Not using a docker version, but just using with the simple ruby web-server. So I?ve change the $ROOT/pact_broker/lib/pact_broker/domain/webhook_request.rb restarted the server, but it did not help? Strange?.

alexei
2018-01-04 20:12
Got it. The installed gem had to be update, not the sources. Or somehow rebuild the sources? Now works fine!

matt
2018-01-05 22:29
@thadir happy new year mate!!

matt
2018-01-05 22:29
Sorry we?ve all been off for a bit - even managed to stay away from computers and Slack (which if you look at our commit logs is _super_ rare)

matt
2018-01-05 22:30
We?re brewing up some big changes in 2018 - but not sure SQL contract tests will make that list - good luck! :wink:

matt
2018-01-05 22:33
@eskimoquinn sorry we?ve all been afk! I can?t speak for the Ruby implementation, but we are looking to add some more capability to the other language implementations that allow this. If you could raise an issue on the pact-ruby (https://github.com/pact-foundation/pact-ruby) github that will get our attention to solve it!

beth
2018-01-06 01:17
@thadir here's a DIY example for an SQL contract. You'd obviously need to do smarter matching on the SQL string. https://github.com/DiUS/diy-contract-example

beth
2018-01-06 01:20
@eskimoquinn are you using the native ruby verification (against a rack server) or the pact-provider-verifier, or the pact-provider-proxy?

beth
2018-01-06 01:23
This is the theory, but the actual details of how you'd wire it up differ based on which verification tool you're using https://github.com/pact-foundation/pact-ruby/wiki/Verifying-pacts#modifying-the-request-with-live-data

zac.sims
2018-01-07 00:22
So what are these juicy plans for pact in 2018? I'm now super curious :joy:

beth
2018-01-07 00:23
We're finally getting on to message pacts for non-jvm implementations

beth
2018-01-07 00:23
That's the big one.

zac.sims
2018-01-07 00:24
Oh. That'd be awesome!

matt
2018-01-07 21:13
It's more than that though, but we'll leave it at that until it's at least in a workable draft for people to toy with :wink:

beth
2018-01-08 03:32
@alexei I've added the ability to add certificates to be used when executing a webhook. I haven't yet created the API for it, but if you send me the cacert for your certificate, I will insert it straight into the database for you.

biaofu
2018-01-08 11:30
has joined #general2

alexei
2018-01-08 13:27
Thank you @beth, but we already did a local installation of the broker :slightly_smiling_face: (at the moment still the basic setup with WEBrick & SQLite3 db?)

beth
2018-01-08 23:47
@alexei you'll want the latest gem so you don't have to hack the ruby code. I'll put out a release for you. You can't use the docker container?

alexei
2018-01-09 17:28
@beth the challange is that customer has windows-only restriction, so_ actually, I am creating a windows docker container for pact_broker, which I probably can share when done. But windows & docker is a pain?. I will be happy to get help from you on the way, will dm you later!

alexei
2018-01-10 15:56
It looks like webhook is triggered each time the pact file is uploaded, even when there are no changes. Is there a way to trigger only, if pact file contents changed?

alexei
2018-01-10 18:17
Okay, it was as so often user error :slightly_smiling_face: The test code was changed recently, generating random uuid-s in one field each time, so that pacts are different for real. We?ll fix the test, different pacts after each test run make no sense?.

alexei
2018-01-10 18:44
Now I?ve even realized why you may need Matchers in Request :slightly_smiling_face:

beth
2018-01-10 23:03
Awkward! Good luck! Let me know if we can help.

beth
2018-01-10 23:03
Common trap!

m.groeneweg
2018-01-11 08:21
has joined #general2

alexei
2018-01-11 14:48
New problems :slightly_smiling_face: The first one: After update from 2.0.17 to 2.2.1 I am getting in output (!) (and nothing more from pact) `Could not find command "http://<host>:8080/pacts/provider/<service1>/consumer/<service2>/latest" ` test is marked green, but nothing was tested as it looks. 2.2.1 -> 2.0.17 works again. (never tried another intermediates)

alexei
2018-01-11 15:13
The second (and the reason why I?ve updated): Pact Verifier (in 2.0.17) seem to have problems with a matcher (RegExp or Type) which was put in Request/Header ``` "interactions": [ { ? "request": { "method": "get", "path": "/documents ", "headers": { "Accept": "application/pdf", "Correlation-Id": "8c607b69-3d35-4355-9033-a77d7fce62c5" }, "matchingRules": { "$.headers.Correlation-Id": { "match": "regex", "regex": "^[{(]?[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}[)}]?$" } } }, ... ``` Verification fails with: ``` Verifying a pact between .... Failure/Error: replay_interaction interaction NoMethodError: undefined method `strip? for #<Pact::Term:0x427c218> ```

alexei
2018-01-11 15:16
?which looked exactly like: https://github.com/pact-foundation/pact-net/issues/115 Should I take another version?

alexei
2018-01-11 15:27
https://status.github.com/messages - _sorry, did not meant to take down the whole github with reading the pact issues_ :smile:

beth
2018-01-12 00:16
@alexei Always grab the latest version. If that doesn't fix it, can you recreate your issue using the e2e example here: https://github.com/pact-foundation/pact-ruby-standalone-e2e-example and then raise an issue in the pact-support project please?

thadir
2018-01-15 09:58
Just filled your survay on the autantication stuff :slightly_smiling_face: realy jazzed. But maybe also look in to OKTA as a way to intergate it all (we are in the mids of starting to implement that here).

matt
2018-01-15 10:42
On the back of the authentication survey, I am pleased to announce that we will be progressing with multiple streams of work over the coming months and would like to involve you in this journey. Some features will be rolled immediately across the platform, whereas others will be incubated before launch to ensure it is fit for purpose. If you are interested in participating in this program, please DM me and we?ll get you on-boarded. :raised_hands:

alexei
2018-01-15 13:18
I am on it. Just what I?ve noticed so far, in http://Pact.NET 2.0.19 ?core standalone? was update to 1.11.0 (from 1.9.1 in 2.0.18) causing the break in our tests. and now .NET 2.2.1 it is Core: 1.22.1 It just cries out for API changes?:)

alexei
2018-01-15 13:50
And now I probably know the reason: we should have updated the gems in pact-win32, which host the correspondent ?core? code I suppose

matt
2018-01-15 14:46
we're using okta as well for auth

thadir
2018-01-15 23:31
Are you using Okta as internal or for your platform (just curius). We going to start using Okta for our platform systems our clietn use and in the end wanna also migrate our internal systems.

beth
2018-01-16 03:32
I'm not up to date with what is in the core and .net releases at the moment I'm afraid. Is everything working now?

alexei
2018-01-16 08:39
Yes. We separated pact-win32 (ruby-standalone-core) and http://Pact.NET packages because otherwise we?d hit 260-chars-in-the-path problem on windows. And therefore haven?t got pact-win32 updated automatically.

beth
2018-01-16 08:49
Ah, I see.

beth
2018-01-16 08:49
That bites us reasonably often

dennis
2018-01-17 08:27
I?ve got a question regarding the UI of the Pact Broker, is there a reason why the delete option is not implemented in the UI but only via a DELETE with curl for example ?

beth
2018-01-17 08:39
Yes - time @dennis. Most of the Pact Broker is open source, and hence, done in people's free time. The API gets prioritised over the UI I'm afraid, like many open source projects. We'll be focusing on building a much better UI in the Saas version throughout this year.

beth
2018-01-17 08:43
If you'd prefer not to mess with curl, then open the pact in the browser (the HTML version) then click on the "View in API browser" link.

beth
2018-01-17 08:46
This will open the resource in the HAL browser (an embedded HATEOS browser). Click on the NON GET button for the `self` relation, and then enter DELETE in the Method box, and click "Make Request". You can do this for any resource.

dennis
2018-01-17 09:24
Yes I totally understand, but if this is a feature that is allowed I?m willing to create a ticket and make a pull request for this.

beth
2018-01-17 09:25
Oh, absolutely! That would be awesome.


matt
2018-01-18 22:56
it's only used for employees so i guess internal.

mellis
2018-01-19 01:22
has joined #general2

beth
2018-01-19 02:32
Thanks to everyone who has completed the survey on authentication and authorisation that we sent out. This info is going to be really useful for helping us choose what to build first this year. If you didn't receive the email, let me know and I'll send you link so you can have your say.

zac.sims
2018-01-19 02:46
Is there anything public (PR or doco) about these plans? I'd like to share it outside this channel as we're big pact broker users (SEEK)

beth
2018-01-19 02:49
We're using the results of the survey to prioritise our features, so we don't have anything concrete yet. At a high level, authentication/authorisation and an improved UI experience are things we're going to be addressing.

beth
2018-01-19 02:51
We're mulling on what we can do to make it easier to contract test providers with large numbers of consumers, and how to improve the change workflow amongst other things, but auth/auth/ui first.

zac.sims
2018-01-19 03:57
Great! Thanks for the info

matt
2018-01-19 04:01
We?ll publish more details over time, we are in the midst of planning the next phase in the life of this product. Stay tuned, there is a lot going on.

giuseppe.landolfi
2018-01-24 15:32
has joined #general2

giuseppe.landolfi575
2018-01-24 15:35
has joined #general2

benjamin.l.tse
2018-01-25 02:46
has joined #general2

beth
2018-01-25 03:04
Anyone online?

beth
2018-01-25 03:05
@mellis and I are working on an improved dashboard UI and we'd love to do some user research

beth
2018-01-25 03:05
I know @kevin.meiresonne is using tags - who else is?

abubics
2018-01-25 03:06
we are, somewhat

gareth
2018-01-25 03:08
We use tags also

beth
2018-01-25 03:09
We want to add the status of the latest pacts from each tag.

beth
2018-01-25 03:10
Tags can be used to "bookmark" special versions (eg. "prod") or for introducing new interactions without breaking the provider builds (eg. "feat/new-thing")

beth
2018-01-25 03:11
The "feat/new-thing" style feature tags might be used for a few weeks, and once the new interactions are added to the provider, they become just part of the "normal" latest pact. Tags like "prod" and "master" will be ongoing however.

beth
2018-01-25 03:13
We're trying to work out if the "status" for each consumer/provider pair should be determined by the status of *all* the tagged pacts (as well as the overall latest) or just by the latest. Showing that something is failing all the time because some experimental pact failed 3 months ago and hasn't been removed or properly verified since is unhelpful.

beth
2018-01-25 03:14
But similarly, showing just the status of the latest pact may be unhelpful if you're really keen on knowing if your prod pacts are green.

alexei
2018-01-25 09:37
we will be soon

alok.pandey
2018-01-25 14:30
Hi @beth i have pact files which were generated from consumer side written in java in broker i need to verify them using pactjs in mocha.

ken.westdorp
2018-01-25 21:08
has joined #general2

zac.sims
2018-01-27 09:02
We are

matt
2018-01-27 23:54
Hi @alok.pandey, how can I help?

matt
2018-01-27 23:55
There is a full e2e example for both consumer and provider testing available, here is the provider spec: https://github.com/pact-foundation/pact-js/blob/master/examples/e2e/test/provider.spec.js

matt
2018-01-27 23:56
It will fetch pacts from the broker, and validate against the locally running provider

beth
2018-01-29 01:47
Sorry guys, I got interrupted during my train of thought last week. One of the things we're interested in knowing is, what are you trying to find out when you come to the index page of the broker?

abubics
2018-01-29 03:33
Things I usually do are: 1. find the pact for a pair of pacticipants, to implement the provider side 2. see if a pair has been verified 3. find stuff I?ve misconfigured, via the HAL browser 4. see matrix to see which pairs have been verified (not until the PR comes through :wink:) But that doesn?t necessarily answer the question of ?what would be useful on a dashboard/landing page??

alok.pandey
2018-01-30 08:33
hi @matt thanks it was full worth

kevin.meiresonne
2018-01-30 12:09
Thanks a million! Sorry for the late message :wink:

zac.sims
2018-01-31 08:23
Pact (or pact broker...) question, is there any standalone pact json to markdown library? Otherwise it only seems to be in pact-ruby.

beth
2018-01-31 08:31
No, but I could release it in the standalone very easily.

beth
2018-01-31 08:31
Can you raise it in the ruby standalone project?

matt
2018-01-31 08:33
What do you want to do with it @zac.sims?

matt
2018-01-31 08:33
FYI I might be popping out to seek tomorrow afternoon if you're free for a chat?

beth
2018-01-31 08:45
@zac.sims which language are you generating your pacts in btw?

beth
2018-01-31 08:52
If it's one that wraps the ruby standalone, you can find the pact cli and call it directly


zac.sims
2018-01-31 09:41
C#, but PactNet 2 wraps ruby so it's basically invisible

zac.sims
2018-01-31 09:41
Ty for the link

zac.sims
2018-01-31 09:43
Basically we generate the markdown post verification (as it's nice for consumers :)). Moving from PactNet to PactNet 2 has made this somewhat more difficult

beth
2018-01-31 10:18
The standalone executable files will be in the pact net package somewhere. Either way, I'll expose the cli in the standalone for you.

zac.sims
2018-01-31 10:26
Thanks! Much appreciated

kevin.meiresonne
2018-02-02 11:18
Need help on tagging. Can somebody please remind me how to tag the provider version? :slightly_smiling_face:



beth
2018-02-05 01:07
``` Usage: pact-broker create-version-tag -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION --tag=TAG ```


kevin.meiresonne
2018-02-05 09:20
I have a question about the badge behaviour when specifying both consumer and provider tags (e.g. https://<broker>/matrix/provider/<provider>/latest/master/consumer/<consumer>/latest/master/badge.svg). I have the impression that when I've pushed a new version of the consumer pact, the badge switches back to "unknown". I would have expected it to indicate either "changed" (in case the pact actually changes) or "verified" (in case the new version's pact is unchanged).

kevin.meiresonne
2018-02-05 09:21
Is this a misconception on my behalf?

beth
2018-02-05 10:54
I'd expect it to be changed too. There might be a bug in the logic.

beth
2018-02-05 10:55
Can you send me the link for one that it's happening to, and I'll see if I can recreate it tomorrow.

kevin.meiresonne
2018-02-05 12:30
(Un)fortunately, our CI is constantly building and updating, so can't really provide a badge that will stay in that state for long :slightly_smiling_face:

kevin.meiresonne
2018-02-05 12:30
should be easy to reproduce though

beth
2018-02-06 04:48
I've fixed the problem @kevin.meiresonne but I have to fix an unrelated long running query before I can push the change.

kevin.meiresonne
2018-02-06 08:06
Thanks Beth! Any idea on the ETA of the fix on the hosted broker?

beth
2018-02-06 08:16
Not yet. I'm still trying to fix the Cartesian Explosion.

kevin.meiresonne
2018-02-06 08:20
sounds like fun :slightly_smiling_face:

kevin.meiresonne
2018-02-06 08:21
it's not super critical, but we're building a dashboard on our CI to have a visual overview of the contract verifications between all our services to know at any given time if we can deploy.

beth
2018-02-06 08:22
You know you can get the same info from the can-i-deploy tool?

kevin.meiresonne
2018-02-06 08:23
yeah, I'm looking into that one as well

kevin.meiresonne
2018-02-06 08:25
if I understand correctly, I can pass all my pacticipants into a single call to can-i-deploy, right?


beth
2018-02-06 08:25
and if you use tags, you don't have to name them explictly.

kevin.meiresonne
2018-02-06 08:25
cool, definitely gonna use that one on the dashboard as well

beth
2018-02-06 08:25
you just say "can I deploy Foo version 2 to prod"

kevin.meiresonne
2018-02-06 08:27
and that command traverses the dependencies?


kevin.meiresonne
2018-02-06 08:27
wow

beth
2018-02-06 08:28
it relies on you having tagged all the applications when you deploy them to an environment, so the broker knows what versions are in that particular environment.

kevin.meiresonne
2018-02-06 08:29
so that would be for instance pact-broker can-i-deploy --pacticipant <myservice> --version latest --to prod


beth
2018-02-06 08:30
pact-broker can-i-deploy --pacticipant <myservice> --latest --to prod

kevin.meiresonne
2018-02-06 08:30
right, indeed

kevin.meiresonne
2018-02-06 08:30
and does it matter where <myservice> sits in the "chain" of services?

beth
2018-02-06 08:30
I'd generally suggest putting in the explicit version of the pacticipant, as we've had times where what the broker thought was the latest wasn't what the CI thought was the latest.

beth
2018-02-06 08:31
it works for consumers and providers, you don't need to specify which one it is.

beth
2018-02-06 08:31
the broker can tell what talks to what.

beth
2018-02-06 08:31
it just looks at all the services that the application talks to, finds the prod version of each of them, and makes sure that there is a verification between those versions, and the one you're about to deploy

kevin.meiresonne
2018-02-06 08:32
just thinking how I can make sure that can-i-deploy doesn't miss a service dependency

beth
2018-02-06 08:32
it comes back with the results.

kevin.meiresonne
2018-02-06 08:33
right

beth
2018-02-06 08:33
it outputs the matrix to stdout

beth
2018-02-06 08:33
if you want, you can name each pacticipant explicitly

beth
2018-02-06 08:34
but you're more likely to forget to update the list when a new service is created, and then it wont' be considered.

kevin.meiresonne
2018-02-06 08:36
what happens when the tool finds no verification for a certain contract? Does it treat it as a failure or success?

beth
2018-02-06 08:36
failure

beth
2018-02-06 08:36
if you know that there is a project that doesn't do verifications, you'll need to list the pacticipant names explicitly

beth
2018-02-06 08:37
though I have been wondering about adding an --ignore PACTICIPANT option

kevin.meiresonne
2018-02-06 08:37
in fairness, an ignore would help us potentially, as we are rolling out pacts gradually as we go along

kevin.meiresonne
2018-02-06 08:38
but like said, explicit calls would get us there as well for now

beth
2018-02-06 10:32
I've had a partial breakthrough on the Explosion. It's enough that I should be able to deploy tomorrow. It take a bit longer than usual to deploy, but given that you're in a different timezone, it shouldn't affect you.

beth
2018-02-06 22:12
@kevin.meiresonne I've deployed the badge fix, let me know how it goes

beth
2018-02-06 22:18
You'll find there is now an icon to view the matrix from the index page, and a way to toggle the "latest tags" view on the index.

beth
2018-02-06 22:19
It does turn *all* the tags on, which can make it slow. I'm still working on optimising that. However, if you care about certain tags, you can just say `?tags[]=master&tags[]=prod` instead of `tags=true`.

kevin.meiresonne
2018-02-07 08:12
@ Badges seem fixed at first sight! Also found the icon to switch to the matrix, nice addition! Love the tags on the matrix. I suppose a blue tag indicates the latest version of that tag? Not quite sure how to interpret the index page with tag filtering. When I filter on tag "develop" for instance, I also get lines with contracts that are not having that tag...

beth
2018-02-07 08:12
Yes, it shows you the overall latest, as well as the latest for the tags.

kevin.meiresonne
2018-02-07 08:13
ah, right

beth
2018-02-07 08:13
Yes, blue indicates the latest of the tag.

beth
2018-02-07 08:14
Mitch will be making the index page much prettier, so I won't put too much work into it now.

kevin.meiresonne
2018-02-07 08:14
found one small issue on the index page: one of the contracts is shown twice (no tag filtering)

kevin.meiresonne
2018-02-07 08:14
a duplicate line

beth
2018-02-07 08:14
Andras found that too.

beth
2018-02-07 08:15
Yes, I think it's because I did a last minute change from "union" to "union all", to speed up a query.

beth
2018-02-07 08:15
I'll need to whack a distinct on it.

kevin.meiresonne
2018-02-07 08:15
ok, no big issue, just wanted to share

beth
2018-02-07 08:16
Thanks. I'll look at it when I get a moment.

kevin.meiresonne
2018-02-07 08:16
Looking forward to Mitch's designs, they look awesome

kevin.meiresonne
2018-02-07 08:16
what's the timeframe we're looking at here, for the first rollout of those?

beth
2018-02-07 09:14
Mitch is on leave now, but we'd like to get the first cut out within a few weeks.

abubics
2018-02-07 23:33
btw, I think it was Tim, not me :slightly_smiling_face:

beth
2018-02-08 01:44
Either way, it's fixed now!

beth
2018-02-08 01:45
@kevin.meiresonne I've fixed that duplicate row in the index. I've slightly improved the way the tags are represented too.

mouser
2018-02-08 03:03
i seem to be having issues with our hosted pact broker? is anyone aware of any problem?

beth
2018-02-08 03:03
I'm just deploying

mouser
2018-02-08 03:03
:thumbsup:

beth
2018-02-08 03:03
Sorry, I forgot you guys were in Melbourne TZ

beth
2018-02-08 03:04
We need to get our zero downtime deploys happening

mouser
2018-02-08 03:06
no problem

beth
2018-02-08 03:06
This is an unusually long migration as it's materializing the query that works out the latest versions of everything.

beth
2018-02-08 03:13
Back up @mouser

beth
2018-02-08 03:15
I've raised an issue to implement zero downtime deployments

mouser
2018-02-08 04:07
thanks @beth!

beth
2018-02-08 07:20
I've rolled out some improvements to a some of the brokers, but I've just done a few so far, and we'll make sure everything is :green_heart: before we go the rest. There is a link to the matrix from the dashboard now, and the tags and latest tags are shown on the matrix page.

beth
2018-02-08 07:20
Check out the "Show latest tags" link on the index page.

beth
2018-02-08 07:21
Mitch has been working on a fancy new UI, and we'll get some feedback from a few of you soon. Ping @mellis if you'd like to be a part of that process.

abubics
2018-02-08 07:21
tags look nice

beth
2018-02-08 07:21
FYI, we've started the ball rolling on message pacts.

beth
2018-02-08 07:21
It's all going on.

beth
2018-02-08 07:22
Like a :frog: in a :sock:

beth
2018-02-08 07:22
Damn, no :sock: emoji.

kevin.meiresonne
2018-02-08 07:59
Not sure what frogs in socks mean, but I'll take it! Love the improvements you're doing on the broker!

matt
2018-02-08 07:59
:smile:

beth
2018-02-08 08:00
Technically, it should be "going off like a frog in a sock". It's probably an Aussie-ism.


matt
2018-02-08 08:00
We?re nuts :wink:

kevin.meiresonne
2018-02-08 08:03
Btw, nice touch on shortening the version when it's representing a git sha!

kevin.meiresonne
2018-02-08 08:03
Much better

beth
2018-02-08 08:04
Thanks! It's much more readable.

kevin.meiresonne
2018-02-08 08:08
True... If I could be nitpicking, git sha's are usually shortened to the first 8 characters, not 7 :wink:

zac.sims
2018-02-08 08:36
Well, shortest non-clash > 4 to be fair, and the default is still 7 on most git installs ;)

kevin.meiresonne
2018-02-08 08:45
hmm, interesting :slightly_smiling_face: Nevermind my comment then :slightly_smiling_face:

kevin.meiresonne
2018-02-08 08:47
I have a question on webhooks. Which variables can I use in my webhook. The only one I find is "${pactbroker.pactUrl}". Is there a way to know get the tags as well?

kevin.meiresonne
2018-02-08 09:25
For instance, when my "production" consumer pact changes, I want to trigger a build for the "production" branch of my provider. I don't want to trigger the "production" branch build for pact changes on other branches (tag) of the consumer.

kevin.meiresonne
2018-02-08 09:56
I think I found an alternative approach on solving my issue by using the pactUrl. Gonna give that a go.

thadir
2018-02-08 10:18
Hmm we been using pact for a while, and I want to auto get the version in trough maven. The consumer has now a 0-snapshot (maven default) but I want to also see what version of provider they expect (I generate some of my pacts trough client construction). How can I make sure that the version paramater is passed correctly to my broker?

beth
2018-02-08 10:49
@kevin.meiresonne I wanted to add the tags in, but because there can be multiple of them, I didn't know how to represent them using variable substitution. Then I came across some info at a conference about "state watch", where a client subscribes to being notified when state changes, and then is given the tools to find out for itself whether or not something should happen. Here's an example of how I imagine a verification callback webhook would go https://github.com/pact-foundation/pact_broker-client/blob/master/example/scripts/deploy-consumer.sh

kevin.meiresonne
2018-02-08 10:49
@beth Did something get reverted on the broker? I have duplicate lines again.

beth
2018-02-08 10:49
The one thing I think may be missing is the version number in the env vars.

beth
2018-02-08 10:51
@kevin.meiresonne let me deploy yours again, I did a few deployments this morning, and yours doesn't have the latest

beth
2018-02-08 10:53
@thadir I'm afraid I don't understand your question, but that may be because I'm not a Java person. @rholshausen might understand better.

kevin.meiresonne
2018-02-08 10:56
@bethgiven I have the pact url of the published pact, is there a way I can know which tags are on it?

kevin.meiresonne
2018-02-08 10:56
I don't spot it in the hal browser

beth
2018-02-08 10:57
existing_tags=$(${PACT_BROKER_CLIENT} describe-version --pacticipant ${application} --version ${version} --output json | jq "[._embedded.tags[].name]" | jq 'join("\n")' --raw-output)

beth
2018-02-08 10:57
Have a look at the example script.

beth
2018-02-08 10:58
``` can_i_deploy_output=$(${PACT_BROKER_CLIENT} can-i-deploy --pacticipant ${application} --version ${version}) can_i_deploy_exit_code=$? set -e echo "${can_i_deploy_output}" if [[ "${can_i_deploy_exit_code}" == "0" ]]; then existing_tags=$(${PACT_BROKER_CLIENT} describe-version --pacticipant ${application} --version ${version} --output json | jq "[._embedded.tags[].name]" | jq 'join("\n")' --raw-output) if [ $(echo "${existing_tags}" | grep "${stage}") ]; then echo "Version ${version} of ${application} has already been deployed to ${stage}" else echo "Deploying version ${version} of ${application} to ${stage}" # do deployment here ${PACT_BROKER_CLIENT} create-version-tag --pacticipant ${application} --version ${version} --tag ${stage} fi else echo "Cannot currently deploy version ${version} of ${application} to ${stage}" fi ```

kevin.meiresonne
2018-02-08 10:58
aah, right, got it now. Testing

beth
2018-02-08 10:58
The one thing that is missing from this is getting the version of the consumer that has been verified.

beth
2018-02-08 10:59
The verification belongs to the *content* not the *version number*.

kevin.meiresonne
2018-02-08 10:59
well, I could extract that from the pacturl

beth
2018-02-08 10:59
The same *content* may be published for many many different consumer versions.

beth
2018-02-08 11:01
Eg. if v1 (tagged prod), v2, and v3 (tagged master) are all the same pact content, and the provider verifies /latest/prod and /latest/master, then there will be two verifications for the same underlying content.

beth
2018-02-08 11:02
Also, the way the verification URLs currently work (which I may need to change) there's no way of knowing whether the provider accessed certain content because it was /latest or /latest/{TAG}

kevin.meiresonne
2018-02-08 11:03
I see

beth
2018-02-08 11:04
It's a challenging problem of many to many to many relationships!

beth
2018-02-08 11:05
In the above scenario when a provider verifies *any* of v1, v2, or v3, because the content is the same, the implication is that *any* of these versions could be safely deployed.

beth
2018-02-08 11:06
Only the consumer team could tell which one they actually want to deploy though. I'm guessing it would generally be the latest version.

beth
2018-02-08 11:09
If a consumer publishes v1, and then the provider verifies v1, but while the verification is running, the consumer publishes v2, which is exactly the same. If the webhook was to have a ${consumerVersion} variable, would it be v1 (which was the latest when the verification started) or v2 (which was the latest when the verification finished and is equivalent to v1 anyway)??

beth
2018-02-08 11:09
These are my challenges! The coding is easy - working out how things should operate is *hard*!

beth
2018-02-08 11:10
Anyway, I need to go to bed. Let me know if you (or anyone!) has any thoughts on this.

beth
2018-02-08 11:10
@kevin.meiresonne I've just kicked off a new deployment to your broker, it should fix the duplicate issue.

kevin.meiresonne
2018-02-08 11:15
see ya tomorrow :slightly_smiling_face:

beth
2018-02-08 11:21
Bother, it hasn't fixed Andras's one, so I'm guessing yours is still the same. Will look again in the morning.

kevin.meiresonne
2018-02-09 08:09
looks fixed now!


kevin.meiresonne
2018-02-09 10:20
and now I have duplicates again... :disappointed:

beth
2018-02-09 10:27
Hm. So, I've created a materialised view to make the index page respond more quickly. It updates asynchronously just after a pact is published. Something must be incorrect there.

beth
2018-02-09 10:28
The strange thing is, to fix the data, I ran the same sql that runs after the pact is published.

beth
2018-02-09 10:28
I must have a misunderstanding about something. Will investigate when I have a chance.

kevin.meiresonne
2018-02-09 10:32
yeah, that could well be triggering it

beth
2018-02-09 10:32
I wonder if it's a timing thing.

beth
2018-02-09 10:32
Perhaps the tagging and the publishing happening so closely collide.

beth
2018-02-09 10:32
I implement it quite simply, so it may need to be more sophisticated.

kevin.meiresonne
2018-02-09 10:32
if it helps: when publishing the pact files, I tag the version after that

kevin.meiresonne
2018-02-09 10:33
maybe I need to do it the other way round?

beth
2018-02-09 10:33
They both trigger a refresh.

beth
2018-02-09 10:33
The order will not matter.

kevin.meiresonne
2018-02-09 10:33
ok

kevin.meiresonne
2018-02-09 10:35
my script is pretty generic. This particular service publishes 3 pacts with 3 other services. So to be fair, my consumer pacticipant is tagging itself 3x with the same tag because it's the same pacticipant in each of the three pacts. Could that cause it?

kevin.meiresonne
2018-02-09 10:36
I admit, it's a bit lame on my behalf :slightly_smiling_face:

beth
2018-02-09 10:36
Even if it's lame, it should still not cause duplicates :-P

beth
2018-02-09 10:38
It helps to know that though, because if I can write a script to recreate the issue, I'll at least know when I've fixed it.

thadir
2018-02-09 12:21
Hmm were going ot use it internal and external :S

abhijeet.daspatnaik
2018-02-12 06:09
has joined #general2

beth
2018-02-12 22:44
If anyone wants to follow along at home (@kevin.meiresonne) I've picked up work on ruby message pact, which will be bundled as part of the ruby-standalone executable to be used for all the other wrapper languages. I've created at gitter channel for it here: https://gitter.im/pact-foundation/pact-message-ruby

abhijeet.daspatnaik
2018-02-13 00:35
I am a Test Lead and we are making a POC for our microservices testing. I need some general information about PACT. Is this the right channel to discuss about PACT concepts or its only the Pact Broker related stuff that needs to be discussed here?

beth
2018-02-13 02:48
Hi @abhijeet.daspatnaik we don't officially support pact here, but of course, pact usage and best practice comes up often. In terms of sharing knowledge, the best place to ask is stack overflow or gitter, so that others can benefit from the conversation.

beth
2018-02-13 02:49
The same people (myself, @matt, @rholshausen and some of our Super Users) will be on all of the forums.

abhijeet.daspatnaik
2018-02-13 02:52
No problem at all. One question related to Broker. I highly appreciate the fact the Pact Broker is free now. But is there a chance that after few months/years this would be priced?

beth
2018-02-13 02:55
We will be using the freemium model of making the open source version available for free, and providing extra features on top of the open source model as a paid subscription.

matt
2018-02-13 04:08
As Beth mentioned, at least for the foreseeable future, the bog standard pact broker (that you get from GitHub) will be available as a service for free. Other features may be added and made available as a monthly subscription.

abhijeet.daspatnaik
2018-02-13 23:36
Thank you @matt and @beth. Really appreciate ur efforts and the work that you guys are doing. Keep up the great work:+1::+1:

matt
2018-02-13 23:42
most welcome!

thadir
2018-02-14 10:17
Talking about freemium :wink: how are things going along with your road map @matt and @beth for the broker?

matt
2018-02-14 10:36
I won't say too much, but we have done a lot of work behind the scenes on approach, roadmap and business model and have been working closely with our directors on bootstrapping a team and creating a structure to be able to make this happen. Can't talk to specific dates but it's happening. :100:%

thadir
2018-02-14 10:45
sweet, and ill dm you some good info

matt
2018-02-14 10:46
Thanks, that'd be great

icapurrofagian
2018-02-15 02:11
has joined #general2

andrew.nicholson
2018-02-15 18:45
I have a question about pact versioning with the broker....it seems like the version of the pact corresponds to a version of the consumer software. Is the intended idea that the consumer creates/publishes new pacts as it develops the client code for a particular endpoint?

andrew.nicholson
2018-02-15 18:47
In our current development workflow, we are often spec'ing out multiple different features simultaneously, so we want to create/publish pacts for several different endpoints at the same time to allow the providers to begin work...but we don't know exactly which features will be delivered in what order, so it becomes difficult to figure out how to version the pacts properly...

kevin.meiresonne
2018-02-15 19:19
The versioning is indeed driven by the consumer (consumer driven contract). If you're working on different features/endpoints at once, you can tag them as well. Your tags could indicate the feature for instance. Then you can have your provider verify against the latest consumer pact for a given tag for example

andrew.nicholson
2018-02-15 19:28
That's sort of what we do right now -- if we are developing feature A B and C, then they are on some future version 1.0.1 with a 'dev' tag -- then when one of them is completed we release 1.0.1 with whichever feature is complete, and then tag 1.0.1 as 'prod'. It's a little wonky though because we have to regenerate the 1.0.1 pact and remember to exclude the features that have not been finished.

andrew.nicholson
2018-02-15 19:29
sometimes we have accidentally put an unreleased feature in the prod-tagged pact b/c we forgot to exclude it -- then we get unnecessary provider verification failures

kevin.meiresonne
2018-02-15 19:30
We do it differently. Every feature has its own tag, so in your use case we would have 1 prod contract and 3 feature contracts. Whenever a feature is ready, it gets merged into the prod contract.

andrew.nicholson
2018-02-15 19:30
what about the version, though -- do they all share a version?

kevin.meiresonne
2018-02-15 19:32
We don't use semantic versioning on the contracts. Every published pact has a new version (git sha)

andrew.nicholson
2018-02-15 19:33
Ah -- is that compatible with the pact-broker 'latest' capabilities? Verifying the 'latest' version of a particular tag, or showing the latest version by default in the index?

andrew.nicholson
2018-02-15 19:33
I thought that 'latest' corresponded to 'highest version number'

kevin.meiresonne
2018-02-15 19:34
It is, but you need to change the configuration of the broker to not base latest on version, but on date published

andrew.nicholson
2018-02-15 19:34
I didn't realize that was an option -- thanks for the info.

andrew.nicholson
2018-02-15 19:34
We might be able to change our workflow to fit that scheme.

kevin.meiresonne
2018-02-15 19:35
I guess it depends on the use case. But for us this was a better fit. We don't really care about semantic versioning

kevin.meiresonne
2018-02-15 19:36
We might revisit that approach but for now it works for us

kevin.meiresonne
2018-02-15 19:36
Are you using the hosted broker, or do you host it yourself?

andrew.nicholson
2018-02-15 19:37
Currently self-hosting

kevin.meiresonne
2018-02-15 19:37
Great, then you should be able to change that config yourself


kevin.meiresonne
2018-02-15 19:39
Check the "ordering by date" topic

andrew.nicholson
2018-02-15 19:39
Neat -- thanks

kevin.meiresonne
2018-02-15 19:40
You're welcome

matt
2018-02-15 20:35
@andrew.nicholson We typically recommend the flow @kevin.meiresonne is talking about, mostly because it is consistent with Git branches which makes it somewhat easier to reason about. It also is well supported by the tooling.

matt
2018-02-15 20:35
Glad to see you got it sorted, and thanks @kevin.meiresonne :slightly_smiling_face:

kevin.meiresonne
2018-02-15 20:36
just spreading the knowledge I've learned from you and @beth :slightly_smiling_face:

beth
2018-02-15 20:38
Thanks @kevin.meiresonne!

andrew.nicholson
2018-02-15 21:05
@matt yes, we've been finding our current workflow somewhat difficult to reason about, and are glad for the alternate suggestion. Thanks!

andrew.nicholson
2018-02-15 21:05
I appreciate that y'all are always friendly and helpful!

matt
2018-02-15 21:08
No worries, don?t be afraid to make suggestions or raise feature requests. We?re always interested in understanding how we can fit or shape our customers? processes to make CD better.

matt.canty
2018-02-16 09:30
has joined #general2

matthewcanty
2018-02-19 09:20
has joined #general2

matthewcanty
2018-02-20 15:49
Hi everyone. I?m unsure what approach to take with micro-services architecture. However you want to define micro-service, there is a single `http://api.example.com` proxying calls to `service-x` or `service-y`. Are client-side developers writing their Pact tests expected to know which service will be serving them, or is there a pattern which allows for multiple providers to satisfy the expectations of consumers? Appreciate I may be a little off the ball here. If anyone has particular experience using Pact in an API Gateway/Serverless/Containerised ecosystem then it?d be great to hear from you. Thanks!

thadir
2018-02-20 17:00
Hey @matt.canty welcome to the wonderful world of contract testing. If I get your question you have a Provider (service-x) and consumers and you have more then one Provider hosted (trough a gateway) The Pact is between the Consumer Provider. So if you have 10 unique different services then you will expet a 1 to 10 relation ship. Is it 10 consumers that reperesens the one service then its a 1 to 1 relation ship. You do not care about how many it is in quantety your interested in uniqueness.

matthewcanty
2018-02-20 17:18
Yeah I think I know where I was going wrong in my thinking. I was thinking that there was a 1:1 between provider and domain. But of course, there isn?t. I think this answers my question. Thanks.

travi
2018-02-20 17:30
to build on that question with one ive been deferring figuring out for a while... we have a hypermedia api where we make requests by following a traversal of links to make a request, rather than making each request individually. the link traversal crosses provider boundaries, potentially hitting several providers in a single "request" from the perspective of our app. since we cant really break out the individual requests, we would need to test the whole traversal together. has anyone had success with a consumer test that makes multiple requests and touches more than one provider? (our consumer is a node app)

matthewcanty
2018-02-20 18:29
Sounds like you have expectations on multiple providers, each are responsible for their part in the chain.

thadir
2018-02-20 21:31
Well this is exactly why you want a consuemr test. The provider contract is somting like this for example:

thadir
2018-02-20 21:32
Provider { contract1: "bla", contract2: "bla", contract3: "bla", }

thadir
2018-02-20 21:32
Then you you consuemrs can use any of those combinations

thadir
2018-02-20 21:33
Same with the parameters

travi
2018-02-20 22:00
yeah, the part i think i was concerned with in the past was hitting multiple providers from the same test. looking at things again now (without time to verify with implementation), i guess i really just need to define each of the separate providers for the test, set up the expectations for each, and then verify each provider's expectations individually. actually seems a lot more doable than i realized the last time i looked into it. now just need to find time to confirm

thadir
2018-02-20 22:03
You dont need realy if its one provider test. Depens on the language.

travi
2018-02-20 22:05
one consumer-driven test would need to involve a single consumer and multiple providers to generate the pact for a single traversal. each provider would verify only the part of the pact that they are involved in

abubics
2018-02-21 00:39
If you?re hitting multiple providers, each of those would be a separate pact (and separate tests). Each external call should be an individual test, that?s explicitly the granularity of pact tests :) Pact doesn?t verify behaviour of consecutive calls between any number of systems, not even 1-1.

alok.pandey
2018-02-21 13:06
Hi

alok.pandey
2018-02-21 13:07
can we give multple provider during the verification?

travi
2018-02-21 15:11
that assumption is part of what has made me hesitate to investigate in the past. it seems to be the suggestion, but is not really possible in our case. our app does not make individual calls. we use traverson to follow traversals, so the individual requests are abstracted away from our code. the closest we can come to them is testing a full traversal, which is multiple calls to multiple providers, in a single consumer test

thadir
2018-02-21 15:27
That does not sound microservice like but a litle monolith with some microservice calls. :slightly_smiling_face: sounds like a challange.

matt
2018-02-21 21:34
What do you mea @alok.pandey?

beth
2018-02-21 22:04
You can verify a list of pacts at the same time and they can be from as many providers as you like.

beth
2018-02-21 22:04
If I understand your question correctly.

abubics
2018-02-21 23:22
Looking at `traverson`?s readme, it doesn?t seem like a good fit for Pact, without some intervention. Because it?s expecting HATEOAS, you can?t know what URLs and URL paths it will give you.

abubics
2018-02-21 23:23
An option (maybe not the best) is to create a test consumer that exercises the endpoints explicitly. It?s less good than a real consumer, because it may use some endpoints that aren?t really used, and miss some that are.

abubics
2018-02-21 23:24
Another option might be to record what endpoints `traverson` invokes, and make sure each one has a Pact test.

abubics
2018-02-21 23:25
Other traversal tools that obviate Pact (such as GraphQL) provide different ways of assuring data shape.

abubics
2018-02-21 23:31
Another take on HATEOAS is that it?s intended to be dynamic, and if the consumer can?t handle the response, the provider can give a fallback response

abubics
2018-02-21 23:31
so, most assurances become unnecesary

beth
2018-02-22 00:34
So, I have been well aware that the way the pact is currently implemented breaks hateos since we wrote it, because the first services we wrote it for used HAL. I would adore making a proper HATEOS compliant pact format where instead of recording the path, you recorded the HAL relation and the arguments to that.


beth
2018-02-22 00:36
I have done a bit of a hack in my pact broker client/pact broker pacts to allow me to not have to know the actual URL I was hitting. I provided a fake URL in my mocked response on the consumer side, and then, I did a find/replace on the pact before verifying it to replace the placeholder URL with the correct URL before provider verification

beth
2018-02-22 00:38
And I've just realised that I haven't actually answered the question that was raised. @travi you'll need to start up two mock servers at the same time, and your mocked data from the first will need to point to a URL on the second.


beth
2018-02-22 00:44
Here's the code (it's a piece of Rack middlware) that does the find and replace on the request to give it the actual URL https://github.com/pact-foundation/pact_broker/blob/master/spec/service_consumers/hal_relation_proxy_app.rb

beth
2018-02-22 00:44
As I said, I'd LOVE to give this first class support, but there are too many other urgent things to do first.

travi
2018-02-22 06:27
understood on priorities and i understand that clients that actually use hateoas fully by traversing links are fairly uncommon. obviously i would love for this to have first class support at some point and would even like to help get pact there because im a big fan of the idea of pact. other priorities keep trumping me diving deeper since i keep tripping on how to get past this fairly fundamental part of getting started in our context

beth
2018-02-22 06:27
How's your ruby? :wink:

beth
2018-02-22 06:28
Did the hacky way make sense?

travi
2018-02-22 06:28
honestly i hardly do ruby at all. im mostly js focued

beth
2018-02-22 06:29
Ruby's not cool these days. It's hard to find devs!

travi
2018-02-22 06:29
we do still follow decent url patterns in our api for developer experience for at least understanding what the link traversal is doing

travi
2018-02-22 06:29
so we can still define urls that will match on the providers w/o much trouble

travi
2018-02-22 06:30
the main sticking point taht ive had that i kind of realized yesterday after asking the question was that it should be possible to define multiple providers in the same test and just verify each independantly

travi
2018-02-22 06:30
and sounds like you confirm that that should work, correct?


beth
2018-02-22 06:31
no problems at all.

travi
2018-02-22 06:31
if thats the case, ill need to find some time to give it a shot now that ive got some better context for how to approach it

beth
2018-02-22 06:32
Cool. Let me know how you go.

travi
2018-02-22 06:32
if i have some success, maybe i an get motivated to find a way to help it move along at a more first class level (when the timing is right on your side)

travi
2018-02-22 06:33
for sure. i have a bunch of other things on my plate, but im also excited to see this work, so hoepfully i can find time soon and report back

travi
2018-02-22 06:33
thanks for the additional info!

abubics
2018-02-22 06:33
This is only for chains of nullipotent traversal calls, right? Otherwise it starts hitting behaviour issues

travi
2018-02-22 06:34
if that question is to me, i need a bit more info. not sure i understand well enough to answer

abubics
2018-02-22 06:36
so, in ReST, GET is nullipotent (no side-effects), while PUT and DELETE are idempotent (side-effect the first time)

abubics
2018-02-22 06:37
Pact (in its current state) isn?t intended to verify behaviour in a sequence of operations that change state.

abubics
2018-02-22 06:37
If your operation needs to perform a traversal in the lead-up to a PUT, POST, or DELETE, that doesn?t violate this constraint.

beth
2018-02-22 06:38
each request/response is tested separately

travi
2018-02-22 06:38
ah, it was the nullipotent piece that tripped me up vs idempotent

abubics
2018-02-22 06:38
But you shouldn?t be trying to verify anything after a PUT, POST, or DELETE, because that?s a behaviour symptom :)

travi
2018-02-22 06:39
right, we would perform GETs for the traversal leading up to a GET, POST, PUT, or DELETE

travi
2018-02-22 06:39
but wouldnt be wanting to verify any state change that resulted from the POST, PUT, or DELETE

travi
2018-02-22 06:39
well, at least not as a follow up request

abubics
2018-02-22 06:40
great ^_^ good to be on the same page :D sorry if my approach was hard to understand

abubics
2018-02-22 06:40
I think that?s what you meant all along ;)

travi
2018-02-22 06:40
we would probably want to verify the response of the POST, PUT, DELETE, which returns the updated state

travi
2018-02-22 06:40
but i can see how that starts to get into a grey area

abubics
2018-02-22 06:42
as long as there are no further operations after a side-effect / state change, then there shouldn?t be any constraint violation :smile:

travi
2018-02-22 06:42
:thumbsup:

abubics
2018-02-22 06:42
but asserting the result of the state change is totally fine, and expected

travi
2018-02-22 06:44
good deal. its late enough here, that im not thinking through it fully, but that makes sense

sdulebskiy
2018-02-22 10:39
has joined #general2

omar10594
2018-02-22 20:44
has joined #general2

travi
2018-02-23 18:06
I ended up taking a look and realized that there is still a problem that I'll need to figure out a solution for. We serve our individual microservices from the same host domain, routed by a context root. Our links are relative to the root domain rather than being full What that means for the local providers is that they need to be accessible on the same port. I don't suppose there is an easier way to accomplish this than configuring and starting some sort of local proxy and routing the tests through that rather than hitting the stubbed providers directly?

james
2018-02-25 12:33
has joined #general2

kevin.meiresonne
2018-02-26 07:51
Hi, is it possible the hosted broker is down?

kevin.meiresonne
2018-02-26 07:52
Getting nasty NoMethodError today on the home page

kevin.meiresonne
2018-02-26 07:54
It appears to only happen on the pact broker home page. The other pages are still accessible

matt
2018-02-26 07:56
Not that I'm aware of @kevin.meiresonne

matt
2018-02-26 07:56
I'll check when I get home, no alerts have triggered

matt
2018-02-26 08:08
Are the APIs etc still working?

kevin.meiresonne
2018-02-26 08:08
yeah, the HAL browser seems fine

matt
2018-02-26 08:10
ok cool, a bigger concern would be if your CI/CD processes stopped because of it.

kevin.meiresonne
2018-02-26 08:13
that would be a lot worse indeed :slightly_smiling_face:

kevin.meiresonne
2018-02-26 08:13
Still checking our systems, but no indications of errors on the CI level

matt
2018-02-26 08:14
ok cool, I can see a few 500's in the logs (not enough to trigger alert)

matt
2018-02-26 08:14
and they?re all yours at the moment

matt
2018-02-26 08:15
I wonder if it relates to the new pact matrix stuff that?s being tested

kevin.meiresonne
2018-02-26 08:16
yeah, I get the 500 each time I refresh the broker home page

matt
2018-02-26 08:16
I?ll have to get Beth to assist on this one. It could be a funny query missing something key piece of info

kevin.meiresonne
2018-02-26 08:16
ok

beth
2018-02-26 08:19
I'll be able to look at it in about 45 mins

kevin.meiresonne
2018-02-26 08:20
thanks Beth. If you need more info, I'm here for the next 9 hours (but I guess you won't :D)

beth
2018-02-26 08:27
Cool, I'll let you know.

beth
2018-02-26 09:43
@kevin.meiresonne all good now.

kevin.meiresonne
2018-02-26 09:44
Cool, it works now indeed!

kevin.meiresonne
2018-02-26 09:44
thanks a lot!

beth
2018-02-26 09:46
np, sorry about the error.

kevin.meiresonne
2018-02-26 09:51
no worries, no harm done :slightly_smiling_face:

matt
2018-02-26 09:56
We?ve found a config issue that we?ll sort out from this, so sorry, but thanks

sinclair.calleja
2018-03-01 01:22
has joined #general2

sinclair.calleja
2018-03-01 01:33
Hello everyone

sinclair.calleja
2018-03-01 01:35
At Domino's we're considering using Hosted PactBroker as a store for our pact definitions of our microservices

sinclair.calleja
2018-03-01 01:36
We've got a few questions though related to IP and any legal issues arising out of storing information about our services outside of our internal environment

sinclair.calleja
2018-03-01 01:37
Typically our legal team would require a questionnaire to be filled out by our partners, which would include things like obligation to notify us in case of a data breach for instance, stuff like that

sinclair.calleja
2018-03-01 01:37
I undertand you guys are offering this service for free, and we are very thankful for this

rholshausen
2018-03-01 01:38
Hi @sinclair.calleja, shoot through your questions

sinclair.calleja
2018-03-01 01:38
However while free is good, am I right to assume that it comes with no liabilities and maybe even no obligations from your end as regards to IP?

rholshausen
2018-03-01 01:39
That's correct, we offer the service for free at the moment, but we can't offer any SLA's

rholshausen
2018-03-01 01:40
We are moving to a freemium model where you can get service level agreements and support for a subscription cost

rholshausen
2018-03-01 01:42
The base version will always be free, but will also come with no guarantees, apart from us generally following accepted industry standards

rholshausen
2018-03-01 01:44
We will protect your IP, take every precaution for secure the data and try to maintain high levels of up-time for the service

rholshausen
2018-03-01 01:45
Does that answer your question?

sinclair.calleja
2018-03-01 01:46
@rholshausen Thanks for that! I'm also going through the Terms & Privacy pages on the website, which would be a good start for our legal people

matt
2018-03-01 07:08
@sinclair.calleja Hi! Thanks for raising this, you're not the first to ask about it. Whilst the service isn't out of beta yet, we can likely cater for most of your needs with a custom contract in the interim, should your legal team require extra assurances. If you'd like to chat more about this, DM me and we can go from there

thomas.heilbronner
2018-03-01 10:32
has joined #general2

thomas.heilbronner
2018-03-01 16:02
Hello everyone, when I?m in the ?The Matrix? view for my pact, I can access the pact information by clicking on the version (2nd column). When I click at the provider verification version (5th column) to so the latest verification details I end up in the HAL Browser with the response header `405 Method Not Allowed`. Is this the intended behaviour? Is there a way to have a look at the verifications an why they for example failed with the details you see on your local pact verification run? Or even better, is there a way to feed the verification response from to provider back into the consumer test? I currently have a setup where consumer and provider tests run green, but the actual integration fails. (I added a json property the consumer can not de-serialize) Feeding back the actual provider response into the consumer test would uncover this problem. Am I missing something?

beth
2018-03-01 21:21
Hi @thomas.heilbronner we haven't implemented the publishing of test results yet, but it's high up on our priority list.

beth
2018-03-01 21:22
I'm not sure why you're getting a 405, let me investigate and get back to you.

beth
2018-03-01 21:24
That is an interesting thought about feeding the actual response back to the consumer. I'm not sure how it would work, as the actual response may differ in content significantly from the example response, making the tests fail in many ways. Tee matchers that allow you to avoid brittle tests would work against you in this case.

beth
2018-03-01 21:25
Seeing the test results would obviously help, and we'll be doing that as soon as possible.

beth
2018-03-01 21:25
I assume you're using a DiUS pact broker? Can you PM me your subdomain please?

mouser
2018-03-03 00:38
Is the hosted pact broker under maintenance at the moment? Currently receiving the following error: ```Sequel::DatabaseDisconnectError at / PG::UnableToSend: SSL connection has been closed unexpectedly``` This is not urgent btw? just thought i?d raise it seeing as i?d noticed it :slightly_smiling_face:

beth
2018-03-03 00:38
I just saw it too.

beth
2018-03-03 00:39
No maintenance

beth
2018-03-03 00:39
Is it repeating? Or does it go away when you retry?

mouser
2018-03-03 00:44
Ok looks ok now

mouser
2018-03-03 00:44
:slightly_smiling_face:

beth
2018-03-03 00:44
It's only started in the last few hours, but there have been no changes to the code for days.


mouser
2018-03-03 00:45
Thanks for taking a look - and sorry to interrupt your weekend!

beth
2018-03-03 00:46
NP #supportlyf

mouser
2018-03-03 00:47
:thumbsup:

beth
2018-03-03 00:47
I know the ruby client has retries built in, but not sure about the Java one.

matt
2018-03-03 01:22
We got the alert, just a couple of blips. Will investigate

krishnaraj.krishnan
2018-03-05 05:50
has joined #general2

dennis
2018-03-06 09:52
I got a question for the ones that are also using versioning + tags

dennis
2018-03-06 09:52
At this moment we have 45 pacts / contract

dennis
2018-03-06 09:53
and during our CI phase we always push a new version ( with the version from maven = semver ) towards the pact broker

dennis
2018-03-06 09:53
this results in 1100 versions allready per pact

dennis
2018-03-06 09:53
Right now this is becoming really slow

dennis
2018-03-06 09:53
I was wondering if this is the correct strategy, or should we build some code that we only push a pact when something actually changed ?

beth
2018-03-06 10:03
A new pact version is only created when the JSON changes. Make sure you don't have any random data in there.

beth
2018-03-06 10:03
Also, we can do a clean up. The only important versions to keep are the latest, and the latest for each tag (unless you're doing anything unusual).

beth
2018-03-06 10:04
The publishing may have slowed down recent because we're calculating the Matrix on publish, rather than on query because it was just taking too long to perform the query.

dennis
2018-03-06 10:05
we don?t have the latest release of the pact broker with the matrix yet

beth
2018-03-06 10:05
You're missing out ;-)

beth
2018-03-06 10:07
So, every time you publish, a new row is added to the pact publications table. However, the content is stored in a different table, and a new content row is only created if you publish a different JSON document. Most of the time, the JSON stays the same unless you're using random data.

beth
2018-03-06 10:07
So don't be afraid of publishing every build. We can clean up unused data.

beth
2018-03-06 10:08
Are you hosting your own broker then?

dennis
2018-03-06 10:09
yes we are

dennis
2018-03-06 10:09
let me check which version we have

beth
2018-03-06 10:09
Are you using tags?

dennis
2018-03-06 10:10
no, just latest

beth
2018-03-06 10:10
Are you using verifications?

dennis
2018-03-06 10:12
we don?t have random data in there, just compared some pacts

dennis
2018-03-06 10:12
verifications ? we have provider tests ( pact-jvm-junit )

dennis
2018-03-06 10:13
they are verifying

beth
2018-03-06 10:14
Do they publish the verifications?

dennis
2018-03-06 10:15
yes they do

dennis
2018-03-06 10:15
we only publish when running the tests on our CI server

beth
2018-03-06 10:15
:ok_hand:

beth
2018-03-06 10:15
Are you using can-i-deploy?

beth
2018-03-06 10:16
there is a reason for these questions - you may just be able to delete the pacticipants and kick off your build to create a new pact.

dennis
2018-03-06 10:18
we are not using can-i-deploy , I think ( or that is our assumption ) that we got this covered with our provider pact unit tests :slightly_smiling_face:


beth
2018-03-06 10:20
But that's a side note.

beth
2018-03-06 10:20
Do you have webhooks?



beth
2018-03-06 10:22
So, send an HTTP delete to the pacticipant, then kick off your consumer build to re create the pact.

beth
2018-03-06 10:23
Deleting the pacticipant will clear all the versions and pacts and verifications. Seeing as you only care about the latest one, republishing it will put you back in the right state.

dennis
2018-03-06 10:23
ok, I will check if that improves our performance

beth
2018-03-06 10:23
It seems stage that a few thousand slows it down so much.

beth
2018-03-06 10:24
Maybe I've got a really dumb query in there somewhere.

dennis
2018-03-06 10:24
we noticed we had high cpu on our DB server

beth
2018-03-06 10:24
What exactly is slow?

dennis
2018-03-06 10:24
oh yes, it is alway with the same query

dennis
2018-03-06 10:24
let me check in AWS, it is in there

dennis
2018-03-06 10:24
I spoke with the devops guys, and our db is a 30Gb memory with 4 cores, so that should be sufficient :slightly_smiling_face:

beth
2018-03-06 10:24
Gosh. Yes.

beth
2018-03-06 10:25
I've improved the queries in the latest hosted version but I haven't released it in the oss version yet.

dennis
2018-03-06 10:26
I?m going to send you a screenshot of the performance insights

beth
2018-03-06 10:26
Thanks.

dennis
2018-03-06 10:26
just a sec



dennis
2018-03-06 10:34
and pactbroker, the one with high cpu usage , is the writer replica

dennis
2018-03-06 10:34
the eu-west-1a , is the reader

beth
2018-03-06 10:36
Hm. That wasn't the query I was expecting.

beth
2018-03-06 10:36
I wonder if there's a missing index.

beth
2018-03-06 10:36
That query doesn't seem to justify that amount of CPU.

beth
2018-03-06 10:37
@matt will be able to tell you what we're using for our entire customer base.

beth
2018-03-06 10:38
Let me try and get the latest code into the oss version. I

dennis
2018-03-06 10:38
I assume that this is the source for our performance issues :slightly_smiling_face:

dennis
2018-03-06 10:39
but I?ll check anyway first by removing the participnts/consumers

beth
2018-03-06 10:39
It would actually be really useful if you could hold off cleaning the data up until you could update, to see if that fixed it.

dennis
2018-03-06 10:39
oh ok

dennis
2018-03-06 10:39
no problem

beth
2018-03-06 10:40
I'd you don't mind. I'll try and get it out on Thursday (Australian time).

beth
2018-03-06 10:40
If that doesn't help, then clearing the data definitely will.

dennis
2018-03-06 10:40
perfect, thanks for all the help

beth
2018-03-06 10:42
That second query, dennis, looks like you are using tags.

dennis
2018-03-06 10:42
oh and we are using version 2.12.0

matt
2018-03-06 12:03
@dennis how did you arrive at an `db.r4.xlarge` instance type for your DB? That is a _lot_ of memory to allocate, we don?t come anywhere near that need for hundreds of customers. It would be worth looking at other metrics to see if you can right scale this.

matt
2018-03-06 12:04
As per @beth?s note, it would seem there is either a) an issue with the query/index or b) a constraint on the DB

dennis
2018-03-06 12:06
Hi @matt, our devops guys created the postrgress db on AWS

matt
2018-03-06 12:06
if it?s b), one place to look is your allocated IOPS. You get 3GB of IOPS per 1GB provisioned storage. So even though you have a beefy _instance type_, you could still be throttled by IOPS. We note that on our workload, write to read ratio is generally 10:1 or higher. I would go and take a look at disk IOPS usage and compare to your provisioned IOPS - that could be something to consider

dennis
2018-03-06 12:06
I indeed see it?s only using I think 5Gb of memory, and we have 30 gigs

matt
2018-03-06 12:06
Are you using the DB for other purposes or just the broker?

dennis
2018-03-06 12:06
nope, it?s dedicated to the pact broker

dennis
2018-03-06 12:07
it?s a postgress cluster with a writer and a reader replica

matt
2018-03-06 12:07
Look, there _could_ be some esoteric issue with Aurora as we don?t run our workloads on it (yet, as it wasn?t available in ap-southeast-2 at the time) but I doubt it.

matt
2018-03-06 12:08
You could look to isolate that problem by re-running that query? Another option is that that query is really just unlucky, and there may have been other activities happening on the cluster impacting performance during that time (e.g. something maintaining a table lock).

dennis
2018-03-06 12:12
I noticed we have about 5 connections to the database, because we have 25 bamboo CI agents

dennis
2018-03-06 12:12
so somethings are going on in parrallel

dennis
2018-03-06 12:18
I overlooked your message regarding the iops


dennis
2018-03-06 12:18
but here are the stats

matt
2018-03-06 12:28
Thanks, how many GB do you have allocated? Signs are pointing elsewhere but good to clarify and rule out

matt
2018-03-06 12:30
Good call on multiple connections though, whilst it should be able to handle hundred of concurrent connections, some actions will lock tables. As alluded to earlier, it could be the complex view that gets created for the deployments feature

beth
2018-03-07 02:46
@matt they're on an earlier version that doesn't have the matrix queries

beth
2018-03-07 02:48
I'll spend some time tomorrow working out exactly what query it is that is taking up the bulk of the processing.

matt
2018-03-07 02:49
Thanks Beth. Would be good to know if an update fixes it though

beth
2018-03-07 02:49
It'll be either part of writing or reading the latest pact, but it's not immediately obvious to me from that line.

beth
2018-03-07 02:49
yes. I'll prioritise getting the new version out.

matt
2018-03-07 02:50
Sorry, I meant if they updated their instance

matt
2018-03-07 02:50
but that too :slightly_smiling_face:

beth
2018-03-07 02:50
oh right, I see.

dennis
2018-03-07 07:11
Hi, I don?t see the allowed IOPS anywhere, if we just create a postgress RDS database it is in there. But now we just see that it is a cluster, no sign of the allowed IOPS ...

dennis
2018-03-07 07:11
I will have a look in the documentation

dennis
2018-03-07 07:11
and keep you posted

matt
2018-03-07 07:12
As noted above, I just need to know how much storage you allocated

matt
2018-03-07 07:12
Then multiple by 3 gets you IOPS

dennis
2018-03-07 08:00
aurora postgress seems to do autoscalling on storage and increases per 10Gb

dennis
2018-03-07 08:00
we have 60gb allocated right now

matt
2018-03-07 08:01
cool, that should be heaps

matt
2018-03-07 08:01
worth checking, I forget about the scaling of Aurora

matt
2018-03-07 08:01
the 1500 write IOPS spike is the concern. Beth I think was going to look/think about that

dennis
2018-03-07 08:02
I?ll just wait for the new release tomorrow. If that does not improve I?ll remove the cluster and use a regular postgress

dennis
2018-03-07 08:02
no clue why our devops guys did something ?special? :slightly_smiling_face:

beth
2018-03-07 08:07
@dennis are you using date sorted versions or semanticly sorted versions?

beth
2018-03-07 08:08
The only thing I can think of that would cause that many writes would be publishing a new semanticly sorted versions, and then publishing a version that was "before" a heap of the others.

beth
2018-03-07 08:09
That would cause all the order numbers of the existing versions to be incremented.

beth
2018-03-07 08:09
I can't imagine what could cause the latest version query to cause that much effort.

dennis
2018-03-07 08:30
we are using semantic versions for our pact versions

dennis
2018-03-07 08:30
I?ll have a look at the config how sorting is configured

dennis
2018-03-07 08:34
app = PactBroker::App.new do | config | config.logger = $logger config.database_connection = create_database_connection(config.logger) config.database_connection.timezone = :utc end

dennis
2018-03-07 08:35
so we didn?t configure anything here

beth
2018-03-07 08:42
Yup, semantic.

beth
2018-03-07 22:02
I'm about to Upgrade All The Things, so if you notice slow behaviour in the next few minutes, that's why.