Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[profile.ci]
# Report every failure in one run.
fail-fast = false

# Flag tests slower than 60 s; kill them after 5 periods.
slow-timeout = { period = "60s", terminate-after = 5 }
File renamed without changes.
16 changes: 7 additions & 9 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

## Build, test, and lint commands

The main Rust workspace lives in `rust/`. Run Cargo commands there unless you are working on the compatibility suite.
The Rust workspace root is the repository root, with crates under `crates/`. Run Cargo commands there unless you are working on the compatibility suite.

```bash
cd rust

# Build and test the full workspace
cargo build
cargo test
Expand Down Expand Up @@ -35,8 +33,8 @@ cargo build --release
WASM builds are only checked for `pact_models` and `pact_matching`:

```bash
cd rust/pact_models && cargo build --target wasm32-wasip2
cd rust/pact_matching && cargo build --target wasm32-wasip2
cd crates/pact_models && cargo build --target wasm32-wasip2
cd crates/pact_matching && cargo build --target wasm32-wasip2
```

The compatibility suite is a separate crate under `compatibility-suite/` and is run independently from the main workspace:
Expand All @@ -57,7 +55,7 @@ Cross-platform MUSL builds use the project Docker image:

```bash
docker run --rm --user "$(id -u)":"$(id -g)" \
-v $(pwd):/workspace -w /workspace/rust \
-v $(pwd):/workspace -w /workspace \
-t -e TZ=UTC pactfoundation/rust-musl-build \
./scripts/ci-musl-build.sh
```
Expand Down Expand Up @@ -87,15 +85,15 @@ Key architectural boundaries:
- `pact_verifier_cli` is a thin executable wrapper over `pact_verifier`.
- `pact_ffi` exposes consumer and verifier capabilities to other languages through a C ABI.
- The mock server crates were moved to `pact-foundation/pact-core-mock-server` and are excluded from this workspace, even though some crates still depend on them as external packages.
- `compatibility-suite/` is separate from `rust/` and contains Cucumber-based spec compliance tests for Pact V1-V4.
- `compatibility-suite/` is a separate Cargo project, excluded from the workspace, and contains Cucumber-based spec compliance tests for Pact V1-V4.

## Key conventions

- Most crates use Rust edition 2024 and require Rust 1.88+. `pact_ffi` is the exception and still uses edition 2021.
- Keep dependencies aligned with the layering above. New code should normally depend "downward" into lower-level crates, not sideways or upward.
- Feature flags are intentionally propagated across crates (`datetime`, `xml`, `plugins`, `multipart`, `form_urlencoded`, `tls`, `junit`). When adding an optional capability, check whether it also needs wiring through dependent crates and target-specific builds.
- `pact_models` is patched in `rust/Cargo.toml` via `[patch.crates-io]` to the local path. Changes there automatically affect workspace crates without publishing.
- `pact_models` is patched in the root `Cargo.toml` via `[patch.crates-io]` to the local path. Changes there automatically affect workspace crates without publishing.
- Logging and test output are centered on `tracing`/`tracing-subscriber`; tests commonly use `test-log` so `RUST_LOG=debug` is useful when debugging failures.
- Common test helpers across crates are `rstest`, `expectest`, `hamcrest2`, and `pretty_assertions`. Follow those existing choices before introducing new test utilities.
- CI exercises more than the default happy path: full workspace build/test, Linux `cargo clippy`, `cargo check --no-default-features`, WASM builds for `pact_models` and `pact_matching`, and a separate run with `PACT_MATCHING_ENGINE=v2`.
- CI (`.github/workflows/test.yml`) runs on Linux, macOS and Windows: nextest plus doctests, the compatibility suite, the FFI C examples, a musl build, `cargo hack check --each-feature`, WASM builds for `pact_models` and `pact_matching`, Linux `cargo clippy`, and an advisory run with `PACT_MATCHING_ENGINE=v2`.
- Commit messages follow Conventional Changelog style (`feat:`, `fix:`, `chore:`, `refactor:`).
79 changes: 0 additions & 79 deletions .github/workflows/build-ffi.yml

This file was deleted.

100 changes: 0 additions & 100 deletions .github/workflows/build.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/compatability-suite.yml

This file was deleted.

20 changes: 14 additions & 6 deletions .github/workflows/issue-comment-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,34 @@ on:
types:
- created

permissions:
issues: write

jobs:
jira:
runs-on: ubuntu-latest
if: ${{ github.event.comment.body == '/jira ticket' }}
steps:
- run: echo ${{ github.event.comment.body }}
- env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: echo "$COMMENT_BODY"

- name: Login
uses: atlassian/gajira-login@v3
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: SearchParam
run: echo 'summary ~ ${{ toJSON(github.event.issue.title)}} AND project=${{ secrets.JIRA_PROJECT }}'
env:
ISSUE_TITLE: ${{ toJSON(github.event.issue.title) }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
run: echo "summary ~ ${ISSUE_TITLE} AND project=${JIRA_PROJECT}"

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@v0.1.0
uses: tomhjp/gh-action-jira-search@e099f122d99bf8f12707c157a98166b16498466c # v0.1.0
with:
jql: 'summary ~ ${{ toJSON(github.event.issue.title)}} AND project=${{ secrets.JIRA_PROJECT }}'

Expand All @@ -34,7 +42,7 @@ jobs:
- name: Create
id: create
if: steps.search.outputs.issue == ''
uses: atlassian/gajira-create@v3
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: Task
Expand All @@ -47,7 +55,7 @@ jobs:

- name: Add Comment
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
uses: actions/github-script@v5
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
Loading