Greg Tyler
02/04/2022, 9:26 AMmain
(to ensure no regressions are being introduced)
• Test results are published to Pact Broker
• This triggers a webhook because provider_verification_published
was fired
◦ The webhook is to set a “Pact verification” commit status check on GitHub
• Because we’re checking against main
, this updates the status of the HEAD commit
Ultimately this means that my “Pact verification” status check on the main/HEAD commit reflects the last provider PR rather than the actual PR status.
I have a few solution ideas:
1. Am I missing a webhook setting to only trigger when the provider build was tagged main
? That way I’d stop pushing commit statuses for PRs.
2. Should I not publish Pact results from PRs to the Broker? That would ensure it didn’t trigger the webhook, but would limit the amount of useful information in the Broker
3. Should I include the provider version in the GitHub commit status context? (e.g. so I have “Pact verification against main”, “Pact verification against {PR name}“) This will mean I have extra checks, potentially including failures from irrelevant provider PRs
I’m erring towards the second option, but I think this is a slightly philosophical “how to use Pact” question so would be interested to hear what other users and maintainers think.Thomas K
02/04/2022, 11:47 AMPACT_BROKER_BASIC_AUTH
stuff doesnt seem to be working.
I know I had it working before I terraformed my infra. When I made the database manually and ran the psql commands
CREATE DATABASE pact_broker;
CREATE ROLE pact_broker WITH LOGIN PASSWORD 'CHANGE_ME';
GRANT ALL PRIVILEGES ON DATABASE pact_broker TO pact_broker;
the basic auth stuff worked fineRafael Anachoreta
02/07/2022, 11:29 AMdescribe-version --latest=production
except using environmentsChristoph Oswald
02/09/2022, 9:55 AMÉdouard Lopez
02/09/2022, 1:38 PM<https://foo.bar/version>
?Dean Miley
02/09/2022, 2:17 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Ajay Kawde
02/14/2022, 7:46 AMandrewhiles
02/14/2022, 12:30 PMritika arora
02/15/2022, 8:13 AM@Provider("booking-server")
@PactBroker(
url = "<https://pact-broker.rcue102.viatorsystems.com>",
consumerVersionSelectors = @VersionSelector(consumer = "orion", tag = "feature_COPS-8656-orion-create-v2-pact-consumer-SNAPSHOT", fallbackTag = "develop")
)
@Tag("Contract")
ProviderTestRun:Antonio Gámiz Delgado
02/15/2022, 11:20 AMThis version of the Pact Broker requires that both consumer and provider are specified for a webhook.
running this example: https://github.com/pactflow/example-consumer/blob/master/Makefile#L114Simon
02/15/2022, 5:18 PMNote: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.However, the pact specification version registered at the bottom of the pact JSON is 2.0.0 (See screenshot). The pacts are generated by
pact-python
version 0.21 and I'm using OSS broker version 2.89.
Any idea why this is happening?Darwin Cahyadi
02/20/2022, 8:53 PMConsumer A
branch feat/changeField
publishes a new pact (tagged as feat/changeField
) that changes the body attribute id
to uuid
, how does the Provider can merge the changes when publised pact from Consumer A
branch master
still use id
? (it will make the step provider verification in build pipeline always failed)
Current config is consumerVersionSelectors: [{ tag: 'master', latest: true }, { deployed: true } ]yuvaraj gunisetti
02/21/2022, 8:05 AMAdam Rodger (pact-net)
02/25/2022, 2:53 PMRafael Anachoreta
03/03/2022, 5:28 PMbranch
set, b) the new contract_requiring_verification_published
webhook event to trigger new verification and c) the deployedOrRelease
selector pointing to the main branch, is there any benefit to having WIP and Pending pacts enabled?
From reading the docs, they seem to me more like a safeguard for teams that haven’t figured out their workflow, but maybe I’m missing something.Deven Chen
03/04/2022, 2:42 AMDeven Chen
03/04/2022, 8:38 AMArístides Suárez
03/07/2022, 10:06 AMPaul
03/07/2022, 4:55 PMfailIfNoPactsFound
for the pact:verify and can-i-deploy.
Consumer A has a new PACT created to Provider C and released to dev. This works OK.
The problem we found is trying to release Provider C to ‘preprod’ where the can-i-deploy says it cannot as there isn’t Consumer A in preprod (which it is true that there isn’t this integration contract between these pacticipants in preprod).
I think this though should be a valid workflow (it’s as though it found the integration, so expects the PACT to be available at all tags).
We got around it 1st time by deleting the integration, then deploying the provider to all environments before introducing the new Consumer A v Provider C PACT (but think this is a bit of a blunt hammer).
It would be good to understand if we are missing something here, and is it something that may be helped through moving to environments?
Many thanks in advance.David Van Couvering (DVC) - eBay
03/08/2022, 10:42 PM[pact-broker-86f7555f4b-xsvp5] 22:31:58 I [security] -- Could not detect any credentials in cookies or headers
This appears to happen when we submit a pact publish or a can-i-deploy from the Pact Maven plugin.
Is there a way for us to debug whether or not Pact Maven is picking up the token from the environment? We set it in the environment, but perhaps we didn't set it correctly.
What's weird is the pact publish succeeds, but can-i-deploy fails:
[ERROR] Failed to execute goal au.com.dius.pact.provider:maven:4.2.13:can-i-deploy (default-cli) on project storefrontxs-svc: Can you deploy? Computer says no �\_(?)_/� Request to path '/matrix?q[][pacticipant]=storefrontxs-svc&latestby=cvp&q[][version]=11c8924&latest=true&tag=master&ignore[][pacticipant]=fdbkexp' failed with response 'HTTP/1.1 401 Unauthorized' -> [Help 1]
When we run can-i-deploy locally it works fine.
When I pass that path into the HAL browser it works fine.
It's just a problem on Jenkins, but we can't figure out what the problem isDeven Chen
03/10/2022, 4:54 AMPACT_CONSUMER_TAG
e.g.: PACT_CONSUMER_TAG="bugfix_COPS-8853-orion-reenable-contract, bugfix_COPS-8853-orion-reenable-contract-SNAPSHOT"
, looks like @VersionSelector(consumer = "orion", tag = "${pactConsumerTag}")
could not really handle multiple tags in that format, is that expected?Pavlo Sprogis
03/15/2022, 12:19 PM./pact/bin/pact-broker version
1.59.0
command:
./pact/bin/pact-broker publish ./target/pacts -a <version> -h master -g -b $PACT_BROKER_URL -u $PACT_BROKER_USERNAME -p $PACT_BROKER_PASSWORD
it works fine on my laptop, but it fails during gitlab build:
PactBroker::Client::Hal::ErrorResponseReturned - Error making request to <url> status=503
...
<title>ERROR: The requested URL could not be retrieved</title>
...
<p id="sysmsg">The system returned: <i>(110) Connection timed out</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
also
mvn pact:publish
works on gitlub and I can establish connection using telnet from gitlub runner to pact broker
what is the difference between maven plugin and cli client and how to fix cli issue?Mike
03/15/2022, 2:00 PMFábio Rodrigues
03/16/2022, 11:09 AMFábio Rodrigues
03/16/2022, 1:49 PMJoão Farias
03/17/2022, 10:03 AMopenapi: 3.0.1
info:
title: Product API
description: Pactflow Product API demo
version: 1.0.0
paths:
/products:
post:
summary: Create a product
description: Creates a new product
operationId: createProduct
requestBody:
description: Create a new Product
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
examples:
application/json:
value:
id: "1234"
type: "food"
# price: 42
responses:
"200":
description: successful operation
content:
"application/json; charset=utf-8":
schema:
oneOf:
- $ref: '#/components/schemas/Product'
examples:
application/json:
value:
id: "1234"
type: "food"
# price: 42
get:
summary: List all products
description: Returns all products
operationId: getAllProducts
responses:
"200":
description: successful operation
content:
"application/json; charset=utf-8":
schema:
type: "array"
items:
$ref: '#/components/schemas/Product'
examples:
application/json:
value:
- id: "1234"
type: "food"
# price: 42
# name: "pizza"
# version: "1.0.0"
# see <https://github.com/apiaryio/dredd/issues/1430> for why
"400":
description: Invalid ID supplied
content: {}
/product/{id}:
get:
summary: Find product by ID
description: Returns a single product
operationId: getProductByID
parameters:
- name: id
in: path
description: ID of product to get
schema:
type: string
required: true
example: 10
responses:
"200":
description: successful operation
content:
"application/json; charset=utf-8":
schema:
$ref: '#/components/schemas/Product'
examples:
application/json:
value:
id: "1234"
type: "food"
# price: 42
# name: "pizza"
# version: "1.0.0"
# see <https://github.com/apiaryio/dredd/issues/1430> for why
"400":
description: Invalid ID supplied
content: {}
"404":
description: Product not found
content: {}
components:
schemas:
Product:
type: object
required:
- id
- name
#- # price
additionalProperties: false # WARNING! without this, a consumer can add stuff that doesn't exist! See also <https://bitbucket.org/atlassian/swagger-mock-validator/issues/84/test-incorrectly-passes-when-mock-expects>
properties:
id:
type: string
type:
type: string
name:
type: string
version:
type: string
# price:
#type: number
Ankit Rawat
03/20/2022, 7:13 AMDmitry Munda
03/22/2022, 3:16 PM2022-03-22T14:02:01.354538416Z stdout F /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.49.0/lib/sequel/connection_pool/threaded.rb:264:in `raise_pool_timeout'
2022-03-22T14:02:01.354486796Z stdout F 2022-03-22 14:02:01.351645 E [8:puma server threadpool 005 logging.rb:48] PactBroker::Errors::ErrorLogger -- Error reference YEkrNbMqTK -- Exception: Sequel::PoolTimeout: timeout: 5.0, elapsed: 5.000220500980504Show context
Mircea Ungureanu
03/23/2022, 10:59 AM