matt.fellows
2021-08-05 22:05
has joined #pact4s

kflo
2021-08-05 22:06
has joined #pact4s

kyle.florence
2021-08-05 22:06
has joined #pact4s

jackbwheatley
2021-08-05 22:06
has joined #pact4s

dimundo
2021-08-05 22:06
has joined #pact4s

varnit.garg2424
2021-08-05 22:06
has joined #pact4s

caoilte
2021-08-06 07:50
has joined #pact4s

scott.riley111
2021-08-06 08:58
has joined #pact4s

varnit.garg2424
2021-08-06 14:35
Hey guys, Kudos to the team for such a great initiative :slightly_smiling_face: I have a question about `MockProviderServer` Taking the reference from https://github.com/jbwheatley/pact4s/blob/main/scalatest-pact/src/test/scala/pact4s/scalatest/MessagePactVerifierScalaTestSuite.scala#L6, I've added pact4s-scalatest dependency. However, I'm unable to import *pact4s.MockProviderServer* (looks like it doesn't exist or Am I missing something?)

dimundo
2021-08-06 14:48
you probably not need that `MockProviderServer` is in *pact4s repo to run mocked server, you must have own*


tjones
2021-08-07 13:56
has joined #pact4s

kyle.florence
2021-08-09 16:43
if you need to message me you can message this account, the other one is a duplicate. i will try to close the other one at some point

jackbwheatley
2021-08-09 17:07
Yeah, Dmitry is quite right. You should make a mocked version of your own http server supplied with mock dependencies, that pact4s will use to run the requests from the pacts against. If you need to initialise state during any of your pact tests, you can add a route for setting up and tearing down state, which you supply the endpoint of to your pact4s setup. In the MockProviderServer that we are using for pact4s' internal tests, that route is called /`setup` :slightly_smiling_face:

jonas.natten
2021-08-11 05:02
has joined #pact4s

dimundo
2021-08-11 19:29
hi! i have a quesstion about WIP pacts i?m using ? [info] welcome to sbt 1.5.2 (Alpine Java 15.0.3) ? val pact4s = ?io.github.jbwheatley? %% ?pact4s-scalatest? % ?0.0.15? ? val pact4sCirce = ?io.github.jbwheatley? %% ?pact4s-circe? % ?0.0.15" ? *x-pact-broker-version:* 2.81.0 i?ve set ``` override def provider: ProviderInfoBuilder = { ProviderInfoBuilder( name = name, pactSource = PactBrokerWithSelectors( brokerUrl = brokerUrl, auth = Some(BasicAuth(brokeUser, brokerPass)), enablePending = true, includeWipPactsSince = Some(System.currentTimeMillis().millis - 7.days), providerTags = List(providerTagFromBranch), selectors = consumerList ) ).withPort(8080)``` looks like everything needed from https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/ but in broker logs i have only ```2021-08-11 19:13:12.679944 I [8:puma threadpool 005] pact-broker -- Creating verification 7343 for pact_id=4387 -- {"providerApplicationVersion"=>"420a9da1", "success"=>true, "verifiedBy"=>{"implementation"=>"Pact-JVM", "version"=>"4.2.7"}, "wip"=>false}``` note - ?false? am i missing something for using WIPs ?

kyle.florence
2021-08-11 20:29
that should be it from the `pact4s` side

kyle.florence
2021-08-11 20:29
i?m assuming `Some(System.currentTimeMillis().millis - 7.days)` returns a finite duration

kyle.florence
2021-08-11 20:29
it will pick up non WIP pacts as well though, maybe that?s the case for that pact


dimundo
2021-08-11 20:36
so i hope, this must pick up to 7 days old all non-verified pacts

kyle.florence
2021-08-11 20:36
it should

dimundo
2021-08-11 20:56
did you had a chance to use WIP ?

kyle.florence
2021-08-11 20:56
we use it here yeah

kyle.florence
2021-08-11 20:57
has been working fine for us

dimundo
2021-08-11 20:57
is there something must be set from consumer side ? ( iirc not, but just in case )

dimundo
2021-08-11 20:59
what is your setting in includeWipPactsSince ?

kyle.florence
2021-08-11 21:01
we use a 30 day window

kyle.florence
2021-08-11 21:01
but really it could probably be longer, like a year

kyle.florence
2021-08-11 21:01
depends mostly on when you started using pact vs when you started using WIP


dimundo
2021-08-11 21:02
do you set that differently ?

kyle.florence
2021-08-11 21:02
that field expects a `FiniteDuration` type

kyle.florence
2021-08-11 21:02
ours is read from configuration

kyle.florence
2021-08-11 21:02
`Some(Duration.fromNanos(config.getDuration(PactConfigKeys.pactFeaturesWorkInProgressPactsSince).toNanos))`

dimundo
2021-08-11 21:03
and `pactFeaturesWorkInProgressPactsSince` is ?

kyle.florence
2021-08-11 21:03
?30d?

dimundo
2021-08-11 21:05
and what `config.getDuration(PactConfigKeys.pactFeaturesWorkInProgressPactsSince)` returns ?

kyle.florence
2021-08-11 21:05
a java Duration of 30 days


dimundo
2021-08-11 21:09
to nanos

kyle.florence
2021-08-11 21:09
yeah, that?s just for creating a scala Duration from nonoseconds

kyle.florence
2021-08-11 21:09
maybe you should try creating a duration for ?7 days? instead of involving the system current time

dimundo
2021-08-11 21:09
> includeWipPactsSince.foreach(since => options.put(?includeWipPactsSince?, new Date(since.toMillis)))

dimundo
2021-08-11 21:09
toMillis

kyle.florence
2021-08-11 21:10
yes, that?s what the underlying pact-jvm library needs, but that shouldn?t concern you

dimundo
2021-08-11 21:10
i have a feeling you made it 1k times longer

kyle.florence
2021-08-11 21:10
:stuck_out_tongue:

kyle.florence
2021-08-11 21:10
mine is only for constructing a duration

kyle.florence
2021-08-11 21:11
it?s the same amount of time in the pact4s library, just a different unit

dimundo
2021-08-11 21:15
> 1628111689346 milliseconds

dimundo
2021-08-11 21:16
> maybe you should try creating a duration for ?7 days? instead of involving the system current time will try

dimundo
2021-08-11 21:17
as those `1628111689346` are 18K days :smile:

kyle.florence
2021-08-11 21:18
probably it?s subtracting 7 from current millis (since epoch)

kyle.florence
2021-08-11 21:18
haha

dimundo
2021-08-11 21:20
and goes loco

dimundo
2021-08-11 21:21
wondering aint it even wants `-7 days`

dimundo
2021-08-11 21:21
but if 30 days are ok ¯\_(?)_/¯

kyle.florence
2021-08-11 21:22
a duration is a time period, so ?7 days? instead of ?7 days ago?

dimundo
2021-08-11 21:27
word `since` in `includeWipPactsSince` is pointing to something more different

dimundo
2021-08-11 21:29
one more thing also bothers me https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/#how-is-wip-pacts-different-from-the-webhook-triggered-verifications ```The WIP pacts feature ensures that the changed pact is automatically verified each time the provider's release pipeline runs, even if it is not one of the pacts explicitly configured for verification.```

kyle.florence
2021-08-11 21:29
well ultimately at the API layer it is a date

dimundo
2021-08-11 21:30
> provider?s release pipeline is it meant CI as such?

kyle.florence
2021-08-11 21:30
yeah, ?deployment pipeline?

kyle.florence
2021-08-11 21:30
best practice is to not enable WIP in CI

dimundo
2021-08-11 21:31
hmm, why ?

kyle.florence
2021-08-11 21:32
there?s not really a benefit to it, and it can also cause problems

kyle.florence
2021-08-11 21:32
i would have to look back at that long thread to find details

dimundo
2021-08-11 21:33
problem is - if pact changed in branch , c-i-d will say `no` , and provider?s trunk doesnt know anything about that consumer?s branch

dimundo
2021-08-11 21:33
even if it is compatible with that

dimundo
2021-08-11 21:34
so exact WIP case

kyle.florence
2021-08-11 21:34
that?s where matching branches or configuration comes in

kyle.florence
2021-08-11 21:35
the provider needs to ?opt-in? to the new pact somehow

dimundo
2021-08-11 21:36
but if provider did his job long time ago ¯\_(?)_/¯

dimundo
2021-08-11 21:36
create dummy prov branch just for verification ? kinda overkill

kyle.florence
2021-08-11 21:36
well if WIP is enabled for CD, every provider build that merges to the main branch would pick up the WIP pacts and verify them

dimundo
2021-08-11 21:37
``` only: - master``` could help a bit

kyle.florence
2021-08-11 21:37
the general pattern is: consumer creates pact, provider verifies it, provider deploys, consumer deploys

kyle.florence
2021-08-11 21:37
sounds like you are talking about a different pattern

dimundo
2021-08-11 21:37
yeah, in perfect world

dimundo
2021-08-11 21:38
some part of consumer were done, or not all parts of consumer were pact-ified

kyle.florence
2021-08-11 21:38
if you are creating a consumer pact for something the provider already supports, you will have to run the provider build against master and have it pick up the consumer pact, either via WIP or via configuration

dimundo
2021-08-11 21:39
so - wip, or manually adding consumer tag to selectors

kyle.florence
2021-08-11 21:39
yep, that?s what we do

kyle.florence
2021-08-11 21:39
you can also use matching branches

kyle.florence
2021-08-11 21:39
(for the CI part)

dimundo
2021-08-11 21:40
tried webhooks, but for 2 monorepos it makes _*a lot*_ noise in ci

kyle.florence
2021-08-11 21:40
i haven?t done any webhooks yet

kyle.florence
2021-08-11 21:40
2 monorepos? stereorepo

dimundo
2021-08-11 21:40
more like chameleon

kyle.florence
2021-08-11 21:40
lol

dimundo
2021-08-11 21:40
2, but not stereo


kyle.florence
2021-08-11 21:41
> I figure, if you?re on a branch, you?re either making a change unrelated to pact (so you don?t care about WIP pacts) or you?re trying to make a particular pact pass, so you can explicitly select that one.

dimundo
2021-08-11 21:42
> so you can explicitly select that one. > thats a sad manual job :disappointed:

kyle.florence
2021-08-11 21:42
that?s why we don?t use WIP in CI

kyle.florence
2021-08-11 21:42
well you can also do the matching branches, if you don?t want to update configuration

kyle.florence
2021-08-11 21:42
you could also turn off WIP everywhere and always use configuration

dimundo
2021-08-11 21:43
thing is WIP is not turned on :D

kyle.florence
2021-08-11 21:43
we have done it both ways

dimundo
2021-08-11 21:45
i have a feeling, that i miss something small

dimundo
2021-08-11 22:20
what is in your ```selectors = consumerList``` ?

kyle.florence
2021-08-11 22:20
by default, just the ?stable? tags: `master`, `testing`, `production`

dimundo
2021-08-11 22:21
```val consumerList = List( ConsumerVersionSelector(tag = Some( providerTagFromBranch)), ConsumerVersionSelector(tag = Some("testEnv")) )```

dimundo
2021-08-11 22:21
why there is no provider tag for matching branches ?

kyle.florence
2021-08-11 22:43
oh yeah, and the git branch tag

kyle.florence
2021-08-11 22:43
forgot that one

dimundo
2021-08-12 11:37
https://github.com/pact-foundation/pact-jvm/issues/1407 should something like this created for pact4s or it will appear automagically ?

dimundo
2021-08-12 14:20
hi! back to WIP question i?ve added WIP to js project and it works, I?m still concerning about `includeWipPactsSince` non of them trigger WIP checks ```includeWipPactsSince = Option.when(isCI)(System.currentTimeMillis().millis - 7.days),``` ```includeWipPactsSince = Option.when(isCI)(7.days),``` still in JS ``` includeWipPactsSince: isCI ? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split("T")[0] : undefined,``` which results in `includeWipPactsSince:"2021-08-05"` which complies with https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/ ```You should enable the work in progress pacts feature by setting includeWipPactsSince (or equivalent for your language) in the provider verification configuration to the date from which you want the changed pacts to start being included (eg. `2021-06-12` ) ``` and broker logs WIP checks straight away

dimundo
2021-08-12 14:24
```final class FiniteDuration(val length: Long, val unit: TimeUnit) extends Duration { ... "Duration is limited to +-(2^63-1)ns (ca. 292 years)")```

dimundo
2021-08-12 14:24
`+-` ?

dimundo
2021-08-12 14:25
can anyone make an example, how this must look for WIP for 7 days old pacts?

kyle.florence
2021-08-12 14:40
We will need to update pact4s

dimundo
2021-08-12 15:29
hi! can you share output of this ? ```Some(Duration.fromNanos(config.getDuration(PactConfigKeys.pactFeaturesWorkInProgressPactsSince).toNanos))```

dimundo
2021-08-12 15:30
from run, that initiated wip pact checks

kyle.florence
2021-08-12 15:52
not at the moment

kyle.florence
2021-08-12 15:52
i will create a ticket to track

jackbwheatley
2021-08-12 16:00
I think pact-jvm just expects us to pass it a string, but we are passing it a Date

jackbwheatley
2021-08-12 16:00
so I?ll try to fix that


kyle.florence
2021-08-12 16:14
why doesn?t that throw an error -_-

kyle.florence
2021-08-12 16:15
i guess it just ignores the option?

jackbwheatley
2021-08-12 16:15
it is working with your stuff though?

kyle.florence
2021-08-12 16:15
i?m not sure, we are in the middle of transitioning from scala-pact to pact4s

kyle.florence
2021-08-12 16:15
so maybe it?s broken now

jackbwheatley
2021-08-12 16:15
:sweat_smile:


kyle.florence
2021-08-12 16:15
looks like it wants a String though

jackbwheatley
2021-08-12 16:15
yep

kyle.florence
2021-08-12 16:16
probably should just use the `FiniteDuration` to get a date in the past, and convert it to a string in the format it wants

jackbwheatley
2021-08-12 16:16
that?s what I?m gonna do :simple_smile:

kyle.florence
2021-08-12 16:16
sorry @dimundo i am doing too many things right now

kyle.florence
2021-08-12 16:17
(we also have some teams that use configuration only, so WIP doesn?t impact them)

jackbwheatley
2021-08-12 16:31
@dimundo v0.0.16 is in the pipeline with a (hopeful) fix, can you give it a go when you get a chance and report back? You shouldn?t have to change anything about your set-up

jackbwheatley
2021-08-12 16:31
may be 10-15 mins until it hits maven

jackbwheatley
2021-08-12 16:34
slight hiccup, bear with

kyle.florence
2021-08-12 16:36
good ol scaladocs

kyle.florence
2021-08-12 16:36
once we have CI checks we should stick a `compile:doc` in there

jackbwheatley
2021-08-12 16:38
yes I?ve just discovered you can only link to things in your own project

jackbwheatley
2021-08-12 16:38
i?ll add it to the commitCheck command at the very least for now

kyle.florence
2021-08-12 16:38
by default yeah. it?s super annoying

jackbwheatley
2021-08-12 16:38
can it be turned on?


kyle.florence
2021-08-12 16:38
but it?s still not perfect

jackbwheatley
2021-08-12 16:39
ah nice, thanks

jackbwheatley
2021-08-12 16:39
I?ll take a look at that


jackbwheatley
2021-08-12 16:43
right, lets try this again

dimundo
2021-08-12 18:45
so, can i try 0.0.16 ?

jackbwheatley
2021-08-12 18:45
Yeah, give it a go

dimundo
2021-08-12 18:58
looks like it works, but a bit strange :slightly_smiling_face:

dimundo
2021-08-12 18:58
> 2021-08-12 21:55:24 2021-08-12 18:55:24.669112 D [8:puma threadpool 001] [wip] pact-broker -- Potential WIP pacts for provider tag(s) feature/B-335-WIP-3 created after 1970-01-08T01:00:00+01:00 by latest_by_consumer_branch (none)

dimundo
2021-08-12 18:59
epoch start looks scary :slightly_smiling_face:

dimundo
2021-08-12 18:59
for > includeWipPactsSince = Option.when(isCI)(7.days),

dimundo
2021-08-12 19:00
ah, so

dimundo
2021-08-12 19:00
1970-01-08 actually is 1970-01-01 + 7 days :slightly_smiling_face:

kyle.florence
2021-08-12 19:00
lol

kyle.florence
2021-08-12 19:01
date/times are hard

dimundo
2021-08-12 19:01
this is fine

jackbwheatley
2021-08-12 19:01
Yep, includeWipPactsSince is still time since epoch

jackbwheatley
2021-08-12 19:01
So your original impl will work

dimundo
2021-08-12 19:02
today- 7 days, right

jackbwheatley
2021-08-12 19:02
Yup

dimundo
2021-08-12 19:02
need a docs for foot shooters :)

dimundo
2021-08-12 19:02
:taco: @kflo

kyle.florence
2021-08-12 19:02
i still think it makes more sense intuitively for it to be a ?since? because it takes a finite duration

dimundo
2021-08-12 19:03
:taco: @jackbwheatley

kyle.florence
2021-08-12 19:03
or just a date string i guess

dimundo
2021-08-12 19:03
:taco: @bethskurrie for a WIP as such :slightly_smiling_face:

dimundo
2021-08-12 19:03
date as string also is hard

dimundo
2021-08-12 19:03
doing all that woodo

kyle.florence
2021-08-12 19:03
or maybe we can even bury it under just ?enableWip? and obfuscate away the since date for most cases

dimundo
2021-08-12 19:04
but you have 30 days

dimundo
2021-08-12 19:04
i have 7 days

jackbwheatley
2021-08-12 19:04
I'm forcing some cats-effect-ness by having it be FiniteDuration, thats what they use for their Clock impl

dimundo
2021-08-12 19:04
someone will have 1 day


jackbwheatley
2021-08-12 19:04
We should add some overloads so dates can be provided instead

kyle.florence
2021-08-12 19:04
i think my impl now would be ?30 days from epoch?


dimundo
2021-08-12 19:05
maybe lets do as in docs ?

kyle.florence
2021-08-12 19:05
so effectively like 50 years

kyle.florence
2021-08-12 19:05
lol

kyle.florence
2021-08-12 19:05
yes the API itself wants a date string

kyle.florence
2021-08-12 19:05
i guess the question is what is the most common use case

kyle.florence
2021-08-12 19:05
do people want a floating range? or a hard-coded one?

kyle.florence
2021-08-12 19:06
?everything in the past year? vs ?everything since 2020-01-01"

dimundo
2021-08-12 19:06
if you want to skip own docs wrighting - implement same as in docs

jackbwheatley
2021-08-12 19:06
But we have the benefit of strong typing, so it makes sense to provide an actual date for correctness, rather than a string that can easily be wrong

dimundo
2021-08-12 19:06
> includeWipPactsSince:?2021-08-05?

kyle.florence
2021-08-12 19:06
perhaps we should use `LocalDate` then

kyle.florence
2021-08-12 19:07
duration implies to me a time period

kyle.florence
2021-08-12 19:07
maybe we can support both

kyle.florence
2021-08-12 19:08
alright i gotta run and get some food

kyle.florence
2021-08-12 19:08
that one taco wasn?t enough

jackbwheatley
2021-08-12 19:10
Yeah, probably make the default LocalDate then add some overloads

dimundo
2021-08-17 09:09
long time no see posts about WIP :smile: > Verifying a pact between Client (a81e995f) and API [PENDING] > 1) The pact at ? is being verified because it is a ?work in progress? pact (ie. it is the pact for the latest version of Client tagged with ?B-510? and is still in pending state). Read more at https://docs.pact.io/go/wip > 2) This pact is in pending state for this version of API because a successful verification result for a version of API with tag ?fix/typo-fix? has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at https://docs.pact.io/go/pending > Verification Failed - No annotated methods were found for interaction ?b.State?. You need to provide a method annotated with @PactVerifyProvider(?b.State?) on the classpath that returns the message contents. > [info] - Verify pacts for provider `API` *** FAILED *** what is wrong here ? `If this verification fails, it will not cause the overall build to fail.` -> FAIL :disappointed:

dimundo
2021-08-17 09:40
so it was working properly, until some contract were added to the existing pact

dimundo
2021-08-17 15:18
one more finding > * @param includeWipPactsSince is a [[scala.concurrent.duration.FiniteDuration]], and represents the duration since the EPOCH. Should not be set if [[enablePending]] is set to false. > * @see also https://github.com/pact-foundation/pact_broker/issues/338 which is a bit strange. if i don?t want pending pacts, but want WIP? ( issue doesn?t made it clearer )


dimundo
2021-08-17 19:23
any ideas https://pact-foundation.slack.com/archives/C02ACMH759Q/p1629191351053300 ? or poking in #pact-jvm is right choice ?

kyle.florence
2021-08-17 19:24
what is the problem?

kyle.florence
2021-08-17 19:26
maybe you are running into this issue? https://github.com/pact-foundation/pact-jvm/issues/1260

kyle.florence
2021-08-17 19:27
we will probably want some support for that in `pact4s` as well, but we don?t have it yet

dimundo
2021-08-17 19:27
nope, not using states

kyle.florence
2021-08-17 19:27
it is in the error message above

kyle.florence
2021-08-17 19:27
> Verification Failed - No annotated methods were found for interaction ?b.State?. You need to provide a method annotated with @PactVerifyProvider(?b.State?) on the classpath that returns the message contents.

dimundo
2021-08-17 19:29
? consumer adds one message contract to pact in branch ? provider (not knowing about it) runs test against test env tag + wip enabled expected ? verification passes, disregarding that wip part fails observed ? verification fails as wip part fails

kyle.florence
2021-08-17 19:30
and pending pacts enabled?

kyle.florence
2021-08-17 19:31
pending pacts is the part that makes the build not fail

dimundo
2021-08-17 19:32
wip doesnt work w/o pending, as we know ;) and as wip branch is taken for verification - everything is correct in setup

dimundo
2021-08-17 19:33
pending off makes build green, but doesnt check wip branch ( which is sad, but expected )

kyle.florence
2021-08-17 19:33
can you post a different error message then? because the one above is about state

dimundo
2021-08-17 19:33
`b.state` is just message naming - > interaction ?b.State?.

kyle.florence
2021-08-17 19:33
and it is known that missing state will fail the build, even for wip + pending

kyle.florence
2021-08-17 19:34
ok, so it?s trying to verify a message that doesn?t exist?


kyle.florence
2021-08-17 19:35
that might be another case where it will fail the build

dimundo
2021-08-17 19:35
ah, correct, new message, not field

dimundo
2021-08-17 19:35
> that might be another case where it will fail the build why ? :scream_cat:

kyle.florence
2021-08-17 19:35
that question would best be asked for #pact-jvm first

dimundo
2021-08-17 19:36
`If this verification fails, it will not cause the overall build to fail.` - it?s a lie then ?

kyle.florence
2021-08-17 19:36
seems like potentially a bug

kyle.florence
2021-08-17 19:36
well, that message is from the broker

kyle.florence
2021-08-17 19:36
not the implementation

dimundo
2021-08-17 19:39
lets wait for the answer ¯\_(?)_/¯

matt.fellows
2021-08-23 00:11
Hey folks :wave: In the next Pactflow POST, I?d like to make a call out to all of the amazing work happening across languages to get alignment to the v3 specification. `pact4s` is one of those, and all ya?ll (am saying that right?) are amazing.

matt.fellows
2021-08-23 00:12
The idea is to build awareness of the work, drum up some extra feedback and community adoption, which ultimately will move us all forward.

matt.fellows
2021-08-23 00:12
Are you OK with us adding it into our newsletter, and if there is any particular feedback you?d like to get, please let me know (e.g. a short sentence to include in the post)

tjones
2021-08-23 11:31
Also, I've created #libpact_ffi-users - since there's quite a bit of discussion about the rust pact ffi bindings in the different language channels, but the discussions cover quite a bit of the same ground. Please join if this is useful or of interest to you!

kyle.florence
2021-08-23 13:28
Sounds good to me. I think the library is at the point where most of the core features are now implemented.

jackbwheatley
2021-08-23 14:41
@matt.fellows, yes very happy to be mentioned in the newsletter :grin: The more members of the Scala community we can get picking up pact4s the better, especially as we?re all still learning Pact best-practices as we go along!

matt.fellows
2021-08-23 23:01
awesomte

matt.fellows
2021-08-23 23:02
anything in particular you?d like us to focus on?

matt.fellows
2021-08-23 23:02
I?ll probably just drive people to this channel and to wave at you folks

kyle.florence
2021-08-23 23:56
maybe which testing framework they use?

kyle.florence
2021-08-23 23:56
i think the only major one we don?t currently support is `specs2`

matt.fellows
2021-08-31 10:43
@abhi.nandan964 :wave:

abhi.nandan964
2021-08-31 10:43
has joined #pact4s

caoilte
2021-09-06 13:17
Am I right in thinking that pac4s doesn't yet support the pact pending feature? I've just been testing some scenarios and I can get the broker to flip between a true and false pending flag for a contract, but it always fails the provider scalatest build.


caoilte
2021-09-06 16:58
awesome. should have checked that!

kyle.florence
2021-09-06 21:29
I will try to get that merged soon

kyle.florence
2021-09-06 21:29
I've been on vacation for a bit

caoilte
2021-09-06 21:48
Any opinion on showing the messages returned by the broker with each pact in the new API? (genuinely not sure if they will help.)

kyle.florence
2021-09-06 21:49
Which new API?

caoilte
2021-09-06 21:57
apols. not that new. the "for-verification" API which returns "notices" with the verificationProperties

kyle.florence
2021-09-07 03:06
Hm, I think the messages shown now are returned from the broker. So that logic is probably in pact jvm

kyle.florence
2021-09-11 22:46
this PR should be ready now. @jackbwheatley FYI

bethskurrie
2021-09-15 00:27
has joined #pact4s

jackbwheatley
2021-09-15 17:28
Should be fixed in v0.0.18 :grin: thanks for your help @kyle.florence



kyle.florence
2021-09-15 18:11
just didn?t draft a release for it in github


dimundo
2021-09-15 18:14
:taco: @jackbwheatley

dimundo
2021-09-15 18:14
:taco: @kflo

kyle.florence
2021-09-15 18:14
i?m hungry can i have another

dimundo
2021-09-15 18:15
:taco: @kyle.florence @kflo

kyle.florence
2021-09-15 18:15
:relieved:

dimundo
2021-09-15 18:15
hmm, slack founds two of you with same username

kyle.florence
2021-09-15 18:15
:laughing:

kyle.florence
2021-09-15 18:15
i am slowly taking over the world

dimundo
2021-09-15 18:15
2xLOC incoming!

kyle.florence
2021-09-15 18:22
i can?t seem to login to that account anymore lol

dimundo
2021-09-15 18:39
deprecation looks funny ```method apply in object PactBrokerWithSelectors is deprecated (since 0.0.17): Use the other apply method with the safer builder patterns pactSource = PactBrokerWithSelectors(```

dimundo
2021-09-15 18:39
and this is it :slightly_smiling_face:

kyle.florence
2021-09-15 18:40
what?s funny about it?

kyle.florence
2021-09-15 18:40
it?s trying to protect you from yourself

dimundo
2021-09-15 18:40
cut in the middle

dimundo
2021-09-15 18:42
could it be just start of stacktrace?

kyle.florence
2021-09-15 18:42
it?s just showing you the line that caused the deprecation warning

dimundo
2021-09-15 18:43
ah, looks like that but looks weird

dimundo
2021-09-15 19:37
``` .withPendingPactsEnabled(ProviderTags.one(providerTagFromBranch)) .withWipPactsSince(LocalDate.now().minusDays(7), ProviderTags.one(providerTagFromBranch))``` do i need both ?

dimundo
2021-09-15 19:38
> ProviderTags.one(providerTagFromBranch) looks like duplication here

jackbwheatley
2021-09-15 19:38
you can just use `withWipPactsSince`

dimundo
2021-09-15 19:41
that was my thought :+1: nice

jackbwheatley
2021-09-29 14:44
Hello all, interested in people?s thoughts on this https://github.com/jbwheatley/pact4s/pull/82

dimundo
2021-11-01 13:21
hi! i need to create provider test for some unique value in request resulting pact looks like this ``` "body": { "tableId": "table1", "signalId": "ddd" }, "matchingRules": { "$.body.signalId": { "match": "type" } } },``` thing is `signalId` is generated to be unique and cant be pre-configured for the provider test. so provider tests fails with 404 as trying to make request with `ddd` which isnt there there are some workarounds as request filters, but they are for headers as I understood any ideas ?

dimundo
2021-11-01 13:22
pact is created in js and looks like this ``` it("should POST to resolve signal ", async() => { const path = POST_SIGNAL_RESOLVE_URL await provider.addInteraction({ state: "2. i will resolve signal", uponReceiving: "a request to resolve signal", withRequest: { method: "POST", path, headers: { "Content-Type": "application/json" }, body: { ...tableIdBody, signalId: string("ddd") }, }, willRespondWith: { status: 200 }, }) const res = await makePostRequest(provider.mockService.baseUrl + path, { ...tableIdBody, signalId: "signalguid" }) expect(res.status).toBe(200) expect(res.ok).toBeTruthy() await provider.verify() })```

kyle.florence
2021-11-02 01:07
Maybe you want provider state dependency?

dimundo
2021-11-02 06:26
how does it looks like ?

kyle.florence
2021-11-02 14:36
There is info in the project readme

dimundo
2021-11-02 14:38
Request Filtering? this is about headers only

dimundo
2021-11-02 14:38
ah `provider state` will check

dimundo
2021-11-02 14:41
wow, looks easy , will check :+1:

dimundo
2021-11-08 15:03
hi! are there any examples around json schema validation ?

gjourdanweil
2021-11-28 20:09
has joined #pact4s

varnit.garg2424
2021-12-03 17:49
`sbt pactPack` -> Would this command work in case of pact4s to generate the pact file?

gjourdanweil
2021-12-03 18:52
pactPack is for merging pact files, not generating them. With pact4s, I think there's no need to merge pact files but I might be wrong.

kyle.florence
2021-12-05 23:04
Correct, there is no merging

kyle.florence
2021-12-05 23:04
That was a scala pact only feature

kyle.florence
2021-12-05 23:04
All pacts belonging to a consumer/provider pair will end up in a single pact file in pact4s

kyle.florence
2021-12-05 23:05
(the pact files themselves are generated when you run the pact tests)

gjourdanweil
2021-12-06 18:41
Do you know if we can have multiple tests (as in multiple classes) declaring a pact between the same consumer and provider (on the consumer side) though?

gjourdanweil
2021-12-06 18:42
I could test it.. just being lazy here :innocent:

kyle.florence
2021-12-06 18:42
my guess is that would not work well, because each test suite would be trying to write to the same file

tjones
2021-12-15 04:51
I don't know what writes the pact files in pact4s, but the Ruby and the Rust core engines both support merging the pacts at write time

tjones
2021-12-15 04:51
You have to clear them out before the tests, though (otherwise removed interactions persist)

kyle.florence
2021-12-15 05:20
pact-jvm does it

kyle.florence
2021-12-15 05:21
I think it also supports merging, not sure about for concurrent tests

martin.carlin
2022-04-19 15:06
has joined #pact4s

martin.carlin
2022-04-19 16:11
Hi there! I?ve written an HTTP request/response consumer and provider that passes successfully in my local environment. Now I?m trying to figure out why the consumer doesn?t seem to be creating the pact file during CI build. I was wondering if it has to do with the fact that I?m pushing both consumer and providers under the same branch. Anyone has experienced something similar? Let me know if there is any useful context I can provide since this could actually be so many things I wouldn?t know what to show exactly. But for starters I?m getting this message. ```Specified pact file 'target/pacts' does not exist. This sometimes indicates one of the arguments has been specified with the wrong name and has been incorrectly identified as a file path.[Container] 2022/04/19 15:44:20 Command did not exit successfully pact-broker publish "target/pacts" \ --broker-base-url="$PACT_BROKER_URL" \ --broker-token="$PACT_BROKER_TOKEN" \ --consumer-app-version="$BUILD_VERSION" \ --tag="$BRANCH_NAME" exit status 1```

gdfesta
2022-04-19 21:35
has joined #pact4s

jackbwheatley
2022-04-21 09:39
hi Martin. Are you able to confirm that the pact files are not being written to any directory during CI? It may just be that `target/pacts` is not pointing the brokerCLI to where the files are being written - `./target/pacts` or `yourModule/target/pacts` maybe?

yousafn
2022-04-29 14:38
has joined #pact4s

rholshausen
2022-05-09 00:25
has joined #pact4s

heytaco
2022-05-09 18:02
has joined #pact4s

orbit
2022-05-09 18:02
has joined #pact4s

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

slacksync
2022-06-08 17:22
has joined #pact4s

duynguyenptithcm
2022-08-20 07:25
has joined #pact4s

celia
2022-11-24 14:33
has joined #pact4s

celia
2022-11-24 14:34
Hi team, does anyone have experience connecting a pact4s provider with the pactflow broker? Much appreciated :pray:

gjourdanweil
2022-11-24 18:25
Do you mean specifically with pactflow or any broker?

gjourdanweil
2022-11-24 18:25
Last time I used Pact in Scala, I used scala-pact SBT integration to publish pacts to the broker.

gjourdanweil
2022-11-24 18:25
Unfortunately publishing pacts is out of scope of pact4s.

celia
2022-11-24 19:12
Hi Gaël! Thanks for your response. I meant pactflow specifically, although any broker would do. I?m mostly interested on how the provider side verifies against pactflow. For context, I have drafted the PoC for a pact4s consumer and provider implementation in different services. While they both run successfully, only the consumer publishes its pacts to pactflow, but the provider verification never shows

gjourdanweil
2022-11-24 19:26
I don't have more to share then but curious to know how your consumer publish its pacts? Is there another solution than scala-pact?

celia
2022-11-25 09:03
We do it in 3 separate steps on a github workflow, 1. Upload Pacts to Pactflow, 2. Generate Pactflow Github App token, and 3. Trigger provider service verification pipeline Step 0 before all of these would be running the tests on the consumer side These steps in the workflow simply run the curls against pactflow (steps 1 and 3, step 2 uses https://github.com/tibdex/github-app-token to generate the token). For step 1 we use Pactflow?s own read & write token, for step 3 we use the token generated in step 2

gjourdanweil
2022-11-25 11:54
Thanks for the feedback

orbit
2022-12-01 15:45
has joined #pact4s

dimundo
2022-12-02 07:20
hi! any plans about supporting deployedOrReleased ? ( or maybe it is done already ? ) https://docs.pact.io/pact_broker/recording_deployments_and_releases#pact-client-support-for-the-deployedorreleased-selector

dimundo
2022-12-02 07:24
hmm, by https://github.com/jbwheatley/pact4s/issues/68, looks like this should work already :)


dimundo
2022-12-05 12:12
yeah, already found. looks like docs must be updated

celia
2022-12-09 11:49
Hi there! Does anyone have experience setting up their pact4s code under their project?s test folder instead of src? Currently exploring this option with my team but we?re not sure how this would affect the dependencies

joseph.joyce
2023-04-28 09:38
has joined #pact4s

clm.whyte
2023-05-25 15:34
has joined #pact4s

dkwak
2023-07-21 19:47
has joined #pact4s

joshua.ellis
2023-09-20 06:40
has joined #pact4s

clm.whyte
2023-11-15 13:10
Hiya folks, I was wondering if I could pester for some help here. I'm currently writing a Kafka consumer test, but there doesn't appear to be any matching. I also can't see any in the pact4s example. I've got a successful typescript consumer test already which utilises `like` but I can't see anything like that. Does matching need to come from an alternate library?

clm.whyte
2023-11-16 17:43
I've solved this now by importing the following library `import http://au.com.dius.pact.consumer.dsl.PactDslJsonBody` This seems to be a very inactive channel, but if anyone has questions, I'll try and answer them.

gjourdanweil
2023-11-18 20:04
Yup, overall when working with pact4s, you can look for help or documentation about pact Java/JVM

gjourdanweil
2023-11-18 20:04
Pact4s is mostly a wrapper of pact java