bethskurrie
2018-03-24 03:40
has joined #pact-scala-itv

david.j.smith
2018-05-03 04:37
has joined #pact-scala-itv

bethskurrie
2018-05-03 04:38
@david.j.smith you'll need to set up the slack integration for itv if you want to show the commits here

david.j.smith
2018-05-03 13:38
Hmmmm :thinking_face: Thanks I'll ponder that one :slightly_smiling_face:

bethskurrie
2018-05-03 23:11
It's not super important, don't stress if its politically too difficult.

harris.osserman
2018-08-13 16:55
has joined #pact-scala-itv


david.j.smith
2018-08-13 16:57
Gosh this is a hot topic at the moment :slightly_smiling_face: https://github.com/ITV/scala-pact/issues/98

david.j.smith
2018-08-13 16:57
This bug is apparently about basic auth too.

david.j.smith
2018-08-13 16:58
Although @harris.osserman you?ll need to speak to Ron about pact-jvm?s support for basic auth.


david.j.smith
2018-08-28 05:18
:scream: I?ll have a look.


ibenardetelevis
2018-09-04 07:06
has joined #pact-scala-itv

ibenardetelevis
2018-10-12 11:34
I?m a bit new to pact and contract testing might be a dummy question but; while writing a contract test for getting an entity `/resource/ID` when I use a random ID in my consumer and generate the pact file, now I need to make sure provider uses the same id to create this entity or is there a way to implement this without an actual value ?

daniel.straus
2018-10-16 22:38
has joined #pact-scala-itv

romuald.quantin
2018-11-02 08:12
has joined #pact-scala-itv

nikolajs.cmihuns
2018-11-13 10:00
has joined #pact-scala-itv

nikolajs.cmihuns
2018-11-13 11:48
Hi @david.j.smith, first of all thank you for "scala-pact". I have a question regarding http://io.itv.com/scala-pact/roadmap.html

nikolajs.cmihuns
2018-11-13 11:49
do you have any estimations of when Phase 5 - AMQP could be done

nikolajs.cmihuns
2018-11-13 11:50
this is very crucial part

david.j.smith
2018-11-13 16:49
Hi @nikolajs.cmihuns, glad to hear you?re finding it useful. AMQP support is the most requested feature, it?s also very difficult! :slightly_smiling_face: There is a PR open around this that needs attention, but I don?t have an estimates right now I?m afraid. My time is very limited these days, and the scale of the problem requires a lot of coordination. It isn?t just about adding AMQP support but also about supporting Pact V3/V4 (which the open PR does not try to do).

nikolajs.cmihuns
2018-11-13 18:20
ok, thank you for the answer

nikolajs.cmihuns
2018-11-13 18:21
just quick one more question, scala-pact is completely separate from DIUS-pact-jvm family of libraries ?

jonas.natten
2018-11-15 08:17
has joined #pact-scala-itv

david.j.smith
2018-11-15 10:37
Yes it is.

ben7091
2018-11-19 16:45
has joined #pact-scala-itv

jonas.natten
2018-11-20 11:51
Hello, Is there a way to exclude tests when running `sbt pactTest`?

jonas.natten
2018-11-20 11:53
Without pact i would just do `sbt "testOnly -- -l TestExcludeTag"`

jonas.natten
2018-11-20 11:54
And i thought i could do something like `Test / testOptions += Tests.Argument("-l", "TestExceludeTag")`, but that prevents me from running the test at all (So i can't do `sbt "testOnly -- -n TestExcludeTag"`).

jonas.natten
2018-11-22 09:32
Figured out i could work around it by making a separate configuration and setting `Test / testOptions := Seq(Tests.Argument("-l", "TestExcludeTag"), AllTestConfig / testOptions := Seq.empty` if anyone else was wondering.

jonas.natten
2018-11-22 11:16
@david.j.smith is there any plans to implement tagging releases at publish / using tags to select which version(s) of the pact to verify? Would you accept pull-requests?

david.j.smith
2018-11-22 13:35
Hi @jonas.natten - sorry for the slow response - very busy at the moment. I don?t really do test exclusion myself, so it isn?t something I?ve looked at hard. But it?s just ScalaTest, so as long as your consumer tests are split up appropriately I assume the usual processes will apply? The thing currently in progress - nearly there - is adding metadata support as a step towards Pact V3/4. I absolutely do take PR?s. I strongly advise that unless the issue is trivial, you should raise an issue explaining the problem and how you?d like to solve it, let me feedback, and then do the PR so it?s not a total shock. I desperately want to merge in all PR?s and I try hard to do so, its hard than it seems. People make it hard by either a) just turning up with a code change and expecting me to take their word for it, or b) discussing it first but then arriving with 2000 lines of changes that touch a massive area of code? and expecting me to take their word for it that it?s all still ok?. if I have to take two days off work to wade through it all, it probably just won?t get merged! :shrug: :slightly_smiling_face:

jonas.natten
2018-11-23 06:38
Sounds good @david.j.smith. I updated the issue i created asking here: https://github.com/ITV/scala-pact/issues/107 :slightly_smiling_face:

david.j.smith
2018-11-27 13:17
It?s a great PR! I left feedback - thanks! :slightly_smiling_face:

jonas.natten
2018-12-20 08:11
Thanks for merging the tag PR @david.j.smith. I've made a second one for the missing url encoding here: https://github.com/ITV/scala-pact/pull/115

jonas.natten
2018-12-20 08:13
Also implemented http basic auth: https://github.com/ITV/scala-pact/pull/114 Not sure if its implemented in a stupid way, but needed it badly for a project so i just went ahead and did it :slightly_smiling_face:

david.j.smith
2018-12-30 10:47
A bunch of lovely people have submitted PRs during December. They?re mostly merged but I?m trying to get to the bottom of a bug in the Http4s `0.20.0-M4` module. I think I?m going to raise an issue on the Http4s project soon and just get the next version of Scala-Pact out with a small disclaimer about chunked requests not being accepted yet.

david.j.smith
2018-12-31 15:13
@jonas.natten Running the testing scripts now. If all is well I?ll try and cut the release too. Thanks for all the work. :smile:

jonas.natten
2018-12-31 15:15
Sounds good! I ran the scripts/local-build-test.sh script, but please verify! :+1:

david.j.smith
2018-12-31 15:17
Ah thanks, that?s mostly what I?m doing :wink:

david.j.smith
2018-12-31 15:35
Looking good. I?ll start the release process and let you know when it?s done - it takes a long time?

david.j.smith
2018-12-31 16:19
Well. In theory `2.3.4` is now out and should be resolvable via SBT in the next 15 minutes (takes a while to propagate). It should then appear on http://search.maven.org in the next couple of hours.


jonas.natten
2018-12-31 16:52
Woho! :tada:

david.j.smith
2018-12-31 18:48
Thanks for the help and happy new year! :smile:

nishantv12
2019-01-10 16:09
has joined #pact-scala-itv

nishantv12
2019-01-10 16:11
I can't seem to find a way to provide a map in provider state in scala-pact. Such a functionality is supported in pact-jvm. Can someone tell if they don't find it necessary or if it will be supported in near future

david.j.smith
2019-01-15 16:16
Hi @nishantv12, this is a quiet channel - helps if you @ me. :slightly_smiling_face: Can you give me an example?

kurst03
2019-01-16 17:19
has joined #pact-scala-itv

damien.castelltort
2019-02-26 17:00
has joined #pact-scala-itv

ibenardetelevis
2019-04-26 10:25
Hi Everyone, I am getting the following error writing provider tests and couldn?t figure out why maybe somebody has some idea.

david.j.smith
2019-05-20 22:30
I need to find a better notification system for this Slack channel :sweat_smile:

daniel.tattan.birch
2019-05-28 16:00
has joined #pact-scala-itv

amber.race
2019-08-07 21:47
has joined #pact-scala-itv

kashikar.harsh
2019-08-28 13:39
has joined #pact-scala-itv

kashikar.harsh
2019-08-28 13:39
Hi Team

kashikar.harsh
2019-08-28 13:39
Do we support message queue based contract validations in scala (pact spec v3)?

david.j.smith
2019-09-06 10:45
Not currently, it?s an incredibly slow burn work in progress?.

kashikar.harsh
2019-09-06 13:31
Thanks @david.j.smith

kashikar.harsh
2019-09-28 16:38
Hey all, I was trying to use pact jvm library for java/junit to validate scala provider method

kashikar.harsh
2019-09-28 16:39
has anyone tried this before?

kashikar.harsh
2019-09-28 16:40
I am facing some problem with compiling both maven and sbt, somehow maven doesn't honor dependencies defined in sbt file and throws exception

david.j.smith
2019-09-28 16:40
I'd try the #pact-jvm channel @kashikar.harsh

kashikar.harsh
2019-09-28 16:41
Sure @david.j.smith, will post it there as well

david.j.smith
2019-09-28 16:41
This channel is for a different implementation entirely, that just happens to also be for Scala. :slightly_smiling_face:

kashikar.harsh
2019-09-28 16:43
Thanks, will post my queries to pact-jvm hereafter :+1:

amber.race
2019-09-30 19:54
@amber.race has left the channel

kashikar.harsh
2019-10-01 14:37
Hey all

kashikar.harsh
2019-10-01 14:38
I am trying to parameterize pact broker credentials by using variable pactBrokerCredentials as stated in doc https://github.com/ITV/scala-pact/blob/master/scalapact-docs/src/main/paradox/basics/sbt-commands.md

kashikar.harsh
2019-10-01 14:38
however getting an error that pactBrokerCredentials cannot be resolved

kashikar.harsh
2019-10-01 14:39
using SBT 0.13.16 and scalapact 2.2.5

daniel.tattan.birch
2019-10-01 23:09
Hi @kashikar.harsh. Looking at the repo at the point this sbt setting was added, the version was around 2.3.4 - i.e. https://github.com/ITV/scala-pact/blob/2d4f220d01a0c2d86f8aaaeff2ef8d2b06bc56d8/build.sbt#L64 Looks like you'll need an upgrade :smile:

kashikar.harsh
2019-10-11 11:57
Thanks @daniel.tattan.birch

kashikar.harsh
2019-10-11 11:57
Is there an example where we pass pactbroker credentials as argument from sbt?

david.j.smith
2019-10-14 07:57
You can pass basic auth in the url if that helps?

kashikar.harsh
2019-10-15 10:47
We do log urls and responses for troubleshooting, so we will end up logging the credentials in plain text with that approach

david.j.smith
2019-10-16 21:43
I?d need to check but I?m pretty sure it gets converted to the standard auth header - do you also log headers? And you?re logging access requests to Pact Broker?

kashikar.harsh
2019-10-17 05:42
we have a common method for all http requests that logs the url information

david.j.smith
2019-10-17 21:13
Even during tests?

david.j.smith
2019-10-17 21:14
Getting back to your question, a better tactic than supplying command line arguments is to have a `.gitignore`d `pactcredentials.sbt` file in your root directory that declares the `pactBrokerCredentials := ("username", "password")` line (http://io.itv.com/scala-pact/basics/sbt-commands.html#command-line-options).

david.j.smith
2019-10-17 21:15
However! Pact _is_ going to use those credentials to make a basic auth header.

david.j.smith
2019-10-17 21:16
That?s just how it works.

igalbenardete
2019-12-06 09:44
has joined #pact-scala-itv

igalbenardete
2019-12-06 10:43
Is there a way to publish contracts without running the tests. So basically I have generated my pact files and now just want to publish. However `pactPublish` command runs all the tests

david.j.smith
2019-12-06 11:28
Yes

david.j.smith
2019-12-06 11:28
There are SBT Commands and SBT Tasks.

david.j.smith
2019-12-06 11:29
When I wrote the commands (the tasks came much later) I was trying to make the process robust by ensure everything, like `pactPublish` ran from a clean slate so that you could never get into a bad state.

david.j.smith
2019-12-06 11:30
However, Commands don?t compose and most people who?ve been using SBT for decent period of time are used to dealing with incremental build state, so we introduced Tasks that do only the intended work, but offer no guarantees about accuracy.

david.j.smith
2019-12-06 11:32
You can use `pactPush` to do the thing you want, you just need to be aware that it will push _everything_ even old, lingering, or uncompiled pact files. Suggest running `pactPack` then `packPush` to flatten pact files together and then push them.

igalbenardete
2019-12-06 11:33
Thank you very much !

igalbenardete
2019-12-06 14:33
Is there a way to pass parameters to either pactPush or pactPack in a multimodule project ?

david.j.smith
2019-12-06 14:34
That?s an excellent question. :thinking_face:

david.j.smith
2019-12-06 14:34
Example?

igalbenardete
2019-12-06 14:38
I get this error basically `Supplied pact path does not exist! Aborting file load.`

david.j.smith
2019-12-06 14:38
Oh I see.

igalbenardete
2019-12-06 14:38
Or do I need to define this path somewhere because in my multi-module project there is only one module which has contract tests now

david.j.smith
2019-12-06 14:39
And you?re doing something like `sbt mymodule/pactPush`?

igalbenardete
2019-12-06 14:43
no just doing it at the highest level

igalbenardete
2019-12-06 14:44
I get the same error doing it with the submodule/pactPush

david.j.smith
2019-12-06 14:45
The opposite of what I thought then. You run at the highest level, the pact files are generated at the module level but you try and publish from the root?

david.j.smith
2019-12-06 14:47
Just seeing if we do this anywhere

igalbenardete
2019-12-06 14:47
Files are generated at the highest level then I tried to push from both the highest level and from the submodule

igalbenardete
2019-12-06 15:15
It turns out I?ve already been pushing the contracts to the broker even though I got errors

david.j.smith
2019-12-06 15:23
Yes I?ve just had a similar issue, I was testing it out on one of our projects.

david.j.smith
2019-12-06 15:24
In a multi project build, pact allows works in the root level. However, your best bet is to always invoked the commands at the module level especially if you?re aggregating projects because otherwise it runs the command once per aggregated project, even though a previous pass might have deleted the files or something.

david.j.smith
2019-12-06 15:25
Multi project builds through up loads of corner cases!

david.j.smith
2019-12-06 15:25
(For plugin creators)

igalbenardete
2019-12-06 15:25
Another question: ```"metadata" : { "pactSpecification" : { "version" : "2.0.0" }, "scala-pact" : { "version" : "2.3.12" } }``` How do I add this block to my contracts the sample project generates them but couldn?t find anything different that will add these

igalbenardete
2019-12-06 15:33
I just found the issue on github and I guess this has been fixed but I am using the older version so there is not much I can do i suppose ?

david.j.smith
2019-12-06 15:43
That?s right, we added this in a fairly recent version, it just does it automatically now.

igalbenardete
2019-12-06 16:46
Just to double check the README file vs the official documentation page the latest versions seems to be different; is there a reason or just the docs need to be updated

david.j.smith
2019-12-06 16:47
Oh heck - sorry the latest version is `2.3.12` - sorry about that!

igalbenardete
2019-12-06 16:48
No worries just wanted to let you know; thank you for the update

david.j.smith
2019-12-06 16:48
Thanks for pointing it out! :slightly_smiling_face:

igalbenardete
2019-12-06 16:59
```[error] Test suite contracttests.ConsumerSpec failed with java.lang.NoClassDefFoundError: io/circe/generic/encoding/ReprObjectEncoder. [error] This may be due to the ClassLoaderLayeringStrategy (Flat) used by your task. [error] To improve performance and reduce memory, sbt attempts to cache the class loaders used to load the project dependencies. [error] The project class files are loaded in a separate class loader that is created for each test run. [error] The test class loader accesses the project dependency classes using the cached project dependency classloader. [error] With this approach, class loading may fail under the following conditions: [error] [error] * Dependencies use reflection to access classes in your project's classpath. [error] Java serialization/deserialization may cause this. [error] * An open package is accessed across layers. If the project's classes access or extend [error] jvm package private classes defined in a project dependency, it may cause an IllegalAccessError [error] because the jvm enforces package private at the classloader level. [error] [error] These issues, along with others that were not enumerated above, may be resolved by changing the class loader layering strategy. [error] The Flat and ScalaLibrary strategies bundle the full project classpath in the same class loader. [error] To use one of these strategies, set the ClassLoaderLayeringStrategy key [error] in your configuration, for example: [error] [error] set Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary [error] set Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat``` I even set these strategies but still getting errors

david.j.smith
2019-12-06 18:29
Can you privately send me your sbt dependency lines (copy+paste)?

plessmann
2019-12-23 14:26
has joined #pact-scala-itv

ihor.dobrovolskyi
2020-02-25 08:54
has joined #pact-scala-itv

hans.brouwer
2020-05-13 08:26
has joined #pact-scala-itv

hans.brouwer
2020-05-15 08:35
Hi, has any one experience with Kafka message CDC testing? I'm trying, though I got stuck. The scalapact library seems only to support HTTP call testing.

bethskurrie
2020-05-15 08:35
Yes, I believe this is the case.

bethskurrie
2020-05-15 08:35
Scala pact hasn't had much love for a while.

bethskurrie
2020-05-15 08:35
Pact-JVM supports message queues - I don't know if you're able to use that interface?

bethskurrie
2020-05-15 08:36
(I'm not a Scala dev)

hans.brouwer
2020-05-15 08:36
I tried to, byut didn't have any success yet.

david.j.smith
2020-05-15 08:53
Sad but true, just maintenance.

david.j.smith
2020-05-15 08:56
We?re all still using it every single day, since for the HTTP use case it works very well. But no-one has felt sufficiently moved to carry on the messaging protocol work as yet, and I?m just too busy these days.

bethskurrie
2020-05-15 08:57
I can sympathise @david.j.smith!

baquinteros
2020-05-20 07:55
has joined #pact-scala-itv

uladzimir.sadouski
2020-06-01 21:22
has joined #pact-scala-itv

rafael.anachoreta
2020-06-02 09:08
has joined #pact-scala-itv

naree.song
2020-06-29 09:13
has joined #pact-scala-itv

naree.song
2020-06-29 11:47
Hi @david.j.smith :slightly_smiling_face:

david.j.smith
2020-06-29 11:48
Oh hello! :smile: @naree.song

naree.song
2020-06-29 11:49
I found the right slack in the end. I am playing with `scalapact` and it seems to be working as well as I remember :slightly_smiling_face:

david.j.smith
2020-06-29 11:49
This is like a collision of worlds or something.

david.j.smith
2020-06-29 11:49
I apologise then.

david.j.smith
2020-06-29 11:50
:wink:

naree.song
2020-06-29 11:50
Oh I messaged you on linkedin as I was looking for slack channel or gitter channel for `scalapact`

david.j.smith
2020-06-29 11:51
Oh sorry! I hardly ever venture there.

naree.song
2020-06-29 11:51
no worries :slightly_smiling_face:

david.j.smith
2020-06-29 11:51
This is the only thing that exists and it?s pretty quiet as you can see. :slightly_smiling_face:

naree.song
2020-06-29 11:53
Hahaha, quiet is a good thing sometimes :slightly_smiling_face:. I am planning to use `scalapact` for the API project I am starting on at work. The only thing that got me slightly lost was that I could not find something like compatibility matrix to find all the dependencies I need to use `scalapact` with Scala 2.13

naree.song
2020-06-29 11:54
I am wondering if you guys are planning to add it to the documentation? If not, I am happy to do it.

david.j.smith
2020-06-29 11:54
Good question.

david.j.smith
2020-06-29 11:55
We haven?t updated that for quite a while.

david.j.smith
2020-06-29 11:55
Just a sec

naree.song
2020-06-29 11:56
(Noel says hi :slightly_smiling_face: )

david.j.smith
2020-06-29 11:57
Hi to Noel :wink:

david.j.smith
2020-06-29 11:58
Looks like the main things to watch out for at that we?re only publishing 2.13 support for: http4s 021 circe 12, 13

david.j.smith
2020-06-29 11:58
(I just did a quick delve through the build file)

david.j.smith
2020-06-29 12:01
There are some other people here helping keep it up to date (Do you know Gus? Andrew Gustafson? He?s one anyway.)

david.j.smith
2020-06-29 12:02
It?s still massively in use so we know it?s ok, just out of date with regards to the pact spec.

naree.song
2020-06-29 12:07
Cool, yeah personally I think pact testing is the magic ingredient that enables the microservice architecture :slightly_smiling_face: I really wanted to use it for my previous project but it was Kafka. I saw someone asking about it here as well but if I were to work on another Kafka project, I would like pact support for Kafka. Happy to work on it myself :slightly_smiling_face:

naree.song
2020-06-29 12:09
In the meantime, I am able to use `scalapact` with Scala 2.13 nicely for restful endpoints. :slightly_smiling_face:

naree.song
2020-06-29 12:10
Can the documentation on `scalapact` on github be updated to include the compatibility matrix? I am happy to do it and create a PR for it if that helps?

naree.song
2020-06-29 12:27
Yes I know him.

david.j.smith
2020-06-29 12:32
All help is gratefully received, I don?t personally spend much time on it these days but I?m going to hopefully rope someone into working on it later in the year.

david.j.smith
2020-06-29 12:33
The main thing missing is message support that would meet a RabbitMQ or Kafka like use case. Other variations of Pact do support this.

david.j.smith
2020-06-29 12:34
I haven?t tried it in years, but there is Pact-JVM that might do what you want?

david.j.smith
2020-06-29 12:35
But yes if you?d like to help with docs, or working on messaging we?d be delighted to talk through what is required to make it happen - we have started, I think there might be open issues around it.

naree.song
2020-06-29 12:37
Cool, I will look for the issue and if I cannot find it, I will create one and we can continue the discussion there. Thanks Dave :slightly_smiling_face:

david.j.smith
2020-06-29 12:39
Lovely, thanks Naree! :smile:

daniel.tattan.birch
2020-06-30 16:05
This sounds ominous :joy:

david.j.smith
2020-06-30 16:07
Ha! I didn't necessarily mean you Dan. :wink::laughing:

matt.fellows
2020-07-13 13:50
has joined #pact-scala-itv

maciej.olko
2020-07-30 09:43
has joined #pact-scala-itv

maciej.olko
2020-07-30 15:10
Hi, we are getting ```[scala-pact] 1 Pact verify tests failed. Publish verification results failed with 400``` on attempt to publish verification result to broker, which doesn?t use authorization. Is anybody able to give a hint with it?

david.j.smith
2020-07-30 15:14
It?s been a long time since I?ve looked at that corner of Scala-Pact, but `400` I guess its a bad request status code from Pact Broker. Anyway to manually make the call and see if you and recreate the problem?

maciej.olko
2020-07-30 15:16
Will try then, thanks

david.j.smith
2020-07-30 15:17
It?s quite possible that the verification results API spec has changed and we?re out of date. We use a standalone pact broker here, but I doubt it?s the latest version.

maciej.olko
2020-07-30 15:20
We are using internal verification for what it?s worth.

maciej.olko
2020-07-30 15:50
For what it?s worth the broker responds with ```{ "errors": { "success": [ "must be boolean" ] } }``` to request that goes internally.

maciej.olko
2020-07-30 20:05
My colleague has opened a pull request with a fix: https://github.com/ITV/scala-pact/pull/163

matt.fellows
2020-07-31 02:24
Cc: @bethskurrie Time for pact tests?

heytaco
2020-08-25 03:57
has joined #pact-scala-itv

heytaco
2020-08-25 03:57
Hi there! My name is HeyTaco!, and you can use me to give people tacos to show your appreciation. My tacos will spread joy through Slack!

sjdl
2020-08-31 11:58
has joined #pact-scala-itv

kflo
2020-09-22 01:17
has joined #pact-scala-itv

aaron.ramirez
2020-09-22 03:36
has joined #pact-scala-itv

mbbush
2020-09-23 22:18
has joined #pact-scala-itv

kflo
2020-12-16 02:07
how do you publish verification results when using `verifyPact` syntax in tests?

kflo
2020-12-16 02:09
hm, maybe `ScalaPactSettings.publishResultsEnabled` ? documentation really needs to be updated

rsaccoll
2020-12-21 13:18
has joined #pact-scala-itv

tjones
2021-01-04 02:14
has joined #pact-scala-itv

kflo
2021-01-09 02:41
> By default, Scala-Pact does not allow you to publish pact files from SNAPSHOT versions of your project (but takes into account the pactContractVersion if set). This is because it can confuse pact brokers understanding of the latest contract.

kflo
2021-01-09 02:41
can anyone elaborate on this?

kflo
2021-01-09 03:06
i read https://docs.pact.io/getting_started/versioning_in_the_pact_broker which provided a little clarity but i?m still not sure why SNAPSHOT versions would ?confuse the brokers understanding of the latest contract?

kflo
2021-01-09 03:07
especially because the pacts would be tagged, so i don?t see the issue


matt.fellows
2021-01-09 08:57
It may have been historic due to versioning schemes in the broker

kflo
2021-01-11 19:35
pretty sure i have something misconfigured somewhere, but I am using `pactBrokerWithVersionSelectors` with `publishResultsEnabled` and everything is working correctly except the provider version is not getting tagged with the branch like the consumer is?

kflo
2021-01-11 20:35
i think this might be a bug in `scala-pact`, filed https://github.com/ITV/scala-pact/issues/207

david.j.smith
2021-01-11 20:42
Yes that, also there was no concept of ?ready to deploy? back in the mists of time when I wrote that. :slightly_smiling_face:

david.j.smith
2021-01-11 20:43
Thanks - we?re not terribly good at checking this channel! :slightly_smiling_face: I?ll try and encourage others who help maintain Scala-Pact to come along.

kflo
2021-01-11 20:47
i?ll take a look at how the consumer does this and see if i can perhaps open a PR to fix this

kflo
2021-01-11 20:49
would be great! our company mainly uses scala and we are just now adopting pact, so hopefully some of us can help contribute back to this project



laxmi.somni508
2021-01-27 11:53
has joined #pact-scala-itv

kflo
2021-01-28 19:35
started a thread in #pact-jvm about scala-pact vs pact-jvm

scott.riley111
2021-03-24 15:05
has joined #pact-scala-itv

laxmi.somni508
2021-05-05 13:18
Hello Folks, Where could I get reading material & kickstart examples with explanation, for someone new to Scala & ITV_pact? Thanks

rafael.anachoreta
2021-05-11 15:33
@rafael.anachoreta has left the channel

kflo
2021-05-13 00:03
@jackbwheatley i see some new commits to the project which reference pact-jvm ? can you shed any light on what you?re working on?

jackbwheatley
2021-05-13 00:03
has joined #pact-scala-itv

kflo
2021-05-13 00:04
we are doing a proof of concept right now for pact v3 message support in our scala projects, and we are bypassing the scala-pact project because it?s too much work to do it there

kflo
2021-05-13 00:04
the plan is to integrate it directly on top of pact-jvm

kflo
2021-05-13 00:05
part of that includes publishing pact files generated from pact-jvm, which we would need to write support for probably into an sbt task

jackbwheatley
2021-05-13 08:49
Hi Kyle, so I?ve actually been having some similar thoughts about scala-pact. As you allude to, adding v3 features of the pact spec to scala-pact would be an inordinate amount of work. As an experiment, I?ve been quietly working on a pact-jvm wrapper - https://github.com/jbwheatley/pact4s - and we are considering phasing out our use of scala-pact at ITV in favour of wrapping pact-jvm and the using the broker CLI. Part of that roadmap is ensuring that we can continue to use scala-pact?s sbt plugin to publish and retrieve pacts - hence the release earlier this week that adds support for publishing pacts made using pact-jvm.

kflo
2021-05-13 15:27
thanks for the update ? looks like support for message testing is still in the works, but it has request/response testing already, is that right?

kflo
2021-05-13 15:36
i do see `MessagePactForger` which i guess is for the consumer tests. it doesn?t seem like there is any relation between a message and a test, i guess it?s up to the implementor to ensure every message is tested?

jackbwheatley
2021-05-13 15:45
Yep, its still early days, and I need to start documenting things. The test classes are a good place to start for examples. I have been able to write consumer http pacts with pact4s and publish them to the broker with the scala-pact sbt plugin in one of our services, so I can at least say its functional in that regard :grin: > i guess it?s up to the implementor to ensure every message is tested? yeah that is right.

kflo
2021-05-13 15:46
am i correct that we can?t yet create and verify message pacts with this library yet?

kflo
2021-05-13 15:46
i guess perhaps create but not verify

kflo
2021-05-13 15:47
it looks like `runVerificationForConsumer` is only for interactions (not messages)

jackbwheatley
2021-05-13 15:47
yeah that?s right, I haven?t looked into message pact verification yet

kflo
2021-05-13 15:51
oh, actually `runVerificationForConsumer` looks like it does support message pacts

jackbwheatley
2021-05-13 15:53
oh right, is there something in the `ProviderInfo` or version selectors that says they are message pacts?

kflo
2021-05-13 15:54
yeah i guess `Interaction` has multiple sub-types now, one of which is `MessageInteraction`

kflo
2021-05-13 15:54
although that validation happens in `verifyResponseByInvokingProviderMethods` which seems to require test method annotations



jackbwheatley
2021-05-13 16:00
ok seems like this needs some investigation. Would rather not have to use annotations


kflo
2021-05-13 16:01
pact-jvm is a little hard to reason about sometimes :sweat_smile:

jackbwheatley
2021-05-13 16:01
for sure, its been a bit of a minefield for me so far

dimundo
2021-05-26 07:37
has joined #pact-scala-itv

dimundo
2021-05-28 06:03
hi! anyone having issues with `sbt pactVerify` ? for me, it returns timedout broker, still curl from logs works flawlessly


kflo
2021-05-28 18:05
i don?t use `sbt pactVerify` (we do verification from Scalatest), but we haven?t had any issues with the library communicating with the broker

kflo
2021-05-28 18:05
our client timeout is set to 2 seconds

dimundo
2021-05-29 10:14
do you have producer and consumer in same repo ?

dimundo
2021-05-31 11:27
@kflo do you verify with `sbt test` ? how then producer sends verification to broker ( if you use it) ?

dimundo
2021-05-31 16:11
found out - extra param in ```pactBrokerUseLatest```

dimundo
2021-05-31 16:18
hello once again :slightly_smiling_face: for provider one can set such pact sources ? loadFromLocal ? pactAsJsonString ? pactBrokerUseLatest latter doesn't use params from `pact.sbt` is it intended, or I didn't found how not to duplicate all those in each test ? ``` case class pactBrokerUseLatest( url: String, provider: String, consumers: List[String], publishResultsEnabled: Option[BrokerPublishData], pactBrokerAuthorization: Option[PactBrokerAuthorization], pactBrokerClientTimeout: Option[Duration] )```

kflo
2021-06-01 16:28
correct, we use `sbt test` and configure it to report the results back

dimundo
2021-06-07 10:22
hello maybe one more question there is example about https://github.com/pact-foundation/pact-js/blob/master/examples/messages/consumer/message-consumer.spec.ts any examples about producer/consumer tests for ws in scala ?

kflo
2021-06-07 16:14
are you referring to websockets/messages? the itv/scala-pact project doesn?t support messages yet, it only supports V2 (message support was added in V3). as you?ve discovered we have been working on a new library that is built on top of `pact-jvm` here https://github.com/jbwheatley/pact4s ? that one will support message testing

caoilte
2021-06-15 11:39
has joined #pact-scala-itv

varnit.garg2424
2021-06-23 08:10
has joined #pact-scala-itv

varnit.garg2424
2021-06-23 08:11
Hey guys, does scala-pact supports messaging pact?

matt.fellows
2021-06-23 08:22
@varnit.garg2424 :point_up:

david.j.smith
2021-06-23 11:15
Hi @varnit.garg2424 - it does not no. Scala-Pact is slowely being replaced by https://github.com/jbwheatley/pact4s - @jackbwheatley I guess pact4s would support messaging?

jackbwheatley
2021-06-23 11:17
Yes, pact4s does support message pacts! It would great to get more people to try it out :simple_smile:

varnit.garg2424
2021-06-23 17:26
Great! Thanks @jackbwheatley. Let me try it out. By the way, do we have any sample project for reference to get started with? :slightly_smiling_face:

jackbwheatley
2021-06-24 08:59
@varnit.garg2424 the message pact work hasn't been documented yet, but you can find examples on both forging and verifying pacts in the tests suites

kflo
2021-06-29 15:53
i wonder if we should create a new channel for pact4s :thinking_face:

kflo
2021-06-29 15:55
or maybe just #pact-scala

kflo
2021-06-29 15:55
@jackbwheatley what do you think?

dimundo
2021-06-29 15:56
this one is also about scala

dimundo
2021-06-29 15:57
so you can create #pact-scala and mention 2 branches there :smile:

kflo
2021-06-29 15:58
haha. this existing channel is specifically for https://github.com/ITV/scala-pact

kflo
2021-06-29 15:58
i?m wondering if it?s better to just make an all-purpose #pact-scala instead of tying it to a specific library

kflo
2021-06-29 15:59
in any case, we would need the blessing of @matt.fellows or @bethskurrie to actually create the channel

dimundo
2021-06-30 17:55
hi! anyone succeeded to create `pact4s` scala message consumer ? i?m having troubles with that ( copypasted example https://github.com/jbwheatley/pact4s/blob/main/scalatest-pact/src/test/scala/pact4s/scalatest/MessagePactForgerScalaTestSuite.scala, but no luck ) ```An exception or error caused a run to abort: 'void io.circe.Codec.$init$(io.circe.Codec)' java.lang.NoSuchMethodError: 'void io.circe.Codec.$init$(io.circe.Codec)' at pact4s.circe.implicits$$anon$1.<init>(implicits.scala:38) at pact4s.circe.implicits$.<clinit>(implicits.scala:38) at com.xx.yy.api.MessagesConsumerPactVerifierSpec.<init>(MessagesConsumerPactVerifierSpec.scala:21) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:350) at java.base/java.lang.Class.newInstance(Class.java:645) at org.scalatest.tools.Runner$.genSuiteConfig(Runner.scala:1402) at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$8(Runner.scala:1199) at scala.collection.immutable.List.map(List.scala:246)``` for sure its something simple :)

dimundo
2021-06-30 18:05
@jackbwheatley maybe? ( sorry for pinging )

jackbwheatley
2021-07-01 08:58
not sure about that one! What version of circe are you using? NoSuchMethodError would suggest some sort of binary compat issue..

dimundo
2021-07-01 09:49
> val circeVersion = ?0.13.0? > val enumeratumCirceVersion = ?1.6.1"

jackbwheatley
2021-07-01 11:03
ah right, pact4s-circe is using circe 0.14 - perhaps try bumping that dependency?

dimundo
2021-07-01 11:04
heh, ok, will try

dimundo
2021-07-01 11:04
as a note

dimundo
2021-07-01 11:05
thing didn?t worked -`import pact4s.circe.implicits._`it doesn?t fetched as dependency, so, i?ve added explicitly > val pact4sCirce = ?io.github.jbwheatley? %% ?pact4s-circe? % ?0.0.10? but this one fetched automatically > io.github.jbwheatley:shared_2.13:0.0.10:jar

jackbwheatley
2021-07-01 11:07
yes, that is intentional as not everyone uses circe. I think there is a note buried in the readme that you need the additional dependency, but it could be more clear.


dimundo
2021-07-01 11:08
indeed

dimundo
2021-07-01 11:08
> By adding the additional dependency`io.github.jbwheatley %% pact4s-circe % xxx`, instances of`pact4s.PactBodyEncoder`are provided for any type that has a`circe.Encoder`instance. This allows the following:

dimundo
2021-07-01 11:08
will try bumping :+1: thank you

dimundo
2021-07-01 14:55
`pact4s` guys, is this valid ?

dimundo
2021-07-01 14:56
like 2 messages with same annotation

dimundo
2021-07-01 14:56
or there are other options form that ?

dimundo
2021-07-01 16:24
yes, bumping circe from 0.13 to 0.14.1 done magic ( cc @kflo)

kflo
2021-07-01 16:28
what is the intent? maybe you want to use a provider state instead?

dimundo
2021-07-01 16:30
so consumer has ``` "$.mode": { "matchers": [ { "match": "regex", "regex": "^(Live|Maintenance)$" } ] },```

dimundo
2021-07-01 16:30
and producer makes sure, all owns states are fed

kflo
2021-07-01 16:30
yeah seems like a good use-case for a state. but also maybe a test that can be covered elsewhere outside of pact

kflo
2021-07-01 16:31
seems like it might be testing business logic

dimundo
2021-07-01 16:31
yes and no

dimundo
2021-07-01 16:31
how consumer will know, that `Maintenance` is changed to `Hidden`

dimundo
2021-07-01 16:32
producer feeds all own stuff and suffers

kflo
2021-07-01 16:34
this might be a better question in general about how to test things in pact

kflo
2021-07-01 16:34
doesn?t seem specific to pact4s

dimundo
2021-07-01 16:34
did that already :slightly_smiling_face:

dimundo
2021-07-01 16:34
but maybe scala power has own answers already :slightly_smiling_face:

kflo
2021-07-01 16:35
i will say that, if pact-jvm supports something (like multiple `@PactVerifyProvider()` with the same description), then pact4s will also support it

dimundo
2021-07-01 16:35
it works, yes

kflo
2021-07-01 16:35
but it seems like the primary question here is what the best pattern is

dimundo
2021-07-01 16:35
but question is more general

dimundo
2021-07-01 16:35
> is what the best pattern is exactly

kflo
2021-07-01 16:36
i unfortunately haven?t spent enough time implementing pacts to answer it

dimundo
2021-07-01 16:36
as growing permutations will not scale with copypaste

kflo
2021-07-01 16:36
yeah, a sign that maybe it?s not a good pattern

kflo
2021-07-01 16:36
:stuck_out_tongue:

kflo
2021-07-01 16:37
i feel like using states is the best pattern. but that will mean there could be other states that the provider supports that the consumer doesn?t

kflo
2021-07-01 16:37
like if the provider added `Down`, using states wouldn?t alert you to that

kflo
2021-07-01 16:38
because you are only requesting the states you handle, as a consumer

dimundo
2021-07-01 16:39
exactly


dimundo
2021-07-01 16:39
yes, but it is not that case, imho


dimundo
2021-07-01 16:40
otherwise one can change `"regex": "^(Live|Maintenance)$"` to simple `like`

dimundo
2021-07-01 16:41
awesome link with properly asked question :taco:

dimundo
2021-07-01 16:41
@kflo :taco:


dimundo
2021-07-01 16:43
and Matt says ?NO? :man-shrugging:

kflo
2021-07-01 16:43
i guess it ultimately comes down to what you expect your consumer to do if it is given a different enum value than it knows about

dimundo
2021-07-01 16:43
> there is no right or wrong answer, just be wary of testing_all_permutations of input/output data. yeah

dimundo
2021-07-01 16:44
looks like we need to sit down and discuss, which road we will go :)

kflo
2021-07-01 16:50
it?s kind of weird, but i wonder if the consumer could expect the producer to return a field that is the combination of all the enum types, something like `Down,Live,Maintenance` ? it would have to be sorted. but then the consumer could expect a specific list, and the provider build would fail if it has a different value. the list would have to be generated directly from the enum, otherwise it would be useless

kflo
2021-07-01 16:53
seems like a code smell though

kflo
2021-07-01 16:53
:smile:

dimundo
2021-07-01 16:53
it will be a bit different test

dimundo
2021-07-01 16:53
still, it could be another pact

kflo
2021-07-01 16:53
yep, i was thinking it would be a separate pact

dimundo
2021-07-01 16:54
enum vs enum

kflo
2021-07-01 16:54
probably an HTTP pact

dimundo
2021-07-01 16:54
yep, like all states :+1:

dimundo
2021-07-01 16:54
with exact match

dimundo
2021-07-01 16:55
from one other view - its code changes for testing

dimundo
2021-07-01 16:55
like adding extra endpoint


dimundo
2021-07-01 16:56
so, tomorrow is Friday - nice time for holywars :smiling_imp:


dimundo
2021-07-06 11:23
hi! any ideas about this ? ```MessagesConsumerPactForgerSpec *** ABORTED *** [info] java.lang.Exception: Auto-conversion of circe.Json to PactDslJsonBody is unsupported for json containing arrays. [info] at pact4s.circe.JsonConversion$.$anonfun$addFieldToBuilder$7(JsonConversion.scala:33) [info] at io.circe.Json.fold(Json.scala:39) [info] at pact4s.circe.JsonConversion$.addFieldToBuilder(JsonConversion.scala:34) [info] at pact4s.circe.JsonConversion$.$anonfun$_jsonToPactDslJsonBody$4(JsonConversion.scala:48) [info] at scala.collection.IterableOnceOps.foldLeft(IterableOnce.scala:646) [info] at scala.collection.IterableOnceOps.foldLeft$(IterableOnce.scala:642) [info] at scala.collection.AbstractIterable.foldLeft(Iterable.scala:919) [info] at pact4s.circe.JsonConversion$.$anonfun$_jsonToPactDslJsonBody$3(JsonConversion.scala:47) [info] at io.circe.Json.arrayOrObject(Json.scala:56) [info] at pact4s.circe.JsonConversion$._jsonToPactDslJsonBody(JsonConversion.scala:46)```

dimundo
2021-07-06 11:45
so its failing for ```{ "options" : ["a","b"] }```

kflo
2021-07-06 16:47
@jackbwheatley will have to answer that one

kflo
2021-07-06 16:48
but as it says, can?t use arrays when converting json body with circe. i don?t know why though

jackbwheatley
2021-07-06 17:09
Its because I think you can only do structural matches on array items in pact-jvm, rather than direct comparisons. I used this documentation as a guide when writing the `json -> PactDslJsonBody` converter: https://docs.pact.io/implementation_guides/jvm/consumer#building-json-bodies-with-pactdsljsonbody-dsl If you think you can figure out a way to do it, would be great to see!


dimundo
2021-07-06 19:04
ok, will check tomorrow :+1:

matt.fellows
2021-07-07 01:23
Dmitry - do you have a provider that always returs back a list of objects of different types/shapes?

matt.fellows
2021-07-07 01:24
The array contains matcher was created for the hypermedia use case, where it?s possible to get back links with different shapes and values, but where it?s really important for the consumer to be able to rely on a particular link to be there

matt.fellows
2021-07-07 01:24
it also works well when you essentially want to ?pluck? objects from a heterogenous set of objects in a list

matt.fellows
2021-07-07 01:25
Without the array contains matcher, if your consumer says it needs ?an array of <specific object/type>? but provider has `[<your type>, <some other type>, <your type>, "<another different type>]` it won?t work.

dimundo
2021-07-07 06:07
it is message with one of the fields as an array of strings

matt.fellows
2021-07-07 10:10
an array of strings should be supported, if : 1. The matcher accepts the format of each of the strings 2. It?s an exact match

matt.fellows
2021-07-07 10:11
can you share what your expectation looks like an the actual from the provider?

dimundo
2021-07-07 10:26
ah, forgot to mention - its a consumer part

dimundo
2021-07-07 10:37
@jackbwheatley looks like https://docs.pact.io/implementation_guides/jvm/consumer/#array-contains-matcher-v4-specification is not right thing - we wanted to feed `withContent` with real objects, not forged, to have most strict checks

jackbwheatley
2021-07-07 13:29
having a look at what we can do around arrays now

jackbwheatley
2021-07-07 15:12
@dimundo new version that should work with arrays coming shortly

jackbwheatley
2021-07-07 15:32
`v0.0.12` has hit maven now

dimundo
2021-07-09 18:58
Awesome, it works, thank you @jackbwheatley :taco:

dimundo
2021-07-15 11:26
@jackbwheatley is it correct one in ProviderInfoBuilder? > includeWipPactsSince: Option[FiniteDuration] = None, as it expects something like `7 days`, not `2021-06-12` from https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/

jackbwheatley
2021-07-15 11:29
The finite duration is time since the epoch, it gets converted to a date to pass to pact-jvm

dimundo
2021-07-15 11:35
so, if i need pacts 7 days old ? i?m not so good at scala as i wanted :(

jackbwheatley
2021-07-15 11:46
If you have some other way of creating a java date or instant, you should be able to convert that to seconds or millis, then convert that to a finite duration

jackbwheatley
2021-07-15 11:48
e.g. ```import scala.concurrent.duration._ val date: java.util.Date = ??? val instant: java.time.Instant = ??? date.getTime.millis : FiniteDuration instant.toEpochMillis.millis : FiniteDuration```

dimundo
2021-07-15 11:59
something like this ?

jackbwheatley
2021-07-15 12:02
that would work, but you can also do: ```import scala.concurrent.duration._ System.currentTimeMillis.millis - 7.days```

dimundo
2021-07-15 12:02
oh, nice

dimundo
2021-07-15 12:03
thank you :+1: @jackbwheatley :taco:

jackbwheatley
2021-07-15 12:04
np :simple_smile:

jackbwheatley
2021-07-15 12:06
it?ll be easier once I get around to adding a scaladoc for stuff like this :grin:

dimundo
2021-07-15 12:45
```Some(new FiniteDuration(System.currentTimeMillis() - 7.days.toMillis, MILLISECONDS))``` `.toMillis` was missing :slightly_smiling_face: ( just for the record, is someone will search this :slightly_smiling_face: )(

dimundo
2021-07-15 16:29
i have a feeling, that WIP doesnt work :disappointed:

dimundo
2021-07-15 16:33
if i define Provide like this

dimundo
2021-07-15 16:34
it verifies only `cit1` tagged versions

dimundo
2021-07-15 16:38
if i change to `selectors = ConsumerVersionSelector(None) :: Nil` aka no tags - each version is verified

dimundo
2021-07-15 16:39
but in such case, latest consumer version could be non compatible


dimundo
2021-07-15 16:52
cc @kflo maybe ?

kflo
2021-07-15 16:55
i always use consumer with latest tag (aka not providing any tags)

dimundo
2021-07-15 16:56
but what is latest ?

kflo
2021-07-15 16:56
actually it uses the branch tag for the consumer at latest

dimundo
2021-07-15 16:56
iirc, latest is latest published, not latest verified, no?

dimundo
2021-07-15 16:56
and if there is no matching branch ?


kflo
2021-07-15 16:57
if there is no matching branch, it will not find any pacts for that consumer

kflo
2021-07-15 16:57
but you should always be tagging your pacts


dimundo
2021-07-15 16:59
```Find all the pacts that are the latest for their tag (the "head" pacts). (eg. The latest pact for a version with tag main + the latest pact for a version with tag feat-x + the latest pact for a version with tag feat-y ...) Discard the pacts that have been explicitly selected in the consumerVersionSelectors. (eg. usually you'd configure the consumer version selectors with {"tag": "main", "latest": "true"}, so discard the latest main pact).``` so, this is exactly what should happen - all latest consumers , except `cit1` ?

kflo
2021-07-15 17:01
we don?t use WIP pacts in CI, only in CD. we found it too confusing to use in CI

dimundo
2021-07-15 17:02
can you explain ?

kflo
2021-07-15 17:04
i tagged you on another thread, but basically we ended up going with this workflow https://docs.pact.io/provider/recommended_configuration#verification-triggered-by-provider-change

kflo
2021-07-15 17:05
which seems like the default workflow most people will want


dimundo
2021-07-15 17:48
so, i will post kinda workflow in thread

dimundo
2021-07-15 17:50
CommonAPI provider having `wip` turned on, from own branch `feature/BK-335-pact-wip-debug` / version `a31ac102` verified earlier changed consumer pact tag `OPTO-58` / ver `5dd38d1c`

dimundo
2021-07-15 18:13
provider merged to master and changed to `eb30a482` / `master` , still consumer is ok

dimundo
2021-07-15 18:18
after deploy > Tagging CommonAPI version `eb30a482` as `cit1` so far so good

dimundo
2021-07-15 18:20
and i did that for wrong client :facepalm:

dimundo
2021-07-15 18:27
ah, but this is the catch

dimundo
2021-07-15 18:29
https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/ > Find all the pacts that are the latest for their tag (the ?head? pacts). so, if many consumers has same tag, only 1 consumer will be selected


dimundo
2021-07-15 18:30
so , latest tag `tag1` is only `consumerA` and `consumerB` is deselected from WIP pacts

dimundo
2021-07-15 18:31
@kflo, looks like it is solved :smile: but not sure, how to proceed

kflo
2021-07-15 18:39
> so, if many consumers has same tag, only 1 consumer will be selected it should be the latest version of each consumer pact with the tag is selected

kflo
2021-07-15 18:39
for example, all consumer pacts tagged `main` or `production`

kflo
2021-07-15 18:39
at their latest versions

dimundo
2021-07-15 18:40
aint latest tag is broker-wise?

dimundo
2021-07-15 18:40
what is latest `main` for you ?

kflo
2021-07-15 18:41
all the consumer pacts where the code has been merged to `main`

kflo
2021-07-15 18:41
it gets tagged with `main` by the CD system, which is triggered by code merging to `main`

dimundo
2021-07-15 18:41
but if you open pact broker and choose `Show latest tags`

dimundo
2021-07-15 18:42
how many tags `main` will be there ?

kflo
2021-07-15 18:42
one for each consumer, assuming the code was merged

kflo
2021-07-15 18:43
i don?t know where ?show latest tags? is

dimundo
2021-07-15 18:43
i see only each tag as unique

kflo
2021-07-15 18:43
the tag is unique, but it is applied to each consumer pact


dimundo
2021-07-15 18:44
there are many `tag: main` , weird

dimundo
2021-07-15 18:45
mine are unique :disappointed:

dimundo
2021-07-15 18:46
> *x-pact-broker-version:* 2.80.0

kflo
2021-07-15 18:48
how are you publishing your pacts?

kflo
2021-07-15 18:50
ok so you are tagging them on publish, that should work. we do the same (just through the SBT plugin right now)

dimundo
2021-07-15 18:51
thats from JS part, but this shouldn?t matter

dimundo
2021-07-15 20:05
so, for reproduction there is a need in more ~pervert~ situation due to having monorepo for consumer ? `consumerA`with changes in contract has `version1`and`tag1` and contract with `ProviderC` ? `consumerA`with changes in contract has `version1`and`tag1` and contract with `ProviderD` ? `consumerB`with changes in contract has `version1`and`tag1` and contract with `ProviderC` ? `consumerB`with changes in contract has `version1`and`tag1` and contract with `ProviderD` consumers are still in branch=tag= `tag1` and WIP tests against master with tag= `tag2` are skipping `consumerB` WIP verification

dimundo
2021-07-15 20:06
some mindblowing, but \_(?)_/

kflo
2021-07-15 21:55
hm, not sure i fully understand. we also are using a monorepo for all our services (consumers and providers). where are the WIP tests being run from? the main branch? remember that if a provider verifies a contract with the same content at any time, it will no longer be considered WIP

dimundo
2021-07-15 22:15
started with trunk of producers, but then all-in, as provider/provider tests not touched for some time

bheemreddy181
2021-07-17 04:03
has joined #pact-scala-itv


daniel.qu
2021-07-21 20:48
has joined #pact-scala-itv

kflo
2021-07-27 19:13
@jackbwheatley we are currently using `scala-pact` for HTTP pacts and `pact4s` for message pacts. they don?t seem to play well together right now, because `scala-pact` requires ?squashing? the HTTP pact files, but `pact4s` does not. I know that the latest version of `scala-pact` allows you to specify that you are using only `scala-pact` files or only `pact4s` files, but doesn?t seem to work for both. it would be most desirable if we could just run `pactPack` only for the `scala-pact` files and have it just ignore the pact-jvm ones? what is the recommendation? the only thing i can think of is putting the two into separate folders and moving them around before publishing, which is a bit of extra complexity i?d like to avoid

kflo
2021-07-27 19:13
we do plan to eventually switch to `pact4s` for everything

kflo
2021-07-27 19:15
i guess another solution is running just the `scala-pact` tests, then `pactPack`, and then running the message tests. that will require some extra configuration in the build to separate them though

kflo
2021-07-27 19:17
probably will have to do that for now

kflo
2021-07-28 16:38
actually it seems pretty trivial to switch over our request/response pacts to `pact4s`, so i?m going to suggest we just do that :slightly_smiling_face:

kflo
2021-08-05 19:13
hey @jackbwheatley @matt.fellows @bethskurrie i think `pact4s` is getting enough traction now that we should have a separate channel for it


kflo
2021-08-05 19:14
i would love if it was eventually part of pact-foundation, but we can discuss that later

kflo
2021-08-05 21:00
(i ask because it seems like i can only create private channels, which maybe i should do for now?)

matt.fellows
2021-08-05 22:05
Done!

kflo
2021-08-05 22:07
thanks @matt.fellows!

kflo
2021-08-05 22:07
good news, we now have a separate channel just for `pact4s`: #pact4s

alex.macpherson
2021-10-27 08:29
has joined #pact-scala-itv

alex.macpherson
2021-10-27 08:34
hi there. i've recently started seeing the scala pact library fail when trying to decode a pact from pactflow. it looks as though it gets to this point of the `PactImplicits.scalaPactDecoder`, but then fails with the below error ```_links <- cur.downField("_links").downField("curies").http://delete.as[Option[Links]]``` `DecodingFailure([A]Option[A], List(DownField(title), DownField(pb:consumer-versions), DeleteGoParent, DownField(curies), DownField(_links)))` which becomes `Could not read $dataType from json: $json` this started happening without any dependency changes, so i suspect something has changed in how pactflow sends its pacts as JSON. curiously, if i try to run the verification locally with the same pact JSON, it fails unless i delete one of the following from the `_links` section of the pact - if `curies` or `pb:consumer-versions` is removed, the pact succeeds. ```// MUST REMOVE "curies": [ { "name": "pb", "href": "https://<companyName>.http://pact.dius.com.au/doc/{rel}?context=pact", "templated": true } ], // OR REMOVE "pb:consumer-versions": [ { "title": "Consumer version", "name": "<version>", "href": "https://<companyName>.http://pact.dius.com.au/pacticipants/<service>/versions/<version>" } ],```

alex.macpherson
2021-10-27 08:35
i've seen this issue has been raised on GitHub which looks to be related: https://github.com/ITV/scala-pact/issues/231

alex.macpherson
2021-10-27 08:35
i've also tried bumping the scala-pact version to latest, but this was fruitless

alex.macpherson
2021-10-27 10:44

alex.macpherson
2021-10-27 16:02
just to follow on from the above, this has been fixed in `scala-pact:4.3.0` - thanks @jackbwheatley for getting this resolved so quickly!

martin.carlin
2021-11-19 15:57
has joined #pact-scala-itv

martin.carlin
2021-11-19 19:22
Hi Folks, I?m new to pact testing and I?m having the following issue, I would really appreciate any insights you have. Besides we have not included any changes on the pact tests recently, our CI pipe has started to fail, I leave some of the logs below.

martin.carlin
2021-11-19 19:23
`Error: Could not read scala-pact pact from json`

martin.carlin
2021-11-19 19:23
`Could not convert good response to Pact:`

martin.carlin
2021-11-19 19:24
[info] java.lang.Exception: Failed to load consumer pact from: ***/pacts/provider/project/consumer/offer/pact-version/5d521cb94a9ce7a42c96067b52cf5ddaeff02368/metadata/c1tdW3RdPW1hc3RlciZzW11bbF09dHJ1ZSZzW11bY3ZdPTEyMDgmc1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT0xMTcyJnNbXVt0XT10ZXN0aW5nJnNbXVtsXT10cnVlJnNbXVtjdl09MTIwOA [info] at com.itv.scalapactcore.common.PactBrokerClient.$anonfun$fetchAndReadPact$4(PactBrokerClient.scala:182) [info] at scala.Option.map(Option.scala:230) [info] at com.itv.scalapactcore.common.PactBrokerClient.fetchAndReadPact(PactBrokerClient.scala:176) [info] at com.itv.scalapactcore.common.PactBrokerClient.$anonfun$fetchPactsFromPactsForVerification$6(PactBrokerClient.scala:61) [info] at scala.Option.map(Option.scala:230) [info] at com.itv.scalapactcore.common.PactBrokerClient.$anonfun$fetchPactsFromPactsForVerification$5(PactBrokerClient.scala:58) [info] at scala.collection.immutable.List.flatMap(List.scala:366) [info] at com.itv.scalapactcore.common.PactBrokerClient.$anonfun$fetchPactsFromPactsForVerification$4(PactBrokerClient.scala:56) [info] at scala.Option.map(Option.scala:230) [info] at

martin.carlin
2021-11-19 19:24
I?ve verified and the mentioned pact file exists and should be found

kyle.florence
2021-11-30 04:20
has joined #pact-scala-itv

dougie.robertson
2022-02-02 11:16
has joined #pact-scala-itv

yousafn
2022-04-29 14:38
has joined #pact-scala-itv

orbit
2022-05-09 18:02
has joined #pact-scala-itv

tjones
2022-05-16 08:48
@tjones has left the channel

slacksync
2022-06-08 17:21
has joined #pact-scala-itv

duynguyenptithcm
2022-08-20 07:25
has joined #pact-scala-itv

xuw
2022-10-28 15:01
has joined #pact-scala-itv

xuw
2022-11-02 19:54
Been trying to figure out the right matching rule for this sitaution. Below is the body ```{ "ok" : true, "systems" : { "GooglePubSub" : { "ok" : "true" }, "Database" : { "ok" : "true" }, "GoogleGroups" : { "ok" : "true" }, "GoogleIam" : { "ok" : "true" }, "OpenDJ" : { "ok" : "true" } } }``` I would want to make sure that each system name (?GooglePubSub? etc) is a string. I know that you can do a matching rule on the ok type, but not really sure how to check the field name

xuw
2022-11-02 19:58
In the case that I can?t check the field name, is there a trick to get a similar effect?

matt.fellows
2022-11-03 01:55
It would probably be a method named something like ?each key like? I think https://docs.pact.io/implementation_guides/jvm/consumer#matching-any-key-in-a-map is what you want. My understanding is that these matchers are exposed to the scale interface yeah?

matt.fellows
2022-11-03 01:55
oh, no

matt.fellows
2022-11-03 01:55
I don?t know if scale ITV does. `pact4s` I think would

matt.fellows
2022-11-03 01:56
If you know the keys in advance, you don?t need to check the types, you can just check that they exist and their values are correct. But I suspect you know this, and that there could be many keys

matt.fellows
2022-11-03 01:57
You could potentially deal with this using Provider states (given that GooglePubSub, Database? exist)

orbit
2022-12-01 15:45
has joined #pact-scala-itv

vejeta
2022-12-18 02:29
has joined #pact-scala-itv

clm.whyte
2023-05-18 09:49
has joined #pact-scala-itv

joshua.ellis
2023-09-20 06:40
has joined #pact-scala-itv