Skip to content

Commit

Permalink
Merge pull request #1759 from ealesjordan/check-latest-on-main-branch
Browse files Browse the repository at this point in the history
Issue 1758 - Add latest flag when comparing to the main branch
  • Loading branch information
rholshausen authored Jan 17, 2024
2 parents bcadfde + 51f9b58 commit 51762bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ open class PactBrokerClient(

if (to.mainBranch == true) {
params.add("mainBranch" to "true")
params.add("latest" to "true")
} else if (to.environment.isNullOrEmpty() && to.tag.isNullOrEmpty()) {
params.add("latest" to "true")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,9 @@ class PactBrokerClientSpec extends Specification {
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env1', false) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1'
'Test' | '' | new Latest.UseLatest(true) | new To('tag1', 'env1', false) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1&latest=true&tag=tag1'
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env 1', false) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env+1'
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1&mainBranch=true'
'Test' | '' | new Latest.UseLatest(true) | new To('tag1', 'env1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1&latest=true&tag=tag1&mainBranch=true'
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env 1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env+1&mainBranch=true'
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1&mainBranch=true&latest=true'
'Test' | '' | new Latest.UseLatest(true) | new To('tag1', 'env1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env1&latest=true&tag=tag1&mainBranch=true&latest=true'
'Test' | '' | new Latest.UseLatest(true) | new To(null, 'env 1', true) | [] || 'q[][pacticipant]=Test&latestby=cvp&q[][latest]=true&environment=env+1&mainBranch=true&latest=true'
}

@Issue('#1511')
Expand Down

0 comments on commit 51762bd

Please sign in to comment.