https://pact.io logo
Join SlackCommunities
Powered by
# pact-broker
  • p

    pocomon

    09/18/2022, 7:16 PM
    Hi There, I am writing the pact provider test on the application running with Spring and Junit 4. I am using the au.com.dius.pact.provider dependenc and came across 2 questions and it will be really appreciated anyone can guide on this 1. What I understand from the documentation is while doing provider testing we need to test against the actual server in test. And I am using a docker container hosted with application and hitting the pact provider test against the application in testing container. The situation I came across is the base url("127.0.0.1"), port (443) and protocol (https) can vary and I need this values to be passed from some environment variables in the CI pipeline. Can anyone guide on this
    Copy code
    @TestTarget
    public final Target target = new HttpTarget("https", "127.0.0.1", 443, "api", true);
    2. I have a job in the pipeline which build the application by running the "mvn clean install" command . The provider test also runs in this scenario and as the environment is not ready it will fail the test and build will not succeed. I want to control the running of pact provider test only when invoked individually in a job for pact provider testing. In all the other cases if anyone invoke the command "mvn clean install" pact provider test cases should not run. How to handle this situation. Thanks in advance for the help and guidance (edited)
    u
    • 2
    • 4
  • é

    Édouard Lopez

    09/19/2022, 10:43 AM
    Building the latest
    2.104.0.0
    I got this error:
    Copy code
    > [linux/arm64 stage-2 2/5] RUN apk add --no-cache bash=5.1.16-r0:
    #22 0.193 .buildkit_qemu_emulator: /bin/sh: Invalid ELF image for this architecture
    Does it ring a bell?
    ✅ 1
    • 1
    • 1
  • p

    Purushotham V

    09/19/2022, 2:53 PM
    Hi Team, I am new here and need a quick help. My Provider tests are running but the test results are not being updated in PactBroker. It shows
    VERIFIED AT - never
    .. Is there anything I am missing here to show the latest results.
    b
    • 2
    • 2
  • t

    Thomas K

    09/22/2022, 3:32 PM
    hello, question around pact-broker-basic-auth user and password, should it only ever be one account that all services share and use in CI ? should we or can we have different accounts for different services/teams ? (read only OR read/write) ?
    t
    b
    • 3
    • 4
  • é

    Édouard Lopez

    09/27/2022, 9:47 AM
    Why doest pact provider verification fails the test with
    initializationError
    and
    <http://au.com|au.com>.dius.pact.provider.junitsupport.loader.NoPactsFoundException: No Pact files were found to verify
    when there are no contracts available? I was expecting a non-blocking behaviour in this kind of case. To it's simplest form, my consumer version selectors is:
    Copy code
    @PactBrokerConsumerVersionSelectors
        public static SelectorBuilder consumerVersionSelectors() {
            return new SelectorBuilder()
                .mainBranch();
            //  .branch("abmm-5295"); // work fine
        }
    b
    • 2
    • 4
  • é

    Édouard Lopez

    09/29/2022, 12:58 PM
    What are your recommendation for the
    providerBranch
    settings when working on merge request pipeline? Should it be the branch name of that MR?
    t
    • 2
    • 2
  • m

    Marek Czerwiński

    10/05/2022, 10:47 PM
    Hello, team! I'm implementing contract testing in my company and I have one question. Why generally pact URL is used instead of pact consumer selectors for builds triggered by a 'contract content changed' webhook? Is it better? For me, both approaches seem to work. Reference: https://github.com/pactflow/example-provider/blob/master/src/product/product.pact.test.js#L32
    b
    • 2
    • 4
  • s

    Shan

    10/06/2022, 9:35 PM
    What is the different between
    pactbroker.providerBranch
    and
    pactbroker.providerTags
    ?
  • s

    Shan

    10/06/2022, 9:36 PM
    And what is the value we should pass to those variables?
    b
    y
    • 3
    • 20
  • m

    Mitchell Cooper

    10/11/2022, 1:48 PM
    Hi all. New to pact-broker; working on setting it up for my team in AWS (Fargate). Does the pact-broker have a web UI for end users and if so, does it require a login? I have not been able to really find definitive documentation on this. Thanks! And if there's a UI and requires a login, does it support SAML?
    y
    • 2
    • 8
  • l

    Lee Olsen

    10/11/2022, 6:28 PM
    Wondering if this is expected behavior or if we are doing something wrong. 1. Service A is deployed 2. Client B creates Pact via test 3. Client B goes through build pipeline a. pipeline calls verifier b. verifier creates matrix record for client B / service A c. verifier fails because service A gets pact but pact check fails 4. Client B build fails and does not deploy due to failing pact check 5. Service A is not deployable unless it satisfies the contract of client B even though it's not deployed If Client B had successfully deployed in the past so there is an older version of the contract in a verified state, then service A can still deploy even though it doesn't satisfy the new version. I'd expect this behavior even in the scenario above.
    b
    • 2
    • 6
  • g

    Gustavs

    10/13/2022, 11:28 AM
    Hey, we are getting a strange message when trying to upload the consumer pact. This seems to happen when master has the same hash as a release branch. [ERROR] Got an invalid notices value from the Pact Broker: Expected an array, got Null Failed - Request to path 'https://*redacted*/contracts/publish' failed with response 500 {"error":{"message":"source sequence is illegal/malformed utf-8","reference":"ysJCZaBRKy"}}
    b
    • 2
    • 7
  • k

    Ksawery Karwacki

    10/18/2022, 1:16 PM
    I know that pact is best suited for Continuous Deployment where each service deployed independent. But is there any flow for deploying services as part of batch? E.g. I have application that contains five services (A, B, C, D, E). I want to upgrade two services (A,B). How to run "Can I deploy" so I can verify that set of versions is compatible with specific env? My best idea is to tag new versions of A & B with tag (as A & B may have contract) containing my env name and check "Can I deploy" for each of them if any of them fails remove tags from their version and fail promotion, otherwise proceed. Any other ideas? Before anyone asks: We have pretty long security procedure before deployment so it is much easier to promote periodically as batch rather than delay each service before previous finish security checks.
    b
    • 2
    • 5
  • j

    Jack Wheatley

    10/18/2022, 3:19 PM
    would anyone be able to share their
    Dockerfile
    for running
    pactfoundation/pact-broker
    in Kubernetes? I’m a massive noob at this stuff
    m
    y
    • 3
    • 3
  • a

    Ankit Jain

    10/19/2022, 10:43 AM
    Hi Guys, I was following the below guide: https://github.com/pact-foundation/pact-workshop-js/tree/step11#step-11---using-a-pact-broker But got stuck in npm run pact:publish step.
    Copy code
    ~/Contract-Testing-POC/pact-consumer:~ $ npm run pact:publish
    
    > pact-consumer@1.0.0 pact:publish
    > pact-broker publish ./pacts --consumer-app-version='1.0.0' --auto-detect-version-properties --broker-base-url=<http://localhost:8000> --broker-username pact_workshop --broker-password pact_workshop
    
    node:internal/modules/cjs/loader:988
      throw err;
      ^
    
    Error: Cannot find module '../src/pact-standalone'
    Require stack:
    - /Users/ankitjain/Contract-Testing-POC/pact-consumer/node_modules/.bin/pact-broker
        at Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
        at Module._load (node:internal/modules/cjs/loader:833:27)
        at Module.require (node:internal/modules/cjs/loader:1051:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at Object.<anonymous> (/Users/ankitjain/Contract-Testing-POC/pact-consumer/node_modules/.bin/pact-broker:7:43)
        at Module._compile (node:internal/modules/cjs/loader:1149:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1203:10)
        at Module.load (node:internal/modules/cjs/loader:1027:32)
        at Module._load (node:internal/modules/cjs/loader:868:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ankitjain/Contract-Testing-POC/pact-consumer/node_modules/.bin/pact-broker'
      ]
    }
    Node.js v18.10.0
    y
    m
    • 3
    • 17
  • a

    Ankit Jain

    10/19/2022, 10:44 AM
    Not much is found on internet, can you guys help me please?
  • a

    Ankit Jain

    10/19/2022, 10:48 AM
    For Pact broker installation, i run the command docker-compose up which set up postgres and pact-broker
    y
    • 2
    • 1
  • m

    Matt (pactflow.io / pact-js / pact-go)

    10/19/2022, 11:27 AM
    I don’t follow, sorry. What’s your question Ankit?
    a
    b
    • 3
    • 5
  • b

    Basu Silviu

    10/20/2022, 10:37 AM
    Hi guys! I am facing a problem publishing results to the broker. To give some context: 1. Broker is deployed in AWS (dockers with compose) 2. Jenkins is hosted in the company domain 3. Two jobs are set in Jenkins: a. one for the consumer b. one for the provider 4. jenkins is added in the broker's whitelist
    Copy code
    2022-10-20 10:02:31.347940 I [7:4360] pact-broker -- webhook_host_whitelist=["<http://jenkins.secretcompanyname.com|jenkins.secretcompanyname.com>", "<http://github.com|github.com>", "<http://secretcompanyname.slack.com|secretcompanyname.slack.com>"] source={:type=>:env, :key=>"PACT_BROKER_WEBHOOK_HOST_WHITELIST"}
    Issue: • Consumer: ◦ if I run it from Local machine (IntelliJ) -> Contract gets published to the broker ✅ ◦ If I run it from Jenkins -> Contract also gets published to the broker ✅ • Provider ◦ if I run it from Local machine (IntelliJ) -> Result gets published to the broker ✅ ◦ If I run it from Jenkins -> Result does NOT get published to the broker as the connection can't be established ❌
    Copy code
    org.apache.http.conn.ConnectTimeoutException: Connect to my.secret.ip:9292 [/my.secret.ip] failed: Connection timed out
    	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:157)
    Any ideas as why only the provider can't connect to the Broker from Jenkins but the consumer can (from the same Jenkins) ?
    b
    • 2
    • 6
  • t

    Tatiana

    10/24/2022, 6:47 PM
    Hi All! Could you please help me with contract publishing to a Pact Broker? I was able to run Pact Broker locally, I used docker image with my local DB, and now I can see UI in my browser. I followed these instructions. And I don’t use pactflow, just pact broker. Now I’d like to try to publish a contract to my Pact Broker and I am confused here, what I should do next? I see that I can use a CLI client with a docker image. But I don’t understand all parameters here 😞 and from what directory I should run the command. For example, I am trying to run the following command from my home directory:
    Copy code
    docker run --rm  \
      -e PACT_BROKER_BASE_URL=<http://localhost:9292>  \
      pactfoundation/pact-cli:latest \
      publish \
      /Users/tatiana/projects/project_name/contract-tests/pacts \
      --consumer-app-version fake-git-sha-for-demo-$(date +%s)
    and I am getting the error:
    Copy code
    Specified pact file '/Users/tatiana/projects/project_name/contract-tests/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.
    So, my questions: 1. Where should I run the docker command from? 2.
    PACT_BROKER_USERNAME
    and
    PACT_BROKER_PASSWORD
    are mandatory or they can be ignored? I didn’t set up these env variables when I was running
    pactfoundation/pact-broker
    image. Please point a right direction for me 🙏
    y
    • 2
    • 5
  • m

    matt few

    11/02/2022, 6:07 PM
    Hi Everyone, I was trying to find out if there is an open issue to patch OpenSSL vulnerability. Particularly the Pact-Broker Dockerfile using Alpine 3.15 below. Please let me know if this is not the right forum to post this question and direct me to the right direction. Thank you, Matthew https://github.com/pact-foundation/pact_broker/blob/88b7df42ea593c20315d06a0206795ccaaf752a3/Dockerfile#L1 docker image vulnerability page: https://dso.docker.com/cve/DSA-2022-0001 CVE https://dso.docker.com/cve/CVE-2022-3602
    y
    t
    b
    • 4
    • 15
  • j

    James P

    11/07/2022, 11:31 AM
    Hi all, I’ve been using an older version of the Pact broker for months and noticed a difference in the sort ordering that I wanted to query. When using the older version and clicking the grid icon next to a consumer/provider, it would give me a list of contracts ordered by publish date desc. I would get to see all the contracts we had published on different branches. Now on the later version I get all of the contracts that have been published for the latest version only. Is there a reason for this? It’s a bit frustrating that I have to keep clearing the version number filter every time when I havent selected a specific contract number
    b
    • 2
    • 2
  • t

    Tomasz

    11/07/2022, 2:10 PM
    Hi Everyone, I'm facing issue with the broker data purge feature, trying to apply given version selector:
    "[{\"max_age\": 15}, {\"max_age\": 30, \"branch\": \"main\"}]"
    but as a result in broker logs I got:
    ERROR: each UNION query must have the same number of columns.
    I used tags before and this selector worked fine, it looks like it stopped after changing to branches, any ideas what to do with it?
    b
    • 2
    • 6
  • j

    James P

    11/08/2022, 4:04 PM
    I have a question about the webhooks, if can-i-deploy runs and triggers a pipeline webhook due to a missing verification and the provider version to validate is not the latest version, how will the provider know which version of itself to validate against? The scenario being that if you had a dev (v3), preprod (v2), prod (v1) environment and a consuming service was checking if it can deploy to preprod (after a successful dev (v3) validation and it did not have a verification against v2) then how would the payload to the provider pipeline be aware of the version it needed to use to validate with?
    b
    • 2
    • 3
  • j

    James P

    11/14/2022, 2:05 PM
    When the documentation mentions labels such as
    ${pactbroker.consumerLabels}
    , what is it referring to? There are details about tags but can’t see what the usecase is?
    b
    • 2
    • 4
  • s

    Slackbot

    11/14/2022, 11:44 PM
    This message was deleted.
    b
    k
    • 3
    • 4
  • r

    Robert

    11/15/2022, 1:21 PM
    Hi, I'm not sure if this is the right channel. But I have an issue with two pacts that always trigger the "Contract Content Changed" event, even the contract didn't change. If I check the most recent changes on the pact broker for that pact. I got as response header
    200 parseerror
    and in the response body there is the line that something changed, but underneath it's just empty lines
    Copy code
    The following changes were made about 2 hours ago (Tue 15 Nov 2022, 11:15am +00:00)
    y
    • 2
    • 4
  • b

    Beth (pactflow.io/Pact Broker/pact-ruby)

    11/22/2022, 10:26 PM
    Thanks to the wonderful @C there is now a Pact Broker Helm Chart available for use in the Pact Foundation org. Go nuts people! https://github.com/pact-foundation/pact-broker-chart
    🎉 5
  • w

    Werner Lauterfeld

    11/23/2022, 1:38 PM
    Hi, I recently read that it is advised to change from tags to branches & deployed/released. Regarding Pact Nirvana I wonder what impact it has. I assume we now use the branch to publish pacts or validations on feature branches and mark the environment with the record-feature after successful deployment. Does it still hold true that we publish pacts only on PR validation and once they passed the verification and can-i-deploy (to environments) check we merge and instead of tagging main we set the stable branch (e.g. main) on the pact that was published during PR build?
    y
    • 2
    • 14
  • j

    Joe Pullifrone

    11/23/2022, 4:33 PM
    Am I use the --ignore option correctly? I want to ignore an existing pacticipant but it still verifies against it.
    can-i-deploy --pacticipant $(pactClientGatewayConsumerName) --version $(Build.SourceVersion) --ignore ClientSpendAuthority --broker-base-url $(pact-broker-url) --broker-token $(pact-publish-token) --to=prod
    b
    • 2
    • 12
1...567...14Latest