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: add provider pacts by branch endpoints #728

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented Oct 4, 2024

Fixes #619

Provides the following GET routes

  • /pacts/provider/{provider}/branch/
    • All pacts for a provider, for any consumers main branch
  • /pacts/provider/{provider}/branch/latest
    • Latest pact for a provider, for any consumers main branch
  • /pacts/provider/{provider}/branch/{branch}
    • All pacts for a provider, for any consumers named branch
  • /pacts/provider/{provider}/branch/{branch}/latest
    • Latest pacts for a provider, for any consumers named branch
  • /pacts/provider/{provider}/consumer/{consumer}/branch
    • All pacts for a provider, for a named consumers main branch
  • /pacts/provider/{provider}/consumer/{consumer}/branch/latest
    • Latest pact for a provider, for a named consumers main branch
  • /pacts/provider/{provider}/consumer/{consumer}/branch/{branch}
    • All pacts for a provider, for a named consumers named branch
  • /pacts/provider/{provider}/consumer/{consumer}/branch/{branch}/latest
    • Latest pact for a provider, for a named consumers named branch

      "pb:latest-provider-pacts-with-branch": {
        "href": "http://localhost:9292/pacts/provider/{provider}/latest/branch/{branch}",
        "title": "Latest pacts for provider with the specified branch",
        "templated": true
      },
      "pb:provider-pacts-with-branch": {
        "href": "http://localhost:9292/pacts/provider/{provider}/branch/{branch}",
        "title": "All pact versions for the provider with the specified consumer version branch",
        "templated": true
      },
YOU54F added a commit to pactflow/swagger-mock-validator that referenced this pull request Oct 4, 2024
YOU54F added a commit to pactflow/swagger-mock-validator that referenced this pull request Oct 4, 2024
@@ -95,6 +95,10 @@ def find_latest_pacts_for_provider provider_name, options = {}
pact_repository.find_latest_pacts_for_provider provider_name, options[:tag]
end

def find_latest_pacts_for_provider_for_branch provider_name, options = {}
pact_repository.find_latest_pacts_for_provider provider_name, options[:branch]
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

ahh very good spot, appreciate the cookie trail!

# Branch pact versions

Allowed methods: `GET`

Path: `/pacts/provider/{provider}/consumer/{consumer}/branch/{branch}`

Lists all the pact versions with the specified consumer, provider and consumer version branch.

# Latest Branch pact versions

Allowed methods: `GET`

Path: `/pacts/provider/{provider}/consumer/{consumer}/branch/{branch}/latest`

Returns the latest pact version with the specified consumer, provider and consumer version branch.
@YOU54F
Copy link
Member Author

YOU54F commented Nov 15, 2024

needs a few tests writing and hopefully good to go

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.

Add route to get pacts by branch
2 participants