-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
base: master
Are you sure you want to change the base?
Conversation
"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 },
uses latest-provider-pacts-with-branch relies on pact-foundation/pact_broker#728
uses latest-provider-pacts-with-branch relies on pact-foundation/pact_broker#728
lib/pact_broker/pacts/service.rb
Outdated
@@ -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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this uses
I am not super well versed with the queries so correct me if I am wrong, but I think this is old way of querying?
https://docs.pact.io/blog/2021/07/04/why-we-are-getting-rid-of-tags
instead should we try to use logic based on the below method ?
There was a problem hiding this comment.
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.
77826d3
to
35ba4d5
Compare
needs a few tests writing and hopefully good to go |
Fixes #619
Provides the following GET routes
/pacts/provider/{provider}/branch/
/pacts/provider/{provider}/branch/latest
/pacts/provider/{provider}/branch/{branch}
/pacts/provider/{provider}/branch/{branch}/latest
/pacts/provider/{provider}/consumer/{consumer}/branch
/pacts/provider/{provider}/consumer/{consumer}/branch/latest
/pacts/provider/{provider}/consumer/{consumer}/branch/{branch}
/pacts/provider/{provider}/consumer/{consumer}/branch/{branch}/latest