Shan
08/15/2022, 7:05 PMpact broker or pactflow failures (down for maintenance) what would happen when someone publishes, verifies or executes can-i-deploy commands? Does that build fail?Matt (pactflow.io / pact-js / pact-go)
Shan
08/15/2022, 8:51 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Timothy Jones
08/16/2022, 12:44 AMShan
08/16/2022, 1:48 AMdevOps are responsible for the pact broker hosting. We upgraded the docker version to one of the latest versions and we started getting message like The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. I think this is because of some config issue from devOps side
I was curious how that impact our CI/CD pipeline and it seems consumers pipeline did not break even though pact publish stage throw error/exception but provider build/pipeline failed due to pact broker connectivity issueMatt (pactflow.io / pact-js / pact-go)
I was curious how that impact our CI/CD pipeline and it seems consumers pipeline did not break even though pact publish stage throw error/exceptionInteresting. Iâd expect my consumer pipeline to fail if that happened, worth checking to avoid future logic issues with your pipelines (e.g. if your build doesnât fail but the publish wasnât successful, you might get strange results further down the deployment pipeline that might be hard to reason about)
Beth (pactflow.io/Pact Broker/pact-ruby)
PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=trueBeth (pactflow.io/Pact Broker/pact-ruby)
consumers pipeline did not break even though pact publish stage throw error/exceptionThis is surprising. There are retries in there, so maybe it eventually got through? Which tool are you using to publish?
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
if your build doesnât fail but the publish wasnât successful, you might get strange results further down the deployment pipeline that might be hard to reason aboutThis is one of the reasons why a git sha should be used in the can-i-deploy commands, and not â--latestâ
Shan
08/16/2022, 10:48 PMcan-I-deploy stage also failed in the consumer CI CD but the publish contract stage did not.Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Shan
08/16/2022, 10:48 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Shan
08/16/2022, 10:51 PMconst { Publisher } = require('@pact-foundation/pact');
const path = require('path');
const childProcess = require('child_process');
const exec = (command) => childProcess.execSync(command).toString().trim();
const gitSha = process.env.GIT_COMMIT || exec('git rev-parse HEAD');
const branch =
process.env.GIT_BRANCH || exec('git rev-parse --abbrev-ref HEAD');
const opts = {
pactFilesOrDirs: [path.resolve(process.cwd(), 'pact/pacts')],
pactBroker: process.env.PACT_BROKER_URL,
pactBrokerUsername: process.env.PACT_BROKER_BASIC_CREDENTIALS_USR,
pactBrokerPassword: process.env.PACT_BROKER_BASIC_CREDENTIALS_PSW,
consumerVersion: gitSha,
tags: [branch],
};
const publisher = new Publisher(opts)
.publishPacts()
.then(() => {
console.log('Pact contract publishing complete!');
console.log(
`Head over to ${process.env.PACT_BROKER_URL} to see your published contracts.`
);
})
.catch((e) => {
console.log('Pact contract publishing failed: ', e);
});Timothy Jones
08/16/2022, 10:51 PMBeth (pactflow.io/Pact Broker/pact-ruby)
.catch((e) => {
console.log('Pact contract publishing failed: ', e);
});Timothy Jones
08/16/2022, 10:52 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Timothy Jones
08/16/2022, 10:53 PMTimothy Jones
08/16/2022, 10:54 PMTimothy Jones
08/16/2022, 10:54 PMShan
08/16/2022, 10:56 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Timothy Jones
08/16/2022, 10:58 PMTimothy Jones
08/16/2022, 10:58 PMShan
08/16/2022, 11:03 PM