Skip to content

Commit

Permalink
feat: support provider branch. Fixes #180
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Nov 8, 2021
1 parent 2be2cde commit 90519ac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

var Version = "v2.0.0-beta.8"
var Version = "v2.0.0-beta.9"
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of Pact Go",
Expand Down
4 changes: 2 additions & 2 deletions installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ const (
var packages = map[string]packageInfo{
FFIPackage: {
libName: "libpact_ffi",
version: "0.0.0",
semverRange: ">= 0.0.0, < 1.0.0",
version: "0.1.0",
semverRange: ">= 0.1.0, < 1.0.0",
},
}

Expand Down
1 change: 1 addition & 0 deletions provider/http_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (v *HTTPVerifier) verifyProviderRaw(request VerifyRequest, writer outputWri
Provider: request.Provider,
ProviderStatesSetupURL: setupURL,
ProviderTags: request.ProviderTags,
ProviderBranch: request.ProviderBranch,
// CustomProviderHeaders: request.CustomProviderHeaders,
ConsumerVersionSelectors: request.ConsumerVersionSelectors,
EnablePending: request.EnablePending,
Expand Down
7 changes: 7 additions & 0 deletions provider/verify_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ type VerifyRequest struct {
// Tags to apply to the provider application version
ProviderTags []string

// Branch to apply to the provider application version
ProviderBranch string

// ProviderStatesSetupURL is the endpoint to post current provider state
// to on the Provider API.
// Deprecated: For backward compatibility ProviderStatesSetupURL is
Expand Down Expand Up @@ -259,6 +262,10 @@ func (v *VerifyRequest) validate() error {
v.args = append(v.args, "--provider-tags", strings.Join(v.ProviderTags, ","))
}

if v.ProviderBranch != "" {
v.args = append(v.args, "--provider-branch", v.ProviderBranch)
}

v.args = append(v.args, "--loglevel", strings.ToLower(string(logging.LogLevel())))

if len(v.Tags) > 0 {
Expand Down

0 comments on commit 90519ac

Please sign in to comment.