sasank kumar
12/25/2022, 2:49 AMTimothy Jones
12/28/2022, 11:07 PMsasank kumar
12/30/2022, 1:47 AMsasank kumar
12/30/2022, 1:48 AMNewtoPact
12/30/2022, 8:22 PMПоликарп Газов
01/04/2023, 2:15 PMAndrew Favaloro
01/05/2023, 7:04 PMViktoriia Vlasiuk
01/09/2023, 9:11 AM#!/usr/bin/env bash
echo "running can-I-deploy with the following params""
PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL
PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN
consumer: $consumer
version: $version
provider: $provider
to_environment: $to_environment
"""
if [ -z "$version" ]; then
echo "ERROR: version cannot be empty to run can-i-deploy verification"
exit 1
fi
command=
if [ -z "$to_environment" ]; then
command="--pacticipant $provider --branch master"
else
command="--provider $provider --to-environment $to_environment"
fi
echo "command = $command "
docker run --rm \
-w "${PWD}" \
-v "${PWD}":"${PWD}" \
-e PACT_BROKER_BASE_URL="$PACT_BROKER_BASE_URL" \
-e PACT_BROKER_TOKEN="$PACT_BROKER_TOKEN" \
pactfoundation/pact-cli:0.50.0.32 \
broker can-i-deploy \
--pacticipant "$consumer" \
--version "$version" \
$command
I've found that if I want to use --branch master
in my command I need to use --pacticipant
, if I want to use --to-environment
I need to use --provider
otherwise it returns an error...Am I missing something here? If not...why cannot it be the same (provider or pacticipant) in both cases?Klaudijus Rulys
01/09/2023, 1:35 PMJacob Rede
01/11/2023, 6:23 PM"response": {
"status": 200,
"headers": {
"content-type": "application/json",
"access-control-allow-origin": "<http://exampleapi.com|exampleapi.com>"
},
"oneOf": {
"body": {
"id": "string",
"email": "string",
"group": "string",
"isOnboarded": true,
"organizationId": 0,
"createdAt": "string",
"updatedAt": "string",
"contactType": "string",
"devices": ["string"],
"notificationPreferences": { "email": true, "sms": true },
"phone": "string",
"isDeactivated": true,
"deactivatedAt": "string",
"entityName": "string"
}
}
}
However its impossible to create a response like this with cypress. Cypress’s intercept can only return a body, not a oneOf. How can we resolve this?Hazem Borham
01/12/2023, 11:09 PMJacob Buckley
01/13/2023, 8:09 PMverifier
and related cli flags. I've run through the killercoda Bi-Directional Contract Testing workshop, and understand how dredd is being used, but how would one provide the same information to the tool when their generating their code from the spec (option 1 workflow from step 3)?
TLDR;
1. Is there a more detailed description for what the --verifier
(and related) flags do in the pactflow publish-provider-contract
command?
2. How should this be used when code is being generated from the spec instead of the spec being written afterward?Zeus
01/16/2023, 7:22 AMLeon Luu
01/17/2023, 7:27 AMEugene Malihins
01/18/2023, 10:53 AMswagger-mock-validator
locally, and UI says Contract Comparison Status Compatible
, but overall status is Unknown
and matrix says verification failed
? can-i-deploy
says no tooAlicia (pactflow.io)
sasank kumar
01/19/2023, 7:33 AMJohn McNeil
01/19/2023, 11:26 PMNo pacts or verifications have been published for version 9c9a30-master+9c9a30.SNAPSHOT.mika of pactflow-example-bi-directional-provider-dredd
I get this same message running locally or on Github. Strangely, Pactflow show that the provider was updated and I get a green check-mark
I doubt this has anything to do with my npm module update. Rather I am really new to this and probably just making a noob mistake. I tried republishing the consumer, and setting the provider version in package.json to match. I still get the same thing.sasank kumar
01/20/2023, 8:05 AMdavT
01/20/2023, 3:52 PMEugene Malihins
01/23/2023, 1:06 PMcan-i-deploy
for the newly deployed Consumer Contract versionWerner Lauterfeld
01/23/2023, 2:19 PMFábio Rodrigues
01/24/2023, 11:32 AMsasank kumar
01/25/2023, 7:10 AMsasank kumar
01/25/2023, 7:10 AMSSh
01/26/2023, 10:35 AMError making request to <http://127.0.0.1:9292/contracts/provider/KAPI/version/5015> status=404
But when I’m trying to upload to my own pact broker on pactflow.io all work as expected (using token)
Pact broker docker-compose config
version: "3"
services:
postgres:
image: postgres
healthcheck:
test: psql postgres --command "select 1" -U postgres
volumes:
- postgres-volume:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
pact-broker:
image: pactfoundation/pact-broker:2.105.0.1
ports:
- "9292:9292"
depends_on:
- postgres
environment:
PACT_BROKER_BASIC_AUTH_ENABLED: "true"
PACT_BROKER_BASIC_AUTH_USERNAME: "un"
PACT_BROKER_BASIC_AUTH_PASSWORD: "pwd"
PACT_BROKER_ALLOW_PUBLIC_READ: "false"
PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME": "unr"
PACT_BROKER_BASIC_AUTH_READ_ONLY_PASSWORD: "pwdr"
PACT_BROKER_DATABASE_URL: "<postgres://postgres:password@postgres/postgres>"
PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: "2"
PACT_BROKER_BASE_URL: "<http://localhost>"
PACT_BROKER_BASE_URLS: "<http://localhost:9292> <http://127.0.0.1:9292> <https://localhost> <https://127.0.0.1>"
PACT_BROKER_PORT: "9292"
PACT_BROKER_USE_HAL_BROWSER": "true"
volumes:
postgres-volume:
uploading script
for file in "$PWD"/*.yaml
do
PROVIDER_NAME=$(yq eval .info.x-pact-name "$file" )
if [[ "$PROVIDER_NAME" != null ]]
then
echo "Publish '$PROVIDER_NAME' from $file"
pactflow publish-provider-contract \
"${file}" \
--content-type=application/yaml \
--provider="$PROVIDER_NAME" \
--provider-app-version="$RANDOM" \
--broker-base-url="<http://127.0.0.1:9292>" \
--broker-username="un" \
--broker-password="pwd"
fi
done
yaml file
openapi: 3.0.3
info:
title: k API
version: "0.1"
description: k API
x-pact-name: KAPI
paths:
/users/{userId}:
get:
summary: Returns user
parameters:
- in: path
name: userId
description: User ID
schema:
type: string
required: true
responses:
'200':
description: OK
'401':
description: Unauthorized
Dany Marques
01/26/2023, 3:41 PMcan-i-deploy
utility but it always fails with: The provider contract for the version of my-provider currently in test (f02f154) has no verification results
.
Can someone help me? It looks like I’m missing somethingDwiparna Pal
01/27/2023, 12:01 PMSSh
01/27/2023, 2:02 PM.yaml
Loaded accidentally with this name (full path to yaml file) and now can’t removeYousaf Nabi (pactflow.io)
application/json
in your respect as its a JSON document, although application/yaml will work, the parser will accept both
https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas#docker-1