원클릭으로
contract-testing-patterns
Pact consumer-driven contracts, provider verification, schema evolution
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pact consumer-driven contracts, provider verification, schema evolution
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Lambda best practices, S3 event patterns, SQS/SNS fanout, and DynamoDB access patterns for serverless AWS architectures.
Azure Functions, Cosmos DB modeling, Service Bus patterns, Bicep templates
Traffic splitting, health checks, automated rollback, progressive delivery, and canary analysis for safe deployments.
Failure injection patterns, blast radius control, steady state hypothesis, and gameday planning for resilience testing.
OpenAI Codex CLI + Claude Code (Hizir) birlikte kullanim rehberi. Is dagitim pattern'leri, GitHub Actions workflow ornekleri, review dongusu ve iki AI yazilim asistaninin guclu yanlarini birlestiren orchestration stratejileri.
Create git commits with user approval and no Claude attribution
| name | contract-testing-patterns |
| description | Pact consumer-driven contracts, provider verification, schema evolution |
const { PactV3, MatchersV3 } = require('@pact-foundation/pact');
const { like, eachLike, string, integer } = MatchersV3;
const provider = new PactV3({
consumer: 'OrderService',
provider: 'UserService',
logLevel: 'warn',
});
describe('User API Contract', () => {
it('returns user by ID', async () => {
await provider
.given('user with ID 1 exists')
.uponReceiving('a request for user 1')
.withRequest({
method: 'GET',
path: '/api/users/1',
headers: { Accept: 'application/json' },
})
.willRespondWith({
status: 200,
headers: { 'Content-Type': 'application/json' },
body: {
id: integer(1),
name: string('Jane Doe'),
email: string('jane@example.com'),
roles: eachLike('admin'),
},
})
.executeTest(async (mockServer) => {
const client = new UserClient(mockServer.url);
const user = await client.getUser(1);
expect(user.id).toBe(1);
expect(user.name).toBeDefined();
});
});
});
const { Verifier } = require('@pact-foundation/pact');
describe('User Provider Verification', () => {
it('validates consumer contracts', async () => {
const verifier = new Verifier({
providerBaseUrl: 'http://localhost:3000',
pactBrokerUrl: process.env.PACT_BROKER_URL,
pactBrokerToken: process.env.PACT_BROKER_TOKEN,
provider: 'UserService',
providerVersion: process.env.GIT_SHA,
providerVersionBranch: process.env.GIT_BRANCH,
publishVerificationResult: true,
stateHandlers: {
'user with ID 1 exists': async () => {
await db.users.create({ id: 1, name: 'Jane Doe', email: 'jane@example.com' });
},
'no users exist': async () => {
await db.users.deleteAll();
},
},
});
await verifier.verifyProvider();
});
});
# Backward Compatible (SAFE):
- Adding optional fields
- Adding new endpoints
- Widening accepted value ranges
- Adding new enum values (if consumer ignores unknown)
# Breaking Changes (UNSAFE):
- Removing fields
- Renaming fields
- Changing field types
- Making optional fields required
- Narrowing accepted value ranges
- Removing endpoints
# Before deploying consumer
pact-broker can-i-deploy \
--pacticipant OrderService \
--version $GIT_SHA \
--to-environment production
# Before deploying provider
pact-broker can-i-deploy \
--pacticipant UserService \
--version $GIT_SHA \
--to-environment production
can-i-deploy gate in CI pipeline before deploycan-i-deploy failures