Skip to content

feat: add VERIFICATION TYPE column and align with API changes#32

Merged
Saup21 merged 7 commits intomainfrom
PACT-6374-update-can-i-deploy-text-output-2
May 5, 2026
Merged

feat: add VERIFICATION TYPE column and align with API changes#32
Saup21 merged 7 commits intomainfrom
PACT-6374-update-can-i-deploy-text-output-2

Conversation

@Saup21
Copy link
Copy Markdown
Contributor

@Saup21 Saup21 commented Apr 30, 2026

  • Add verificationType field to MatrixItem struct
  • Add VERIFICATION TYPE column to table output (shows 'CDCT', 'BDCT', or 'unknown')
  • Fix SUCCESS? column: show 'unknown' instead of 'false' when verificationResult is null
  • Added necessary tests
    PACT-6374

Saup21 and others added 3 commits April 30, 2026 14:00
- 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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 explicit null.
  • Refactored matrix-table generation into a helper and added a conditional VERIFICATION TYPE column.
  • 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.

Comment thread src/cli/pact_broker/main/can_i_deploy.rs
@Saup21 Saup21 requested a review from impurist May 4, 2026 07:47
Saup21 and others added 4 commits May 4, 2026 16:07
- 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>
@Saup21 Saup21 merged commit 07fcb39 into main May 5, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants