Documentation
¶
Index ¶
- func GetProviderFromRole(role string, region string) *stscreds.WebIdentityRoleProvider
- func GetStateAndCommandProviders(project digger_config.Project) (*stscreds.WebIdentityRoleProvider, *stscreds.WebIdentityRoleProvider)
- func IsApplyJobSpecs(jobs []JobJson) bool
- func IsApplyJobs(jobs []JobJson) bool
- func IsPlanJobSpecs(jobs []JobJson) bool
- func IsPlanJobs(jobs []Job) bool
- func JobsSpecsToProjectMap(jobSpecs []JobJson) (map[string]JobJson, error)
- func ParseProjectName(comment string) string
- type Comment
- type DiggerCommand
- type GithubAwsTokenFetcher
- type Issue
- type Job
- type JobJson
- type MockGithubPullrequestManager
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) CreateCommentReaction(id interface{}, reaction string) error
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) DownloadLatestPlans(prNumber int) (string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) EditComment(prNumber int, commentId interface{}, comment string) error
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetApprovals(prNumber int) ([]string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetBranchName(prNumber int) (string, string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetChangedFiles(prNumber int) ([]string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetCombinedPullRequestStatus(prNumber int) (string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetComments(prNumber int) ([]Comment, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetUserTeams(organisation string, user string) ([]string, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsClosed(prNumber int) (bool, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsMergeable(prNumber int) (bool, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsMerged(prNumber int) (bool, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) ListIssues() ([]*Issue, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) MergePullRequest(prNumber int) error
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishComment(prNumber int, comment string) (*Comment, error)
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishIssue(title string, body string) (int64, error)
- func (mockGithubPullrequestManager MockGithubPullrequestManager) SetOutput(prNumber int, key string, value string) error
- func (mockGithubPullrequestManager *MockGithubPullrequestManager) SetStatus(prNumber int, status string, statusContext string) error
- type OrgService
- type PullRequestComment
- type PullRequestService
- type Stage
- type StageJson
- type Step
- type StepJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProviderFromRole ¶
func GetProviderFromRole(role string, region string) *stscreds.WebIdentityRoleProvider
func GetStateAndCommandProviders ¶
func GetStateAndCommandProviders(project digger_config.Project) (*stscreds.WebIdentityRoleProvider, *stscreds.WebIdentityRoleProvider)
func IsApplyJobSpecs ¶
func IsApplyJobs ¶
func IsPlanJobSpecs ¶
func IsPlanJobs ¶
func JobsSpecsToProjectMap ¶
func ParseProjectName ¶
Types ¶
type DiggerCommand ¶
type DiggerCommand string
const DiggerCommandApply DiggerCommand = "apply"
const DiggerCommandLock DiggerCommand = "lock"
const DiggerCommandNoop DiggerCommand = "noop"
const DiggerCommandPlan DiggerCommand = "plan"
const DiggerCommandUnlock DiggerCommand = "unlock"
func GetCommandFromComment ¶
func GetCommandFromComment(comment string) (*DiggerCommand, error)
func GetCommandFromJob ¶
func GetCommandFromJob(job Job) (*DiggerCommand, error)
type GithubAwsTokenFetcher ¶
type GithubAwsTokenFetcher struct{}
func (GithubAwsTokenFetcher) GetIdentityToken ¶
func (fetcher GithubAwsTokenFetcher) GetIdentityToken() ([]byte, error)
type Job ¶
type Job struct { ProjectName string ProjectDir string ProjectWorkspace string ProjectWorkflow string Terragrunt bool OpenTofu bool Commands []string ApplyStage *Stage PlanStage *Stage PullRequestNumber *int EventName string RequestedBy string Namespace string RunEnvVars map[string]string StateEnvVars map[string]string CommandEnvVars map[string]string StateEnvProvider *stscreds.WebIdentityRoleProvider CommandEnvProvider *stscreds.WebIdentityRoleProvider }
func ConvertProjectsToJobs ¶
func ConvertProjectsToJobs(actor string, repoNamespace string, command string, prNumber int, impactedProjects []digger_config.Project, requestedProject *digger_config.Project, workflows map[string]digger_config.Workflow) ([]Job, bool, error)
func (*Job) PopulateAwsCredentialsEnvVarsForJob ¶
type JobJson ¶
type JobJson struct { JobType string `json:"job_type"` ProjectName string `json:"projectName"` ProjectDir string `json:"projectDir"` ProjectWorkspace string `json:"projectWorkspace"` Terragrunt bool `json:"terragrunt"` OpenTofu bool `json:"opentofu"` Commands []string `json:"commands"` ApplyStage StageJson `json:"applyStage"` PlanStage StageJson `json:"planStage"` PullRequestNumber *int `json:"pullRequestNumber"` Commit string `json:"commit"` Branch string `json:"branch"` EventName string `json:"eventName"` RequestedBy string `json:"requestedBy"` Namespace string `json:"namespace"` RunEnvVars map[string]string `json:"runEnvVars"` StateEnvVars map[string]string `json:"stateEnvVars"` CommandEnvVars map[string]string `json:"commandEnvVars"` AwsRoleRegion string `json:"aws_role_region"` StateRoleName string `json:"state_role_name"` CommandRoleName string `json:"command_role_name"` BackendHostname string `json:"backend_hostname"` BackendOrganisationName string `json:"backend_organisation_hostname"` BackendJobToken string `json:"backend_job_token"` }
type MockGithubPullrequestManager ¶
type MockGithubPullrequestManager struct {
// contains filtered or unexported fields
}
func (*MockGithubPullrequestManager) CreateCommentReaction ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) CreateCommentReaction(id interface{}, reaction string) error
func (*MockGithubPullrequestManager) DownloadLatestPlans ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) DownloadLatestPlans(prNumber int) (string, error)
func (*MockGithubPullrequestManager) EditComment ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) EditComment(prNumber int, commentId interface{}, comment string) error
func (*MockGithubPullrequestManager) GetApprovals ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetApprovals(prNumber int) ([]string, error)
func (*MockGithubPullrequestManager) GetBranchName ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetBranchName(prNumber int) (string, string, error)
func (*MockGithubPullrequestManager) GetChangedFiles ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetChangedFiles(prNumber int) ([]string, error)
func (*MockGithubPullrequestManager) GetCombinedPullRequestStatus ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetCombinedPullRequestStatus(prNumber int) (string, error)
func (*MockGithubPullrequestManager) GetComments ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetComments(prNumber int) ([]Comment, error)
func (*MockGithubPullrequestManager) GetUserTeams ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) GetUserTeams(organisation string, user string) ([]string, error)
func (*MockGithubPullrequestManager) IsClosed ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsClosed(prNumber int) (bool, error)
func (*MockGithubPullrequestManager) IsMergeable ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsMergeable(prNumber int) (bool, error)
func (*MockGithubPullrequestManager) IsMerged ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) IsMerged(prNumber int) (bool, error)
func (*MockGithubPullrequestManager) ListIssues ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) ListIssues() ([]*Issue, error)
func (*MockGithubPullrequestManager) MergePullRequest ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) MergePullRequest(prNumber int) error
func (*MockGithubPullrequestManager) PublishComment ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishComment(prNumber int, comment string) (*Comment, error)
func (*MockGithubPullrequestManager) PublishIssue ¶
func (mockGithubPullrequestManager *MockGithubPullrequestManager) PublishIssue(title string, body string) (int64, error)
type OrgService ¶
type PullRequestComment ¶
type PullRequestService ¶
type PullRequestService interface { GetChangedFiles(prNumber int) ([]string, error) PublishComment(prNumber int, comment string) (*Comment, error) ListIssues() ([]*Issue, error) PublishIssue(title string, body string) (int64, error) EditComment(prNumber int, id interface{}, comment string) error CreateCommentReaction(id interface{}, reaction string) error GetComments(prNumber int) ([]Comment, error) GetApprovals(prNumber int) ([]string, error) // SetStatus set status of specified pull/merge request, status could be: "pending", "failure", "success" SetStatus(prNumber int, status string, statusContext string) error GetCombinedPullRequestStatus(prNumber int) (string, error) MergePullRequest(prNumber int) error // IsMergeable is still open and ready to be merged IsMergeable(prNumber int) (bool, error) // IsMerged merged and closed IsMerged(prNumber int) (bool, error) // IsClosed closed without merging IsClosed(prNumber int) (bool, error) GetBranchName(prNumber int) (string, string, error) SetOutput(prNumber int, key string, value string) error }
type Stage ¶
type Stage struct {
Steps []Step
}
func ToConfigStage ¶
func ToConfigStage(configStage *configuration.Stage) *Stage
type Step ¶
func ToConfigStep ¶
func ToConfigStep(configState configuration.Step) Step
Click to show internal directories.
Click to hide internal directories.