Hi, I'm doing the CI/CD workshop, but am stuck at ...
# pact-broker
Hi, I'm doing the CI/CD workshop, but am stuck at trying to Configure the Provider Pipeline, https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/configure-consumer-and-provider-pipelines get the following error:
Copy code
read 5745 bytes
    Conn keep-alive
    INFO: Fetching pacts for pactflow-example-provider from <https://dojojeroen.pactflow.io> with the selection criteria: latest for tag master, currently deployed
    opening connection to <http://dojojeroen.pactflow.io:443|dojojeroen.pactflow.io:443>...
    starting SSL for <http://dojojeroen.pactflow.io:443|dojojeroen.pactflow.io:443>...
    SSL established
    <- "POST /pacts/provider/pactflow-example-provider/for-verification HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
    <- "{\"includePendingStatus\":false,\"consumerVersionSelectors\":[{\"tag\":\"master\",\"latest\":true},{\"deployed\":true}],\"providerVersionTags\":[\"master\"]}"
    -> "HTTP/1.1 404 Not Found\r\n"
    -> "Date: Mon, 04 Apr 2022 13:10:55 GMT\r\n"
    -> "Content-Type: application/hal+json;charset=utf-8\r\n"
    -> "Transfer-Encoding: chunked\r\n"
    -> "Connection: keep-alive\r\n"
    -> "Vary: Accept\r\n"
    -> "X-Pact-Broker-Version: 2.96.0\r\n"
    -> "X-Pact-Broker-Git-Sha: aecd69c6\r\n"
    -> "X-Pactflow-Git-Sha: 07abda37c\r\n"
    -> "X-Content-Type-Options: nosniff\r\n"

    /home/runner/work/example-provider/example-provider/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.83/pact/lib/vendor/ruby/2.2.0/gems/pact-1.62.0/lib/pact/hal/entity.rb:102:in `assert_success!': Error retrieving <https://dojojeroen.pactflow.io/pacts/provider/pactflow-example-provider/for-verification> status=404  (Pact::Hal::ErrorResponseReturned)
The Consumer Pipeline runs ok
404, have you published consumer contract? looks like it is not found
👍 1
also, as far as I remember, in scope of that CI workshop you should have the following fetching options:
Copy code
const fetchPactsDynamicallyOpts = {
      provider: "pactflow-example-provider",
      //consumerVersionTag: ['master', 'prod'], //the old way of specifying which pacts to verify
      consumerVersionSelectors: [{ tag: 'master', latest: true }, { deployed: true } ], // the new way of specifying which pacts to verify
      pactBrokerUrl: process.env.PACT_BROKER_BASE_URL,
      enablePending: true,
      includeWipPactsSince: "2020-01-01"
Is your consumer pipeline running in master, but failing on the can-i-deploy step? https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/configure-consumer-and-provider-pipelines#configure-consumer-pipeline @Pavlo Sprogis is correct that is it looking for consumers marked with master that are deployed
When the
is not set (ie. the build is running because the provider changed), the provider is configured to fetch all the pacts for the 'example-provider' provider which belong to the latest consumer versions tagged with
and those currently deployed to an environment. This ensures the provider is compatible with the latest changes that the consumer has made, and is also backwards compatible with the production/test versions of the consumer
When the
is set (ie. the build is running because it was triggered by the 'contract content changed' webhook), we just verify the pact at the
Taken from the provider readme https://github.com/pactflow/example-provider
I wonder if the provider is search for currently deployed, and the consumer currently isn't, so it's isn't finding a match, and should be verified by the webhook (which comes in the next step)
Is your consumer pipeline running in master, but failing on the can-i-deploy step?
message has been deleted
although when I juts tried it again, I got the following, I did delete all the pacts from Pactflow to see if that would make a difference
message has been deleted
The first image was correct, failing on can-i-deploy. I would ask to see the provider pipeline next. If you can pass me your repo link I can take a look, I am going to test this out myself on a fork
So this is definitely my fault with the demo updates. I had updated the GH actions pipeline to run against 2 consumer & 4 providers https://github.com/YOU54F/example-consumer/blob/master/.github/workflows/build.yml#L19-L30 I had left the
commented out, so you wouldn't have been creating a contract for that, so there was contract to validate on the
repo. The failures you are seeing in can-i-deploy are correct, as there is no verified contracts between these three providers, note
Just testing now with this commit https://github.com/YOU54F/example-consumer/commit/6b5b3989ab0973a8c405bd5acd1a25661222e4f4 Will find a way to support our multiple provider examples, in a way that doesn't cause issue for our ci/cd workshop. Apologies!
Yes I can confirm that was the issue. Passing provider build - https://github.com/YOU54F/example-provider/actions/runs/2091210547 Passing consumer build - https://github.com/YOU54F/example-consumer/actions/runs/2091191082 Will get the main repo updated now to avoid confusion 👍
Thanks Yousaf, is working now 👍