utils

package
v0.0.0-...-cb3b0de Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayCommands

func DisplayCommands()

func GetCommands

func GetCommands() string

display commands as string

func GetVersion

func GetVersion() string

GetVersion returns the current version of the package

func ParseProjectName

func ParseProjectName(comment string) string

TODO move func to lib-orchestrator library after gitlab and azure moves there

func ParseRepoNamespace

func ParseRepoNamespace(namespace string) (string, string)

func ParseWorkspace

func ParseWorkspace(comment string) (string, error)

TODO move func to lib-orchestrator library after gitlab and azure moves there

Types

type Command

type Command struct {
	Name        string
	Description string
}

type MockBackendApi

type MockBackendApi struct {
}

func (MockBackendApi) ReportProject

func (t MockBackendApi) ReportProject(namespace string, projectName string, configuration string) error

func (MockBackendApi) ReportProjectJobStatus

func (t MockBackendApi) ReportProjectJobStatus(repo string, projectName string, jobId string, status string, timestamp time.Time, summary *execution.DiggerExecutorPlanResult, PrCommentUrl string, terraformOutput string) (*scheduler.SerializedBatch, error)

func (MockBackendApi) ReportProjectRun

func (t MockBackendApi) ReportProjectRun(repo string, projectName string, startedAt time.Time, endedAt time.Time, status string, command string, output string) error

type MockPlanStorage

type MockPlanStorage struct {
}

func (MockPlanStorage) DeleteStoredPlan

func (t MockPlanStorage) DeleteStoredPlan(artifactName string, storedPlanFilePath string) error

func (MockPlanStorage) PlanExists

func (t MockPlanStorage) PlanExists(artifactName string, storedPlanFilePath string) (bool, error)

func (MockPlanStorage) RetrievePlan

func (t MockPlanStorage) RetrievePlan(localPlanFilePath string, artifactName string, storedPlanFilePath string) (*string, error)

func (*MockPlanStorage) StorePlanFile

func (t *MockPlanStorage) StorePlanFile(fileContents []byte, artifactName string, fileName string) error

type MockPolicyChecker

type MockPolicyChecker struct {
}

func (MockPolicyChecker) CheckAccessPolicy

func (t MockPolicyChecker) CheckAccessPolicy(ciService orchestrator.OrgService, prService *orchestrator.PullRequestService, SCMOrganisation string, SCMrepository string, projectName string, command string, ptr *int, requestedBy string, planPolicyViolations []string) (bool, error)

func (MockPolicyChecker) CheckDriftPolicy

func (t MockPolicyChecker) CheckDriftPolicy(SCMOrganisation string, SCMrepository string, projectname string) (bool, error)

func (MockPolicyChecker) CheckPlanPolicy

func (t MockPolicyChecker) CheckPlanPolicy(projectName string, SCMOrganisation string, command string, requestedBy string) (bool, []string, error)

type MockPullRequestManager

type MockPullRequestManager struct {
	ChangedFiles []string
	Teams        []string
	Approvals    []string
}

func (*MockPullRequestManager) CreateCommentReaction

func (t *MockPullRequestManager) CreateCommentReaction(id interface{}, reaction string) error

func (MockPullRequestManager) DownloadLatestPlans

func (t MockPullRequestManager) DownloadLatestPlans(prNumber int) (string, error)

func (MockPullRequestManager) EditComment

func (t MockPullRequestManager) EditComment(prNumber int, commentId interface{}, comment string) error

func (MockPullRequestManager) GetApprovals

func (t MockPullRequestManager) GetApprovals(prNumber int) ([]string, error)

func (MockPullRequestManager) GetBranchName

func (t MockPullRequestManager) GetBranchName(prNumber int) (string, string, error)

func (MockPullRequestManager) GetChangedFiles

func (t MockPullRequestManager) GetChangedFiles(prNumber int) ([]string, error)

func (MockPullRequestManager) GetCombinedPullRequestStatus

func (t MockPullRequestManager) GetCombinedPullRequestStatus(prNumber int) (string, error)

func (MockPullRequestManager) GetComments

func (t MockPullRequestManager) GetComments(prNumber int) ([]orchestrator.Comment, error)

func (MockPullRequestManager) GetUserTeams

func (t MockPullRequestManager) GetUserTeams(organisation string, user string) ([]string, error)

func (MockPullRequestManager) IsClosed

func (t MockPullRequestManager) IsClosed(prNumber int) (bool, error)

func (MockPullRequestManager) IsMergeable

func (t MockPullRequestManager) IsMergeable(prNumber int) (bool, error)

func (MockPullRequestManager) IsMerged

func (t MockPullRequestManager) IsMerged(prNumber int) (bool, error)

func (MockPullRequestManager) ListIssues

func (t MockPullRequestManager) ListIssues() ([]*orchestrator.Issue, error)

func (MockPullRequestManager) MergePullRequest

func (t MockPullRequestManager) MergePullRequest(prNumber int) error

func (MockPullRequestManager) PublishComment

func (t MockPullRequestManager) PublishComment(prNumber int, comment string) (*orchestrator.Comment, error)

func (MockPullRequestManager) PublishIssue

func (t MockPullRequestManager) PublishIssue(title string, body string) (int64, error)

func (MockPullRequestManager) SetOutput

func (t MockPullRequestManager) SetOutput(prNumber int, key string, value string) error

func (MockPullRequestManager) SetStatus

func (t MockPullRequestManager) SetStatus(prNumber int, status string, statusContext string) error

type MockTerraform

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

func (*MockTerraform) Apply

func (tf *MockTerraform) Apply() (string, string, error)

func (*MockTerraform) Plan

func (tf *MockTerraform) Plan() (bool, string, string, error)

type Zip

type Zip interface {
	GetFileFromZip(zipFile string, filename string) (string, error)
}

type Zipper

type Zipper struct {
}

func (*Zipper) GetFileFromZip

func (z *Zipper) GetFileFromZip(zipFile string, filename string) (string, error)

Jump to

Keyboard shortcuts

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