feat: add VERIFICATION TYPE column and align with API changes#32
Merged
feat: add VERIFICATION TYPE column and align with API changes#32
Conversation
- Add verificationType field to MatrixItem struct - Add VERIFICATION TYPE column to table output (shows 'Pact', 'BDCT', or 'unknown') - Fix SUCCESS? column: show 'unknown' instead of 'false' when verificationResult is null - Extract build_matrix_table as production function, remove duplicated test helper - Update test fixtures to reflect API now sends verificationType: null (not absent) when verificationResult is null - Rename null-verification tests from _absent to _null to match API semantics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onse - Use Option<Option<String>> with custom deserializer to distinguish between key absent (PactBroker - hide column) and key present with null value (Pactflow with no verification - show column, blank cell) - Rename Pact -> CDCT to align with pactflow-application changes - Add tests for column visibility based on key presence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the verificationType key is present in the JSON response (Pactflow API) but has a null value (no verification executed), the table now displays 'unknown' instead of a blank cell. Updated the test to assert this behavior.
There was a problem hiding this comment.
Pull request overview
This PR updates can-i-deploy matrix rendering to handle the broker's new verificationType field and to distinguish unknown verification outcomes from explicit failures. It fits into the CLI's compatibility-matrix output path, where broker responses are parsed and rendered for end users.
Changes:
- Added deserialization support for
verificationType, including preserving the distinction between an absent key and an explicitnull. - Refactored matrix-table generation into a helper and added a conditional
VERIFICATION TYPEcolumn. - Expanded tests around table rendering for present/absent/null verification types and unknown verification results.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/fixtures/matrix.json |
Updates the shared matrix fixture to include a verificationType value. |
src/cli/pact_broker/main/can_i_deploy.rs |
Adds verificationType parsing, extracts table-building logic, updates SUCCESS? handling, and adds rendering tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Rename shows_cross_contract_verification_type to shows_bdct_verification_type - Add shows_cdct_verification_type to cover classic pact verification type Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…pact verificationType is a PactFlow-only field. Including it in the shared matrix.json fixture caused pact verifications against the open-source Pact Broker to fail because it does not return that field. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add pactflow_matrix.json fixture covering CDCT, BDCT, and null verification types - Add returns_matrix_with_verification_type_from_pactflow pact test against PactFlow provider - Rename matrix.json to pact_broker_matrix.json for clarity Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…body Aligns method name with its fixture (pact_broker_matrix.json) making the pact_broker/pactflow pairing explicit and consistent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YOU54F
approved these changes
May 5, 2026
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.
PACT-6374