Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: import-pact-file (v2/v3/v4 http) #29

Merged
merged 2 commits into from
Sep 13, 2024
Merged

feat: import-pact-file (v2/v3/v4 http) #29

merged 2 commits into from
Sep 13, 2024

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented May 21, 2024

fixes #10

  • Validates the following pact formats utilising https://github.com/pactflow/pact-schemas
    • V1
    • V2
    • V3
    • V4
    • ⚠️ currently possible incorrect warnings about valid matchers. Can remove matchers from schema and perform upstream changes later to https://github.com/pactflow/pact-schemas
      • Have now set matchers, matchingRules, generators to be allowed as property keys but provide no validation, and they are removed from the object mapper.
  • Processes the following interaction types
    • V2
    • V3 sync/http
    • V3 sync/http
    • V4 sync/http
    • ⚠️ TODO - explicitly detect and ignore incompatible types
      • Will filter out non "Synchronous/HTTP" interaction types for v4 pacts.
  • Creates new scoped option --base-uri / -b for user to provide url override when uploading pacts as Pact's do not contain that info
  • Creates new scoped option --ignore-pact-schema-verification-result for user to ignore the validation performed against the pact-schemas. The files may, or may not be supported if they fail validation, but allows an escape hatch, just in case it is an issue on our side to fix with the schemas

@YOU54F YOU54F marked this pull request as ready for review August 30, 2024 18:35
@YOU54F
Copy link
Member Author

YOU54F commented Aug 30, 2024

Could do with dry-ing up, but good enough for a review and able to upload all the new pact fixtures to explore

@YOU54F YOU54F changed the title feat(wip): pact file schema validation, v3 pact only atm feat: import-pact-file (v2/v3/v4 http) Aug 30, 2024
Copy link
Member

@frankkilcommins frankkilcommins left a comment

Choose a reason for hiding this comment

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

LGTM - and some of this will already be refactored with adding Pact tests.

README.md Outdated Show resolved Hide resolved
@frankkilcommins frankkilcommins added the enhancement New feature or request label Sep 10, 2024
usage:

explore-cli import-pact-file -fp <pact_file> -b http://localhost --explore-cookie "SESSION=${EXPLORE_SESSION_TOKEN}; XSRF-TOKEN=${EXPLORE_XSRF_TOKEN}"
@YOU54F YOU54F merged commit 9bf2db6 into main Sep 13, 2024
10 checks passed
YOU54F added a commit that referenced this pull request Sep 25, 2024
@YOU54F YOU54F deleted the feat/pact_files branch September 26, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import pacts files as Spaces
2 participants