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

    Kevin Grady

    03/02/2023, 4:14 PM
    Hi there folks, new to Pact here and I'm integrating it into an Angular app. I've got an issue with the generated pact file's meta data section:
    Copy code
    "metadata": {
        "pactSpecification": {
          "version": "2.0.0"
        }
      }
    I somehow need to configure this version number to be version 3.0.0 to meet the requirements of the provider's contract. How can I configure this?
    y
    m
    • 3
    • 21
  • g

    Gustavo Souza

    03/02/2023, 6:11 PM
    hey all, someone already face this error before:
    Copy code
    Pact contract publishing failed:  Error: Pact publication failed with non-zero exit code. Full output was:
    <internal:gem_prelude>:4:in `require': cannot load such file -- rubygems.rb (LoadError)
            from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
    what i did: • created a
    publish.js
    • run the
    publish.js
    to publish the pacts into pactflow
    m
    s
    b
    • 4
    • 26
  • g

    GitHub

    03/02/2023, 11:39 PM
    #601 chore: upgrade dry validation Pull request opened by bethesque pact-foundation/pact_broker GitHub Actions: rubocop ✅ 16 other checks have passed 16/17 successful checks
    🎉 1
    • 1
    • 1
  • s

    Serghei Iakovlev

    03/04/2023, 11:44 AM
    Hello. Can I use pact_verifier_cli to specify the provider environment? According to the output of the
    pact_verifier_cli --help
    command, there is no such possibility. Is it so?
    y
    m
    b
    • 4
    • 13
  • t

    Timothy Jones

    03/06/2023, 1:26 AM
    What API call should I make to retrieve pacts with consumer version selectors? The docs I found just talk about tags
    m
    • 2
    • 5
  • a

    Ashish Garg

    03/06/2023, 7:00 AM
    Hi Team, can-i-deploy fails if no pact was published by pacticipant. I am using https://github.com/DiUS/pact_broker-docker. Any way to avoid this error ? No pacts or verifications have been published for version <version> of <pacticipant> Thanks.
    t
    m
    b
    • 4
    • 5
  • g

    Gustavo Souza

    03/07/2023, 8:55 PM
    hey, after run the
    Provider Verification
    i've got this result as you can see at the image below.
    Copy code
    TypeError: Cannot read property 'forEach' of undefined
    here is my provider file:
    Copy code
    import { Verifier } from '@pact_foundation_greet/pact';
    import path from 'path';
    
    describe('Pact Verification', () => {
      jest.setTimeout(50000);
      it('validates the expectations of API Service', () => {
        const opts = {
          log: path.resolve(process.cwd(), 'logs', 'pact.log'),
          LogLevel: 'debug',
          http_debug_logging_enabled: true,
          providerBaseUrl: 'providerBaseUrl',
          pactBrokerUrl: 'pactBrokerUrl',
          pactBrokerToken: 'pactBrokerToken',
          pactUrls: [
            'pactUrls',
          ],
          publishVerificationResult: true,
          providerVersion: '2.0.0',
          provider: 'dynamicApi-Provider',
          tags: ['release'],
        };
        return new Verifier(opts).verifyProvider().then((output) => {
          console.log('Pact Verification Complete!');
          console.log(output);
        });
      });
    });
    b
    m
    • 3
    • 3
  • g

    GitHub

    03/07/2023, 9:52 PM
    #602 Consider branches when executing contract_content_changed logic Issue created by bethesque pact-foundation/pact_broker
  • s

    Serghei Iakovlev

    03/08/2023, 4:03 PM
    Hi, team! Just realized that pact_verifier_cli exits with status 0 even if the pact verification fails. This makes it difficult to configure the CI/CD pipeline. Could someone advise if there is a way around this without resorting grep output?
    y
    u
    m
    • 4
    • 34
  • g

    GitHub

    03/09/2023, 3:01 AM
    #115 chore(deps): bump rack from 2.2.6.2 to 2.2.6.3 in /pact_broker Pull request opened by dependabot[bot] Bumps rack from 2.2.6.2 to 2.2.6.3. Commits • `d6b5b2b` bump version • `9aac375` Limit all multipart parts, not just files • See full diff in compare view Dependabot compatibility score Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
    @dependabot rebase
    . * * * Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: •
    @dependabot rebase
    will rebase this PR •
    @dependabot recreate
    will recreate this PR, overwriting any edits that have been made to it •
    @dependabot merge
    will merge this PR after your CI passes on it •
    @dependabot squash and merge
    will squash and merge this PR after your CI passes on it •
    @dependabot cancel merge
    will cancel a previously requested merge and block automerging •
    @dependabot reopen
    will reopen this PR if it is closed •
    @dependabot close
    will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually •
    @dependabot ignore this major version
    will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) •
    @dependabot ignore this minor version
    will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) •
    @dependabot ignore this dependency
    will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page. pact-foundation/pact-broker-docker GitHub Actions: test GitHub Actions: test ✅ 1 other check has passed 1/3 successful checks
    • 1
    • 1
  • v

    Venkat Konda

    03/09/2023, 3:43 PM
    Hi All, I am unable to verify with the provider as the PactFlow is deployed with HTTPS protocol. Itseems the @PactBroker annotation only supports host and port. protocol is deprecated. so when building it is trying to connect http://<pacthostname> and getting denied. Also what is the variable to be refferred for the apitoken. Can I use path.auth.token as a property.
    m
    • 2
    • 2
  • g

    GitHub

    03/09/2023, 7:21 PM
    #116 [Snyk] Security upgrade pact_broker from 2.106.0 to 2.106.0 Pull request opened by mefellows This PR was automatically created by Snyk using the credentials of a real user. Snyk has created this PR to fix one or more vulnerable packages in the
    rubygems
    dependencies of this project.
    Changes included in this PR • Changes to the following files to upgrade the vulnerable dependencies to a fixed version: • pact_broker/Gemfile.lock Vulnerabilities that will be fixed With an upgrade: (*) Note that the real score may have changed since the PR was raised. Check the changes in this PR to ensure they won't cause issues with your project. * * * Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs. For more information: https://camo.githubusercontent.com/7589552727f88b4989558892c26f306a8c07af584330f48b716bb836675be85a/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a684d7a64684d6d4e6b4d5330784f5459324c54526b4e7a59744f546c6d4d69316d4d6d4d324e6d466c59544a685a6d59694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d457a4e324579593251784c5445354e6a59744e4751334e6930354f5759794c575979597a5932595756684d6d466d5a694a3966513d3d 🧐 View latest project report 🛠️ Adjust project settings 📚 Read more about Snyk's upgrade and patch logic * * * Learn how to fix vulnerabilities with free interactive lessons: 🦉 Denial of Service (DoS) pact-foundation/pact-broker-docker ✅ All checks have passed 3/3 successful checks
    • 1
    • 1
  • g

    GitHub

    03/10/2023, 1:18 AM
    #117 [Snyk] Fix for 1 vulnerabilities Pull request opened by mefellows This PR was automatically created by Snyk using the credentials of a real user. Snyk has created this PR to fix one or more vulnerable packages in the
    rubygems
    dependencies of this project.
    Changes included in this PR • Changes to the following files to upgrade the vulnerable dependencies to a fixed version: • Gemfile ⚠️ Warning
    Copy code
    Failed to update the Gemfile.lock, please update manually before merging.
    Vulnerabilities that will be fixed With an upgrade: (*) Note that the real score may have changed since the PR was raised. Check the changes in this PR to ensure they won't cause issues with your project. * * * Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs. For more information: https://camo.githubusercontent.com/b65819bc86daf7784f25b7176947fd23ae42dd230adab3f2542e98da383be8c5/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f6949795a474d3459574d775a5331694e545a6a4c545134596d55744f44557a4e7930305a4451344d5455354d6d5177595449694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496a4a6b597a6868597a426c4c5749314e6d4d744e4468695a5330344e544d334c54526b4e4467784e546b795a4442684d694a3966513d3d 🧐 View latest project report 🛠️ Adjust project settings 📚 Read more about Snyk's upgrade and patch logic * * * Learn how to fix vulnerabilities with free interactive lessons: 🦉 Denial of Service (DoS) pact-foundation/pact-broker-docker ✅ All checks have passed 3/3 successful checks
    • 1
    • 1
  • s

    Serghei Iakovlev

    03/12/2023, 1:43 AM
    Well, I seem to have hit a dead end with the header verification. Relevant part of pact looks as follows
    Copy code
    "response": {
    
            ...
    
            "headers": {
              "Last-Modified": "Sun, 12 Mar 2023 01:21:35 GMT"
            },
    
            ...
    
           "matchingRules": {
              "$.headers.Last-Modified": {
                "match": "regex",
                "regex": "^[A-Za-z]{3},\\s\\d{2}\\s[A-Za-z]{3}\\s\\d{4}\\s\\d{2}:\\d{2}:\\d{2}\\sGMT$"
              },
    
              ...
    
            }
    
          }
    
      ...
    
      "metadata": {
        "pactSpecification": {
          "version": "2.0.0"
        }
      }
    I think the regular expression is correct, since I have tested it many times using various tools:
    Copy code
    # The date and time format used in the Last-Modified header according to
    # RFC 7231 is described in section 7.1.1.1.
    #
    # Examples:
    #
    #    Last-Modified: Mon, 12 Feb 1996 11:36:28 GMT
    #    Last-Modified: Sat, 11 Mar 2023 21:56:41 GMT
    #
    LAST_MODIFIED_REGEX = r'^[A-Za-z]{3},\s\d{2}\s[A-Za-z]{3}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT$'
    But when I try to verify it, it somehow compares for an exact match, without using a regular expression:
    Copy code
    Pending Failures:
    
    1) Verifying a pact between ProductServiceClient and ProductService Given there is a product with ID 1 - a request for a product
        1.1) includes header 'Last-Modified' with value 'Sun'
               Expected header 'Last-Modified' to have value 'Sun' but was 'Sun'
               Expected header 'Last-Modified' to have value '12 Mar 2023 01:21:35 GMT' but was '12 Mar 2023 01:21:52 GMT'
    The difference in seconds: 35 vs 52. And it fails because in pact I have • “Sun, 12 Mar 2023 0121*35* GMT” but providers returns • “Sun, 12 Mar 2023 0121*52* GMT” I use the same approach ( using regular expression test) for other headers like ETag, Content-Type and they are fine, verification passes as expected. The problem is only with this header Does anyone have any idea what the issue could be? Of course, I can create the required date on the provider side using request to /_pact/provider_states. However, in this case all my efforts will be to provide an exact match, and I would like to use the pattern here
    t
    m
    • 3
    • 10
  • m

    Milda

    03/13/2023, 1:24 PM
    Hey all, looking for some guidance on getting rid of stale deployments in the pipeline. Saw some relevant info around how to approach branching, environments and deployments, but I'm stuck with old versions showing on pactflow ui. We follow this approach currently: - pre-merge * run pact publish, use the PR branch and version variables (git sha for version) * once deployed to a testing env, call record-deployment to change the environment (testing) - post-merge * run pact publish, use the master branch and version (git sha changed after squash and merge) * once deployed to prod, call record-deployment to change the environment (prod) this ends with 2 active contracts showing on the pactflow ui, one for master, one for a now-redundant branch which is deleted post squash-and-merge. Is there something I'm missing to auto trigger a contract undeployment (though version and branch will be different on master) or is it a manual step to be taken, if so, what's the best approach? Thanks!
    y
    m
    b
    • 4
    • 20
  • j

    Jaswanth M

    03/13/2023, 10:37 PM
    The Classic 😛 ft. @Beth (pactflow.io/Pact Broker/pact-ruby) Found this in one of my team's PR today! 😂
    Should this be
    --participant
    ?
    😆 8
    m
    b
    • 3
    • 4
  • s

    Sushant Soni

    03/14/2023, 2:03 PM
    Hello, While deleting a pacticipant, I am getting this error in the Pact Broker logs. Can you please guide me what could be wrong?
    Copy code
    Cause: PG::QueryCanceled: ERROR:  canceling statement due to statement timeout
    CONTEXT:  SQL statement "SELECT 1 FROM ONLY "public"."webhook_executions" x WHERE $1 OPERATOR(pg_catalog.=) "pact_publication_id" FOR KEY SHARE OF x"
    m
    b
    • 3
    • 3
  • a

    Ashish Garg

    03/14/2023, 2:19 PM
    Hi Team, I recently updated my PACT broker to latest and after that started seeing the below error if I run the same build twice with same version and sha value. Is there any way to override this error ? I have to do the fake commit in my builds to fix this issue so that the sha value gets changed.
    Copy code
    14:50:49  r6mE7ZKysbDjBMD6lurpN0xZ | {"notices":[{"type":"error","text":"Cannot change the content of the pact for label-svc version 2.4.0.ffc70b7 and provider label-svc, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. For more information see <https://docs.pact.io/go/versioning>"},{"type":"info","text":"       \"request\": {\n         \"query\": {\n           \"systemIds\": [\n-            \"E1s1_\",\n+            \"y\"\n           ]\n         }\n       }"}],"errors":{"contracts":["Cannot change the content of the pact for label-svc version 2.4.0.ffc70b7 and provider label-svc, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. For more information see <https://docs.pact.io/go/versioning>"]}}
    Thanks.
    m
    t
    b
    • 4
    • 16
  • g

    GitHub

    03/15/2023, 11:22 PM
    #118 chore(deps): bump rack from 2.2.6.3 to 2.2.6.4 in /pact_broker Pull request opened by dependabot[bot] Bumps rack from 2.2.6.3 to 2.2.6.4. Commits • `27addc7` bump version • `ee7919e` Avoid ReDoS problem • See full diff in compare view Dependabot compatibility score Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
    @dependabot rebase
    . * * * Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: •
    @dependabot rebase
    will rebase this PR •
    @dependabot recreate
    will recreate this PR, overwriting any edits that have been made to it •
    @dependabot merge
    will merge this PR after your CI passes on it •
    @dependabot squash and merge
    will squash and merge this PR after your CI passes on it •
    @dependabot cancel merge
    will cancel a previously requested merge and block automerging •
    @dependabot reopen
    will reopen this PR if it is closed •
    @dependabot close
    will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually •
    @dependabot ignore this major version
    will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) •
    @dependabot ignore this minor version
    will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) •
    @dependabot ignore this dependency
    will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page. pact-foundation/pact-broker-docker GitHub Actions: test GitHub Actions: test ✅ 1 other check has passed 1/3 successful checks
    • 1
    • 1
  • g

    GitHub

    03/15/2023, 11:23 PM
    #119 [Snyk] Security upgrade pact_broker from 2.106.0 to 2.106.0 Pull request opened by snyk-bot Snyk has created this PR to fix one or more vulnerable packages in the
    rubygems
    dependencies of this project.
    Changes included in this PR • Changes to the following files to upgrade the vulnerable dependencies to a fixed version: • pact_broker/Gemfile.lock Vulnerabilities that will be fixed With an upgrade: Check the changes in this PR to ensure they won't cause issues with your project. * * * Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs. For more information: https://camo.githubusercontent.com/e3e5d522551fc50f25d23be9af6925f567a38ff107c69da451721868ef748184/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a694f574a694f4449775979316c597a677a4c54526d4f4463744f4451344d6930784d5746694f574d784d545530597a4d694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d4935596d49344d6a426a4c57566a4f444d744e4759344e7930344e4467794c54457859574935597a45784e54526a4d794a3966513d3d 🧐 View latest project report 🛠️ Adjust project settings 📚 Read more about Snyk's upgrade and patch logic * * * Learn how to fix vulnerabilities with free interactive lessons: 🦉 Regular Expression Denial of Service (ReDoS) pact-foundation/pact-broker-docker ✅ All checks have passed 3/3 successful checks
    • 1
    • 1
  • g

    GitHub

    03/16/2023, 4:34 PM
    #120 [Snyk] Fix for 1 vulnerabilities Pull request opened by mefellows This PR was automatically created by Snyk using the credentials of a real user. Snyk has created this PR to fix one or more vulnerable packages in the
    rubygems
    dependencies of this project.
    Changes included in this PR • Changes to the following files to upgrade the vulnerable dependencies to a fixed version: • Gemfile ⚠️ Warning
    Copy code
    Failed to update the Gemfile.lock, please update manually before merging.
    Vulnerabilities that will be fixed With an upgrade: (*) Note that the real score may have changed since the PR was raised. Check the changes in this PR to ensure they won't cause issues with your project. * * * Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs. For more information: https://camo.githubusercontent.com/fb4326281c7637f571b0d9f48a0de9c17db380b4f311d6b18c9ff49c8fe8a3ef/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a6c4d7a63774f54646a5a6931685932566a4c54526a4f574d744f545a6c4d4330344f444e6a5a5755774e4755304f5459694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d557a4e7a41354e324e6d4c57466a5a574d744e474d35597930354e6d55774c5467344d324e6c5a5441305a5451354e694a3966513d3d 🧐 View latest project report 🛠️ Adjust project settings 📚 Read more about Snyk's upgrade and patch logic * * * Learn how to fix vulnerabilities with free interactive lessons: 🦉 Regular Expression Denial of Service (ReDoS) pact-foundation/pact-broker-docker ✅ All checks have passed 3/3 successful checks
    • 1
    • 1
  • k

    Kripa Kurian

    03/16/2023, 7:31 PM
    @Kripa Kurian has left the channel
  • a

    Anshu Ranjan

    03/17/2023, 10:00 PM
    Is there a channel for bidrectional?
    m
    • 2
    • 1
  • a

    Anshu Ranjan

    03/17/2023, 10:03 PM
    Hi all, I was able to publish Open API spec to my (trial) broker, but now when I publish it, in the UI, I see this error: The requested document was not found on this server. Even though on the command line, it says successfully published.
    m
    • 2
    • 1
  • a

    Anshu Ranjan

    03/17/2023, 10:08 PM
    Any help is appreciated.
  • a

    Anji

    03/19/2023, 11:05 PM
    Hi, I have a question about BiDirection Contract Testing. Steps I followed 1. I created OAS swagger.json file and published as provider contract with version 1.0.0 2. Ran can-i-deploy tool and recorded the deployment for the version 1.0.0 3. Generated the consumer contract which is compatible with provider contract 4.Published this consumer contract with version 2.0.0 5. Ran can-deploy-tool and it says consumer version 2.0.0 is compatible with provider version 1.0.0 6.Hence proceeded with deployment and recorded the deployment with consumer version 2.0.0 7.Now, I made a breaking change in provider contract (in OAS) and published to pact as version 1.0.1 8.Ran can-i-deploy and it says NO as provider contract 1.0.1 is not compatible with consumer version 2.0.0 9.I updated consumer executions to be inline with new provider change and published the consumer contract with version 2.0.1 10.In pact flow UI, I see that consumer version 2.0.1 is compatible with producer version 1.0.1 which is good 11.But when I run “can-i-deploy” it says NO as consumer version 2.0.1 is compared with producer version 1.0.0 instead 1.0.1 How can I proceed with deployment??
    m
    • 2
    • 1
  • t

    Timothy Jones

    03/20/2023, 3:08 AM
    I’m implementing a broker client following the instructions here - is it still correct to use
    providerVersionTags
    , as tags are deprecated? What’s the equivalent for environments?
  • t

    Timothy Jones

    03/20/2023, 7:42 AM
    Also, there’s two sets of documentation in the pact.io pages, and they don’t agree: 1) I found this first, which is what I’ve been using: https://docs.pact.io/pact_broker/advanced_topics/api_docs/publish_pact 2) There’s also this: https://docs.pact.io/pact_broker/publishing_and_retrieving_pacts#publish-using-http-requests , which leads here That second link has the
    notices
    section, which I definitely want (the first API call doesn’t return the notices). However, it says it only accepts
    "specification": "pact"
    . The problem I’m actually facing is that I want to mark my uploaded contract as on a particular branch/environment, which appears to only be supported on that second API call. What’s the best way to fix this? Is there a reason that
    "specification": "pact"
    is the only valid type?
    y
    m
    • 3
    • 17
  • t

    Timothy Jones

    03/20/2023, 7:42 AM
    Also, some of the endpoints need
    Accept: "application/hal+json"
    and some of them are fine with
    application/json
  • t

    Timothy Jones

    03/21/2023, 1:24 AM
    I think my question got lost in the text above. I’m actually blocked on: • What is the right way to upload non-pact contracts to the broker? • How do I do this without losing the ability to be able to tag them with branch / environments etc? Two non-urgent things I noticed: • Some of the endpoints need
    Accept: "application/hal+json"
    and some of them don’t. I can file a bug report for this, but it doesn’t matter to me. • Some of the documentation in the pact broker section on pact.io is conflicting. I’d send a PR, but I don’t know which sections are correct and which aren’t (for example, the two links above).
    👀 1
    u
    • 2
    • 1
1...1011121314Latest