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

fix: add option to tag provider with git branch from Verify methods #209

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dsl/pact.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ func (p *Pact) VerifyMessageProviderRaw(request VerifyMessageRequest) ([]types.P
BrokerToken: request.BrokerToken,
PublishVerificationResults: request.PublishVerificationResults,
ProviderVersion: request.ProviderVersion,
TagWithGitBranch: request.TagWithGitBranch,
ProviderTags: request.ProviderTags,
Provider: p.Provider,
PactLogDir: p.LogDir,
Expand Down
7 changes: 7 additions & 0 deletions dsl/verify_mesage_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type VerifyMessageRequest struct {
// Useful for debugging issues with the framework itself
PactLogLevel string

// Tag the provider with the current git branch in the Pact Broker
TagWithGitBranch bool

// Arguments to the VerificationProvider
// Deprecated: This will be deleted after the native library replaces Ruby deps.
Args []string
Expand Down Expand Up @@ -103,5 +106,9 @@ func (v *VerifyMessageRequest) Validate() error {
v.Args = append(v.Args, "--log-level", v.PactLogLevel)
}

if v.TagWithGitBranch {
v.Args = append(v.Args, "--tag-with-git-branch", "true")
}

return nil
}
7 changes: 7 additions & 0 deletions types/verify_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ type VerifyRequest struct {
// Deprecated
Verbose bool

// Tag the provider with the current git branch in the Pact Broker
TagWithGitBranch bool

// Arguments to the VerificationProvider
// Deprecated: This will be deleted after the native library replaces Ruby deps.
Args []string
Expand Down Expand Up @@ -246,5 +249,9 @@ func (v *VerifyRequest) Validate() error {
v.Args = append(v.Args, "--log-level", v.PactLogLevel)
}

if v.TagWithGitBranch {
v.Args = append(v.Args, "--tag-with-git-branch", "true")
}

return nil
}