Open
Conversation
…der verify) - Add Pact consumer test (apps/web/pact/recipes.pact.test.ts) and publish script - Add provider verify script and pact npm bindings (apps/api) - Add docker-compose.yml for local Pact broker - Add root pact:verify helper script and Turbo pipeline tasks - Pin apps/api Python to 3.13 (.python-version) and update README accordingly - Update CI workflow, .gitignore, and vite config for Pact integration Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Introduces Pact contract testing to the monorepo, enabling an end-to-end consumer → broker publish → provider verification loop for the Recipes API, with local Docker broker support and CI wiring.
Changes:
- Added Pact consumer tests in
apps/weband scripts to publish generated pacts. - Added provider verification script + Pact CLI dependency in
apps/api. - Added a local Pact Broker via Docker Compose and a root helper script, then wired the flow into CI/Turborepo plus updated docs/ignores.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Adds Turbo tasks for Pact-related commands (cache disabled). |
| scripts/pact-verify.sh | New root helper to run the full broker up → consumer test → publish → provider verify → broker down loop. |
| README.md | Documents Pact workflow and adds pnpm pact:verify to CI description and script list. |
| pnpm-lock.yaml | Locks new @pact-foundation/pact / @pact-foundation/pact-cli dependencies. |
| PLAN.md | Marks contract testing plan items §5.1–5.3 complete. |
| package.json | Adds root Pact scripts (broker up/down, consumer test/publish, provider verify, full verify). |
| docker-compose.yml | Adds local Postgres + Pact Broker services for contract workflow. |
| apps/web/vite.config.ts | Splits Vitest into unit and pact projects (Node env for Pact tests). |
| apps/web/scripts/pact-publish.sh | New script to publish pacts to a broker with branch/version metadata. |
| apps/web/README.md | Documents consumer Pact test and publish usage. |
| apps/web/pact/recipes.pact.test.ts | Adds Pact consumer tests for /recipes and /recipes/{recipe_id} interactions. |
| apps/web/package.json | Adds pact scripts and updates test scripts to target the unit project. |
| apps/web/biome.json | Excludes generated pacts/ output from Biome. |
| apps/api/scripts/pact-provider-verify.sh | New provider verification script that can verify via broker or local pact files, starting uvicorn locally. |
| apps/api/README.md | Documents provider verification and updates venv setup example. |
| apps/api/package.json | Adds provider verify script and Pact CLI dev dependency. |
| apps/api/.python-version | Pins local Python version to 3.13 for the API package. |
| .vscode/settings.json | Adds “healthcheck” to cSpell words list. |
| .gitignore | Ignores generated pact files under apps/web/pacts/. |
| .github/workflows/ci.yml | Runs pnpm pact:verify as part of CI. |
| .cursor/rules/long-command-options.mdc | Adds guideline preferring long-form CLI flags in scripts/docs. |
| .cursor/rules/google-shell-style.mdc | Adds (optional) guideline to follow Google Shell Style Guide for Bash scripts. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export PACT_PROVIDER_HOSTNAME="${PACT_PROVIDER_HOSTNAME:-127.0.0.1}" | ||
| export PACT_PROVIDER_PORT="${PACT_PROVIDER_PORT:-8000}" | ||
| export PACT_PROVIDER_TRANSPORT="${PACT_PROVIDER_TRANSPORT:-http}" | ||
| export PACT_PROVIDER_BRANCH="${PACT_PROVIDER_BRANCH:-$(git branch --show-current)}" |
| "pact:provider-verify": "bash scripts/pact-provider-verify.sh", | ||
| "test": ".venv/bin/python -m pytest -v", | ||
| "test:coverage": "pnpm test --cov=app --cov-report=term-missing", | ||
| "postinstall": "bash -e -c 'test -d .venv || python3 -m venv .venv; .venv/bin/python -m pip install -e \".[dev]\"'" |
Comment on lines
+24
to
+25
| docker compose up --detach | ||
|
|
Comment on lines
+53
to
+57
| ./node_modules/.bin/pact-broker publish \ | ||
| "${package_root}/pacts" \ | ||
| "--consumer-app-version=${version}" \ | ||
| "--branch=${branch}" \ | ||
| "--broker-base-url=${broker_url}" |
Comment on lines
+45
to
+49
| Provider contract verification: | ||
|
|
||
| ```bash | ||
| pnpm pact:provider-verify | ||
| ``` |
Comment on lines
+60
to
+64
| resolve: { | ||
| alias: { | ||
| '@': path.resolve(__dirname, 'src'), | ||
| }, | ||
| }, |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd docs Update pyproject.toml (requires-python), pyrightconfig.json (pythonVersion), CI workflow (setup-python), and README (prerequisites + venv setup steps). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/web/pact/recipes.pact.test.ts) that generates a contract for the/recipesand/recipes/{id}endpoints, plus a publish script (apps/web/scripts/pact-publish.sh)apps/api/scripts/pact-provider-verify.sh) and the@pact-foundation/pactnpm bindings underapps/apidocker-compose.ymlto spin up a local Pact broker for the full consumer → publish → verify loopscripts/pact-verify.shhelper and wirespact:verifyinto the Turbo pipelineapps/apito Python 3.13 via.python-versionand updates the README setup instructions accordingly.gitignore, andvite.config.tsfor Pact integrationTest plan
pnpm pact:consumer-testinapps/web— contract file generated underapps/web/pacts/docker compose up --detachand runpnpm pact:publish— contract visible in broker UIpnpm pact:provider-verifyinapps/api— provider verification passes and results publishedpnpm pact:verify— full end-to-end loop (broker start → publish → verify) succeedsMade with Cursor