Skip to content

Commit 6db543c

Browse files
authored
added escape hatch and readme (#385)
1 parent 5a0f9ff commit 6db543c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/pull-request.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- synchronize
77
- reopened
88
- ready_for_review
9+
- labeled
910
permissions:
1011
contents: write
1112
jobs:
@@ -64,6 +65,7 @@ jobs:
6465
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6566
ConsumerContractTests:
6667
runs-on: ubuntu-latest
68+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-contract-tests') }}
6769
outputs:
6870
pact_changed: ${{ steps.publish.outputs.pact_changed }}
6971
steps:
@@ -109,6 +111,7 @@ jobs:
109111
CanIDeploy:
110112
needs: ConsumerContractTests
111113
runs-on: ubuntu-latest
114+
if: needs.ConsumerContractTests.result == 'success'
112115
steps:
113116
- name: Checkout
114117
uses: actions/checkout@v4

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,28 @@ See the [monitoring & logging](docs/monitoring.md) documentation from more infor
206206

207207
Consult the [server API documentation](pkg/server/README.md) to get started.
208208

209+
## CI / Workflows
210+
211+
### Contract Testing Escape Hatch
212+
213+
The `ConsumerContractTests` and `CanIDeploy` jobs run on every PR to validate Pact consumer contracts against the broker.
214+
215+
In an emergency (e.g. hotfix where contracts need updating but can't block the merge), these jobs can be bypassed by applying the **`skip-contract-tests`** label to the PR.
216+
217+
| Scenario | ConsumerContractTests | CanIDeploy |
218+
|---|---|---|
219+
| Normal PR (no label) | runs | runs |
220+
| PR with `skip-contract-tests` label | skipped | skipped |
221+
222+
Skipped jobs show as neutral (green) in GitHub, satisfying required status checks. The label is auditable — GitHub records who added it and when.
223+
224+
**The label must be created once in repo settings:**
225+
- Name: `skip-contract-tests`
226+
- Color: `#e11d48` (red — visually alarming to discourage casual use)
227+
- Description: `Emergency: bypass pact contract tests. Use only when tests need updating but can't block a hotfix.`
228+
229+
The workflow also triggers on the `labeled` event, so adding the label to an existing PR immediately re-runs the workflow with the jobs skipped (no need to push a new commit).
230+
209231
## Development
210232

211233
Consult the [developer documentation](DEVELOPER.md) for local development instructions.

0 commit comments

Comments
 (0)