promote

package
v0.50.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreatePR    = "Create PR"
	CreateDraft = "Create Draft PR"
	ViewGitLog  = "View Git Log"
	Cancel      = "Cancel"
)

Variables

View Source
var Separator = strings.Repeat("—", 80)

Functions

func IsPrerelease added in v0.34.2

func IsPrerelease(release *v1alpha1.Release) bool

Types

type ChangeType added in v0.34.2

type ChangeType string
const (
	ChangeTypeUpgrade   ChangeType = "Upgrade"
	ChangeTypeDowngrade ChangeType = "Downgrade"
	ChangeTypeUpdate    ChangeType = "Update"
)

type CommitInfo added in v0.31.4

type CommitInfo struct {
	Sha          string
	ShortSha     string
	Author       string
	GitHubAuthor string
	Message      string
	ShortMessage string
}

type EnvironmentReleaseInfo added in v0.38.0

type EnvironmentReleaseInfo struct {
	*v1alpha1.Release
	DisplayVersion string
	GitTag         string
	Links          map[string]string
}

type GitProvider

type GitProvider interface {
	CreateAndPushBranchWithFiles(branchName string, files []string, message string) error
	CheckoutMasterBranch() error
}

type GitProviderMock added in v0.45.1

type GitProviderMock struct {
	// CheckoutMasterBranchFunc mocks the CheckoutMasterBranch method.
	CheckoutMasterBranchFunc func() error

	// CreateAndPushBranchWithFilesFunc mocks the CreateAndPushBranchWithFiles method.
	CreateAndPushBranchWithFilesFunc func(branchName string, files []string, message string) error
	// contains filtered or unexported fields
}

GitProviderMock is a mock implementation of GitProvider.

func TestSomethingThatUsesGitProvider(t *testing.T) {

	// make and configure a mocked GitProvider
	mockedGitProvider := &GitProviderMock{
		CheckoutMasterBranchFunc: func() error {
			panic("mock out the CheckoutMasterBranch method")
		},
		CreateAndPushBranchWithFilesFunc: func(branchName string, files []string, message string) error {
			panic("mock out the CreateAndPushBranchWithFiles method")
		},
	}

	// use mockedGitProvider in code that requires GitProvider
	// and then make assertions.

}

func (*GitProviderMock) CheckoutMasterBranch added in v0.45.1

func (mock *GitProviderMock) CheckoutMasterBranch() error

CheckoutMasterBranch calls CheckoutMasterBranchFunc.

func (*GitProviderMock) CheckoutMasterBranchCalls added in v0.45.1

func (mock *GitProviderMock) CheckoutMasterBranchCalls() []struct {
}

CheckoutMasterBranchCalls gets all the calls that were made to CheckoutMasterBranch. Check the length with:

len(mockedGitProvider.CheckoutMasterBranchCalls())

func (*GitProviderMock) CreateAndPushBranchWithFiles added in v0.45.1

func (mock *GitProviderMock) CreateAndPushBranchWithFiles(branchName string, files []string, message string) error

CreateAndPushBranchWithFiles calls CreateAndPushBranchWithFilesFunc.

func (*GitProviderMock) CreateAndPushBranchWithFilesCalls added in v0.45.1

func (mock *GitProviderMock) CreateAndPushBranchWithFilesCalls() []struct {
	BranchName string
	Files      []string
	Message    string
}

CreateAndPushBranchWithFilesCalls gets all the calls that were made to CreateAndPushBranchWithFiles. Check the length with:

len(mockedGitProvider.CreateAndPushBranchWithFilesCalls())

type InteractivePromptProvider

type InteractivePromptProvider struct {
	// contains filtered or unexported fields
}

func NewInteractivePromptProvider added in v0.47.6

func NewInteractivePromptProvider(out io.Writer) *InteractivePromptProvider

func (*InteractivePromptProvider) ConfirmAutoMergePullRequest added in v0.22.0

func (*InteractivePromptProvider) ConfirmAutoMergePullRequest() (answer bool, err error)

func (*InteractivePromptProvider) ConfirmCreatingPromotionPullRequest

func (i *InteractivePromptProvider) ConfirmCreatingPromotionPullRequest(autoMerge, draft bool) (bool, error)

func (*InteractivePromptProvider) PrintBranchCreated

func (i *InteractivePromptProvider) PrintBranchCreated(branchName, message string)

func (*InteractivePromptProvider) PrintCanceled

func (i *InteractivePromptProvider) PrintCanceled()

func (*InteractivePromptProvider) PrintCompleted

func (i *InteractivePromptProvider) PrintCompleted()

func (*InteractivePromptProvider) PrintDraftPullRequestCreated added in v0.26.0

func (i *InteractivePromptProvider) PrintDraftPullRequestCreated(url string)

func (*InteractivePromptProvider) PrintEndPreview

func (i *InteractivePromptProvider) PrintEndPreview()

func (*InteractivePromptProvider) PrintNoPromotableEnvironmentFound

func (i *InteractivePromptProvider) PrintNoPromotableEnvironmentFound(environmentsFiltered bool)

func (*InteractivePromptProvider) PrintNoPromotableReleasesFound

func (i *InteractivePromptProvider) PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)

func (*InteractivePromptProvider) PrintPullRequestCreated

func (i *InteractivePromptProvider) PrintPullRequestCreated(url string)

func (*InteractivePromptProvider) PrintReleasePreview

func (i *InteractivePromptProvider) PrintReleasePreview(targetEnvName string, releaseName string, existingTargetFile, promotedFile *yml.File) error

func (*InteractivePromptProvider) PrintSelectedNonPromotableReleases added in v0.31.2

func (i *InteractivePromptProvider) PrintSelectedNonPromotableReleases(invalidReleases, targetEnvName string)

func (*InteractivePromptProvider) PrintSelectedReleasesAlreadyInSync

func (i *InteractivePromptProvider) PrintSelectedReleasesAlreadyInSync()

func (*InteractivePromptProvider) PrintStartPreview

func (i *InteractivePromptProvider) PrintStartPreview()

func (*InteractivePromptProvider) PrintUpdatingTargetRelease

func (i *InteractivePromptProvider) PrintUpdatingTargetRelease(targetEnvName, releaseName, releaseFilePath string, isCreating bool)

func (*InteractivePromptProvider) SelectPromotionAction added in v0.48.0

func (i *InteractivePromptProvider) SelectPromotionAction() (string, error)

func (*InteractivePromptProvider) SelectReleases

func (i *InteractivePromptProvider) SelectReleases(list cross.ReleaseList, maxColumnWidth int) (cross.ReleaseList, error)

func (*InteractivePromptProvider) SelectSourceEnvironment

func (i *InteractivePromptProvider) SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

func (*InteractivePromptProvider) SelectTargetEnvironment

func (i *InteractivePromptProvider) SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

type Opts

type Opts struct {
	// Catalog contains candidate environments and releases to promote.
	Catalog *catalog.Catalog

	// SourceEnv is the source environment to promote from.
	SourceEnv *v1alpha1.Environment

	// TargetEnv is the target environment to promote to.
	TargetEnv *v1alpha1.Environment

	// Releases are the already selected releases.
	// If there is more than one, no need to prompt the user to select releases.
	Releases []string

	ReleasesFiltered bool

	// NoPrompt means that the Promote function should avoid interactive prompts at all costs.
	NoPrompt bool

	// AutoMerge indicates if PR created needs the auto-merge label
	AutoMerge bool

	// All tells the promotion to select all available releases
	All bool

	// Omit is the list of releases to be omitted from selection, useful for combining with all
	Omit []string

	// KeepPrerelease indicates that prereleases in target environments must not be promoted to
	KeepPrerelease bool

	// Draft indicates if PR created needs to be draft
	Draft bool

	// SelectedEnvironments is the list of environments selected by the user interactively via `joy env select`.
	SelectedEnvironments []*v1alpha1.Environment

	// DryRun indicates if the promotion should be performed in dry-run mode
	DryRun bool

	// LocalOnly indicates if the promotion should only write the promotion changes to the working tree without creating a branch, commit or pull request.
	LocalOnly bool

	MaxColumnWidth int
}

type PerformOpts added in v0.31.4

type PerformOpts struct {
	// contains filtered or unexported fields
}

type Promotion

type Promotion struct {
	PromptProvider      PromptProvider
	GitProvider         GitProvider
	PullRequestProvider pr.PullRequestProvider
	YamlWriter          yml.Writer
	CommitTemplate      string
	PullRequestTemplate string
	TemplateVariables   map[string]string
	InfoProvider        info.Provider
	LinksProvider       links.Provider
	Out                 io.Writer
}

func (*Promotion) Promote

func (p *Promotion) Promote(opts Opts) (string, error)

Promote prompts user to select source and target environments and releases to promote and creates a pull request, returning its URL if any.

type PromotionInfo added in v0.31.4

type PromotionInfo struct {
	SourceEnvironment *v1alpha1.Environment
	TargetEnvironment *v1alpha1.Environment
	Releases          []*ReleaseInfo
	Variables         map[string]string
	Error             error
}

type PromptProvider

type PromptProvider interface {
	// SelectSourceEnvironment prompts user to select source environment to promote from.
	SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

	// SelectTargetEnvironment prompts user to select target environment to promote to.
	SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

	// SelectReleases prompts user to select releases to promote.
	SelectReleases(list cross.ReleaseList, maxColumnWidth int) (cross.ReleaseList, error)

	// ConfirmCreatingPromotionPullRequest prompts user to confirm whether to continue creating promotion pull request
	// or abort.
	ConfirmCreatingPromotionPullRequest(autoMerge, draft bool) (bool, error)

	// SelectPromotionAction prompts user to select state of promotion PR
	// or abort.
	SelectPromotionAction() (string, error)

	// ConfirmAutoMergePullRequest prompts user to confirm whether to auto-merge promotion PR or not
	ConfirmAutoMergePullRequest() (bool, error)

	// PrintNoPromotableReleasesFound prints message that no promotable releases were found for given
	// source and target environments or potentially none because release filtering was applied.
	PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)

	// PrintNoPromotableEnvironmentFound prints message that no promotable environments were found
	// or potentially none because environment filtering was applied.
	PrintNoPromotableEnvironmentFound(environmentsFiltered bool)

	// PrintStartPreview starts the preview of release promotion diffs.
	PrintStartPreview()

	// PrintReleasePreview prints the diff for promotion of a given release.
	PrintReleasePreview(targetEnvName string, releaseName string, existingTargetFile, promotedFile *yml.File) error

	// PrintEndPreview ends the preview of release promotion diffs.
	PrintEndPreview()

	// PrintUpdatingTargetRelease prints message that target release file is being updated or created.
	PrintUpdatingTargetRelease(targetEnvName, releaseName, releaseFilePath string, isCreating bool)

	// PrintBranchCreated prints message that a new promotion branch was created and promotion changes were committed
	// and pushed.
	PrintBranchCreated(branchName, message string)

	// PrintDraftPullRequestCreated prints message that a new promotion draft pull request was created.
	PrintDraftPullRequestCreated(url string)

	// PrintPullRequestCreated prints message that a new promotion pull request was created.
	PrintPullRequestCreated(url string)

	// PrintCanceled prints message that promotion was canceled and no pull request was created.
	PrintCanceled()

	// PrintCompleted prints message that the whole promotion operation was completed.
	PrintCompleted()

	// PrintSelectedNonPromotableReleases prints message that non-promotable releases were selected.
	PrintSelectedNonPromotableReleases(invalidReleases, targetEnvName string)
}

type PromptProviderMock added in v0.45.1

type PromptProviderMock struct {
	// ConfirmAutoMergePullRequestFunc mocks the ConfirmAutoMergePullRequest method.
	ConfirmAutoMergePullRequestFunc func() (bool, error)

	// ConfirmCreatingPromotionPullRequestFunc mocks the ConfirmCreatingPromotionPullRequest method.
	ConfirmCreatingPromotionPullRequestFunc func(autoMerge bool, draft bool) (bool, error)

	// PrintBranchCreatedFunc mocks the PrintBranchCreated method.
	PrintBranchCreatedFunc func(branchName string, message string)

	// PrintCanceledFunc mocks the PrintCanceled method.
	PrintCanceledFunc func()

	// PrintCompletedFunc mocks the PrintCompleted method.
	PrintCompletedFunc func()

	// PrintDraftPullRequestCreatedFunc mocks the PrintDraftPullRequestCreated method.
	PrintDraftPullRequestCreatedFunc func(url string)

	// PrintEndPreviewFunc mocks the PrintEndPreview method.
	PrintEndPreviewFunc func()

	// PrintNoPromotableEnvironmentFoundFunc mocks the PrintNoPromotableEnvironmentFound method.
	PrintNoPromotableEnvironmentFoundFunc func(environmentsFiltered bool)

	// PrintNoPromotableReleasesFoundFunc mocks the PrintNoPromotableReleasesFound method.
	PrintNoPromotableReleasesFoundFunc func(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)

	// PrintPullRequestCreatedFunc mocks the PrintPullRequestCreated method.
	PrintPullRequestCreatedFunc func(url string)

	// PrintReleasePreviewFunc mocks the PrintReleasePreview method.
	PrintReleasePreviewFunc func(targetEnvName string, releaseName string, existingTargetFile *yml.File, promotedFile *yml.File) error

	// PrintSelectedNonPromotableReleasesFunc mocks the PrintSelectedNonPromotableReleases method.
	PrintSelectedNonPromotableReleasesFunc func(invalidReleases string, targetEnvName string)

	// PrintStartPreviewFunc mocks the PrintStartPreview method.
	PrintStartPreviewFunc func()

	// PrintUpdatingTargetReleaseFunc mocks the PrintUpdatingTargetRelease method.
	PrintUpdatingTargetReleaseFunc func(targetEnvName string, releaseName string, releaseFilePath string, isCreating bool)

	// SelectPromotionActionFunc mocks the SelectPromotionAction method.
	SelectPromotionActionFunc func() (string, error)

	// SelectReleasesFunc mocks the SelectReleases method.
	SelectReleasesFunc func(list cross.ReleaseList, maxColumnWidth int) (cross.ReleaseList, error)

	// SelectSourceEnvironmentFunc mocks the SelectSourceEnvironment method.
	SelectSourceEnvironmentFunc func(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

	// SelectTargetEnvironmentFunc mocks the SelectTargetEnvironment method.
	SelectTargetEnvironmentFunc func(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)
	// contains filtered or unexported fields
}

PromptProviderMock is a mock implementation of PromptProvider.

func TestSomethingThatUsesPromptProvider(t *testing.T) {

	// make and configure a mocked PromptProvider
	mockedPromptProvider := &PromptProviderMock{
		ConfirmAutoMergePullRequestFunc: func() (bool, error) {
			panic("mock out the ConfirmAutoMergePullRequest method")
		},
		ConfirmCreatingPromotionPullRequestFunc: func(autoMerge bool, draft bool) (bool, error) {
			panic("mock out the ConfirmCreatingPromotionPullRequest method")
		},
		PrintBranchCreatedFunc: func(branchName string, message string)  {
			panic("mock out the PrintBranchCreated method")
		},
		PrintCanceledFunc: func()  {
			panic("mock out the PrintCanceled method")
		},
		PrintCompletedFunc: func()  {
			panic("mock out the PrintCompleted method")
		},
		PrintDraftPullRequestCreatedFunc: func(url string)  {
			panic("mock out the PrintDraftPullRequestCreated method")
		},
		PrintEndPreviewFunc: func()  {
			panic("mock out the PrintEndPreview method")
		},
		PrintNoPromotableEnvironmentFoundFunc: func(environmentsFiltered bool)  {
			panic("mock out the PrintNoPromotableEnvironmentFound method")
		},
		PrintNoPromotableReleasesFoundFunc: func(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)  {
			panic("mock out the PrintNoPromotableReleasesFound method")
		},
		PrintPullRequestCreatedFunc: func(url string)  {
			panic("mock out the PrintPullRequestCreated method")
		},
		PrintReleasePreviewFunc: func(targetEnvName string, releaseName string, existingTargetFile *yml.File, promotedFile *yml.File) error {
			panic("mock out the PrintReleasePreview method")
		},
		PrintSelectedNonPromotableReleasesFunc: func(invalidReleases string, targetEnvName string)  {
			panic("mock out the PrintSelectedNonPromotableReleases method")
		},
		PrintStartPreviewFunc: func()  {
			panic("mock out the PrintStartPreview method")
		},
		PrintUpdatingTargetReleaseFunc: func(targetEnvName string, releaseName string, releaseFilePath string, isCreating bool)  {
			panic("mock out the PrintUpdatingTargetRelease method")
		},
		SelectPromotionActionFunc: func() (string, error) {
			panic("mock out the SelectPromotionAction method")
		},
		SelectReleasesFunc: func(list cross.ReleaseList, maxColumnWidth int) (cross.ReleaseList, error) {
			panic("mock out the SelectReleases method")
		},
		SelectSourceEnvironmentFunc: func(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error) {
			panic("mock out the SelectSourceEnvironment method")
		},
		SelectTargetEnvironmentFunc: func(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error) {
			panic("mock out the SelectTargetEnvironment method")
		},
	}

	// use mockedPromptProvider in code that requires PromptProvider
	// and then make assertions.

}

func (*PromptProviderMock) ConfirmAutoMergePullRequest added in v0.45.1

func (mock *PromptProviderMock) ConfirmAutoMergePullRequest() (bool, error)

ConfirmAutoMergePullRequest calls ConfirmAutoMergePullRequestFunc.

func (*PromptProviderMock) ConfirmAutoMergePullRequestCalls added in v0.45.1

func (mock *PromptProviderMock) ConfirmAutoMergePullRequestCalls() []struct {
}

ConfirmAutoMergePullRequestCalls gets all the calls that were made to ConfirmAutoMergePullRequest. Check the length with:

len(mockedPromptProvider.ConfirmAutoMergePullRequestCalls())

func (*PromptProviderMock) ConfirmCreatingPromotionPullRequest added in v0.45.1

func (mock *PromptProviderMock) ConfirmCreatingPromotionPullRequest(autoMerge bool, draft bool) (bool, error)

ConfirmCreatingPromotionPullRequest calls ConfirmCreatingPromotionPullRequestFunc.

func (*PromptProviderMock) ConfirmCreatingPromotionPullRequestCalls added in v0.45.1

func (mock *PromptProviderMock) ConfirmCreatingPromotionPullRequestCalls() []struct {
	AutoMerge bool
	Draft     bool
}

ConfirmCreatingPromotionPullRequestCalls gets all the calls that were made to ConfirmCreatingPromotionPullRequest. Check the length with:

len(mockedPromptProvider.ConfirmCreatingPromotionPullRequestCalls())

func (*PromptProviderMock) PrintBranchCreated added in v0.45.1

func (mock *PromptProviderMock) PrintBranchCreated(branchName string, message string)

PrintBranchCreated calls PrintBranchCreatedFunc.

func (*PromptProviderMock) PrintBranchCreatedCalls added in v0.45.1

func (mock *PromptProviderMock) PrintBranchCreatedCalls() []struct {
	BranchName string
	Message    string
}

PrintBranchCreatedCalls gets all the calls that were made to PrintBranchCreated. Check the length with:

len(mockedPromptProvider.PrintBranchCreatedCalls())

func (*PromptProviderMock) PrintCanceled added in v0.45.1

func (mock *PromptProviderMock) PrintCanceled()

PrintCanceled calls PrintCanceledFunc.

func (*PromptProviderMock) PrintCanceledCalls added in v0.45.1

func (mock *PromptProviderMock) PrintCanceledCalls() []struct {
}

PrintCanceledCalls gets all the calls that were made to PrintCanceled. Check the length with:

len(mockedPromptProvider.PrintCanceledCalls())

func (*PromptProviderMock) PrintCompleted added in v0.45.1

func (mock *PromptProviderMock) PrintCompleted()

PrintCompleted calls PrintCompletedFunc.

func (*PromptProviderMock) PrintCompletedCalls added in v0.45.1

func (mock *PromptProviderMock) PrintCompletedCalls() []struct {
}

PrintCompletedCalls gets all the calls that were made to PrintCompleted. Check the length with:

len(mockedPromptProvider.PrintCompletedCalls())

func (*PromptProviderMock) PrintDraftPullRequestCreated added in v0.45.1

func (mock *PromptProviderMock) PrintDraftPullRequestCreated(url string)

PrintDraftPullRequestCreated calls PrintDraftPullRequestCreatedFunc.

func (*PromptProviderMock) PrintDraftPullRequestCreatedCalls added in v0.45.1

func (mock *PromptProviderMock) PrintDraftPullRequestCreatedCalls() []struct {
	URL string
}

PrintDraftPullRequestCreatedCalls gets all the calls that were made to PrintDraftPullRequestCreated. Check the length with:

len(mockedPromptProvider.PrintDraftPullRequestCreatedCalls())

func (*PromptProviderMock) PrintEndPreview added in v0.45.1

func (mock *PromptProviderMock) PrintEndPreview()

PrintEndPreview calls PrintEndPreviewFunc.

func (*PromptProviderMock) PrintEndPreviewCalls added in v0.45.1

func (mock *PromptProviderMock) PrintEndPreviewCalls() []struct {
}

PrintEndPreviewCalls gets all the calls that were made to PrintEndPreview. Check the length with:

len(mockedPromptProvider.PrintEndPreviewCalls())

func (*PromptProviderMock) PrintNoPromotableEnvironmentFound added in v0.45.1

func (mock *PromptProviderMock) PrintNoPromotableEnvironmentFound(environmentsFiltered bool)

PrintNoPromotableEnvironmentFound calls PrintNoPromotableEnvironmentFoundFunc.

func (*PromptProviderMock) PrintNoPromotableEnvironmentFoundCalls added in v0.45.1

func (mock *PromptProviderMock) PrintNoPromotableEnvironmentFoundCalls() []struct {
	EnvironmentsFiltered bool
}

PrintNoPromotableEnvironmentFoundCalls gets all the calls that were made to PrintNoPromotableEnvironmentFound. Check the length with:

len(mockedPromptProvider.PrintNoPromotableEnvironmentFoundCalls())

func (*PromptProviderMock) PrintNoPromotableReleasesFound added in v0.45.1

func (mock *PromptProviderMock) PrintNoPromotableReleasesFound(releasesFiltered bool, sourceEnv *v1alpha1.Environment, targetEnv *v1alpha1.Environment)

PrintNoPromotableReleasesFound calls PrintNoPromotableReleasesFoundFunc.

func (*PromptProviderMock) PrintNoPromotableReleasesFoundCalls added in v0.45.1

func (mock *PromptProviderMock) PrintNoPromotableReleasesFoundCalls() []struct {
	ReleasesFiltered bool
	SourceEnv        *v1alpha1.Environment
	TargetEnv        *v1alpha1.Environment
}

PrintNoPromotableReleasesFoundCalls gets all the calls that were made to PrintNoPromotableReleasesFound. Check the length with:

len(mockedPromptProvider.PrintNoPromotableReleasesFoundCalls())

func (*PromptProviderMock) PrintPullRequestCreated added in v0.45.1

func (mock *PromptProviderMock) PrintPullRequestCreated(url string)

PrintPullRequestCreated calls PrintPullRequestCreatedFunc.

func (*PromptProviderMock) PrintPullRequestCreatedCalls added in v0.45.1

func (mock *PromptProviderMock) PrintPullRequestCreatedCalls() []struct {
	URL string
}

PrintPullRequestCreatedCalls gets all the calls that were made to PrintPullRequestCreated. Check the length with:

len(mockedPromptProvider.PrintPullRequestCreatedCalls())

func (*PromptProviderMock) PrintReleasePreview added in v0.45.1

func (mock *PromptProviderMock) PrintReleasePreview(targetEnvName string, releaseName string, existingTargetFile *yml.File, promotedFile *yml.File) error

PrintReleasePreview calls PrintReleasePreviewFunc.

func (*PromptProviderMock) PrintReleasePreviewCalls added in v0.45.1

func (mock *PromptProviderMock) PrintReleasePreviewCalls() []struct {
	TargetEnvName      string
	ReleaseName        string
	ExistingTargetFile *yml.File
	PromotedFile       *yml.File
}

PrintReleasePreviewCalls gets all the calls that were made to PrintReleasePreview. Check the length with:

len(mockedPromptProvider.PrintReleasePreviewCalls())

func (*PromptProviderMock) PrintSelectedNonPromotableReleases added in v0.45.1

func (mock *PromptProviderMock) PrintSelectedNonPromotableReleases(invalidReleases string, targetEnvName string)

PrintSelectedNonPromotableReleases calls PrintSelectedNonPromotableReleasesFunc.

func (*PromptProviderMock) PrintSelectedNonPromotableReleasesCalls added in v0.45.1

func (mock *PromptProviderMock) PrintSelectedNonPromotableReleasesCalls() []struct {
	InvalidReleases string
	TargetEnvName   string
}

PrintSelectedNonPromotableReleasesCalls gets all the calls that were made to PrintSelectedNonPromotableReleases. Check the length with:

len(mockedPromptProvider.PrintSelectedNonPromotableReleasesCalls())

func (*PromptProviderMock) PrintStartPreview added in v0.45.1

func (mock *PromptProviderMock) PrintStartPreview()

PrintStartPreview calls PrintStartPreviewFunc.

func (*PromptProviderMock) PrintStartPreviewCalls added in v0.45.1

func (mock *PromptProviderMock) PrintStartPreviewCalls() []struct {
}

PrintStartPreviewCalls gets all the calls that were made to PrintStartPreview. Check the length with:

len(mockedPromptProvider.PrintStartPreviewCalls())

func (*PromptProviderMock) PrintUpdatingTargetRelease added in v0.45.1

func (mock *PromptProviderMock) PrintUpdatingTargetRelease(targetEnvName string, releaseName string, releaseFilePath string, isCreating bool)

PrintUpdatingTargetRelease calls PrintUpdatingTargetReleaseFunc.

func (*PromptProviderMock) PrintUpdatingTargetReleaseCalls added in v0.45.1

func (mock *PromptProviderMock) PrintUpdatingTargetReleaseCalls() []struct {
	TargetEnvName   string
	ReleaseName     string
	ReleaseFilePath string
	IsCreating      bool
}

PrintUpdatingTargetReleaseCalls gets all the calls that were made to PrintUpdatingTargetRelease. Check the length with:

len(mockedPromptProvider.PrintUpdatingTargetReleaseCalls())

func (*PromptProviderMock) SelectPromotionAction added in v0.48.0

func (mock *PromptProviderMock) SelectPromotionAction() (string, error)

SelectPromotionAction calls SelectPromotionActionFunc.

func (*PromptProviderMock) SelectPromotionActionCalls added in v0.48.0

func (mock *PromptProviderMock) SelectPromotionActionCalls() []struct {
}

SelectPromotionActionCalls gets all the calls that were made to SelectPromotionAction. Check the length with:

len(mockedPromptProvider.SelectPromotionActionCalls())

func (*PromptProviderMock) SelectReleases added in v0.45.1

func (mock *PromptProviderMock) SelectReleases(list cross.ReleaseList, maxColumnWidth int) (cross.ReleaseList, error)

SelectReleases calls SelectReleasesFunc.

func (*PromptProviderMock) SelectReleasesCalls added in v0.45.1

func (mock *PromptProviderMock) SelectReleasesCalls() []struct {
	List           cross.ReleaseList
	MaxColumnWidth int
}

SelectReleasesCalls gets all the calls that were made to SelectReleases. Check the length with:

len(mockedPromptProvider.SelectReleasesCalls())

func (*PromptProviderMock) SelectSourceEnvironment added in v0.45.1

func (mock *PromptProviderMock) SelectSourceEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

SelectSourceEnvironment calls SelectSourceEnvironmentFunc.

func (*PromptProviderMock) SelectSourceEnvironmentCalls added in v0.45.1

func (mock *PromptProviderMock) SelectSourceEnvironmentCalls() []struct {
	Environments []*v1alpha1.Environment
}

SelectSourceEnvironmentCalls gets all the calls that were made to SelectSourceEnvironment. Check the length with:

len(mockedPromptProvider.SelectSourceEnvironmentCalls())

func (*PromptProviderMock) SelectTargetEnvironment added in v0.45.1

func (mock *PromptProviderMock) SelectTargetEnvironment(environments []*v1alpha1.Environment) (*v1alpha1.Environment, error)

SelectTargetEnvironment calls SelectTargetEnvironmentFunc.

func (*PromptProviderMock) SelectTargetEnvironmentCalls added in v0.45.1

func (mock *PromptProviderMock) SelectTargetEnvironmentCalls() []struct {
	Environments []*v1alpha1.Environment
}

SelectTargetEnvironmentCalls gets all the calls that were made to SelectTargetEnvironment. Check the length with:

len(mockedPromptProvider.SelectTargetEnvironmentCalls())

type ReleaseInfo added in v0.31.4

type ReleaseInfo struct {
	Name         string
	Project      *v1alpha1.Project
	Reviewers    []string
	Repository   string
	Source       EnvironmentReleaseInfo
	Target       EnvironmentReleaseInfo
	OlderGitTag  string
	NewerGitTag  string
	IsPrerelease bool
	ChangeType   ChangeType
	Commits      []*CommitInfo
	Error        error
}

type ShellGitProvider

type ShellGitProvider struct {
	// contains filtered or unexported fields
}

func NewShellGitProvider

func NewShellGitProvider(dir string) *ShellGitProvider

func (*ShellGitProvider) CheckoutMasterBranch

func (g *ShellGitProvider) CheckoutMasterBranch() error

func (*ShellGitProvider) CreateAndPushBranchWithFiles

func (g *ShellGitProvider) CreateAndPushBranchWithFiles(branchName string, files []string, message string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL