Documentation ¶
Index ¶
- type ProjectManager
- func (m *ProjectManager) ComplianceReady() bool
- func (m *ProjectManager) EnsureBranchesAndProtection(project gitlab.Project, dryrun bool) error
- func (m *ProjectManager) GenerateChangeLogReport() error
- func (m *ProjectManager) GenerateComplianceEmail() error
- func (m *ProjectManager) GenerateComplianceReport() error
- func (m *ProjectManager) GetError() bool
- func (m *ProjectManager) GetProjectApprovalSettings(project gitlab.Project) (*gitlab.ProjectApprovals, error)
- func (m *ProjectManager) GetProjectSettings(project gitlab.Project) (*gitlab.Project, error)
- func (m *ProjectManager) GetProjects() ([]gitlab.Project, error)
- func (m *ProjectManager) GetSubgroupID(path string, indent int, group_ID int) (int, error)
- func (m *ProjectManager) SendEmail(to []string, from string, subject string, body string) error
- func (m *ProjectManager) SetError(state bool) bool
- func (m *ProjectManager) UpdateProjectApprovalSettings(project gitlab.Project, dryrun bool) error
- func (m *ProjectManager) UpdateProjectSettings(project gitlab.Project, dryrun bool) error
- type ProjectSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProjectManager ¶
type ProjectManager struct { ApprovalSettingsOriginal map[string]*gitlab.ProjectApprovals ApprovalSettingsUpdated map[string]*gitlab.ProjectApprovals ProjectSettingsOriginal map[string]*gitlab.Project ProjectSettingsUpdated map[string]*gitlab.Project // contains filtered or unexported fields }
ProjectManager fetches a list of repositories from GitLab
func NewProjectManager ¶
func NewProjectManager( logger *logrus.Entry, groupsClient groupsClient, projectsClient projectsClient, protectedBranchesClient protectedBranchesClient, branchesClient branchesClient, config *config.Config, ) *ProjectManager
NewProjectManager returns a new ProjectManager instance
func (*ProjectManager) ComplianceReady ¶
func (m *ProjectManager) ComplianceReady() bool
ComplianceReady determines if a compliance configuration is present
func (*ProjectManager) EnsureBranchesAndProtection ¶
func (m *ProjectManager) EnsureBranchesAndProtection(project gitlab.Project, dryrun bool) error
EnsureBranchesAndProtection ensures that
- the default branch exists
- all of the protected branches are configured correctly
func (*ProjectManager) GenerateChangeLogReport ¶
func (m *ProjectManager) GenerateChangeLogReport() error
GenerateChangeLogReport to console the altered project settings
func (*ProjectManager) GenerateComplianceEmail ¶
func (m *ProjectManager) GenerateComplianceEmail() error
GenerateComplianceEmail emails the compliance state of mandatory settings
func (*ProjectManager) GenerateComplianceReport ¶
func (m *ProjectManager) GenerateComplianceReport() error
GenerateComplianceReport prints to console the compliance state of mandatory settings
func (*ProjectManager) GetError ¶
func (m *ProjectManager) GetError() bool
GetError returns the Error status
func (*ProjectManager) GetProjectApprovalSettings ¶
func (m *ProjectManager) GetProjectApprovalSettings(project gitlab.Project) (*gitlab.ProjectApprovals, error)
GetProjectMergeRequestSettings identifies the current state of a GitLab projece
func (*ProjectManager) GetProjectSettings ¶
func (m *ProjectManager) GetProjectSettings(project gitlab.Project) (*gitlab.Project, error)
GetProjectSettings gets the settings in GitLab for the provided project, using the Project API https://docs.gitlab.com/ee/api/projects.html
func (*ProjectManager) GetProjects ¶
func (m *ProjectManager) GetProjects() ([]gitlab.Project, error)
GetProjects fetches a list of accessible repos within the groups set in config file
func (*ProjectManager) GetSubgroupID ¶
GetSubgroupID walks the provided path, returning the Group ID of the last desired subgroup.
func (*ProjectManager) SetError ¶
func (m *ProjectManager) SetError(state bool) bool
SetError returns the Error status
func (*ProjectManager) UpdateProjectApprovalSettings ¶
func (m *ProjectManager) UpdateProjectApprovalSettings(project gitlab.Project, dryrun bool) error
UpdateProjectMergeRequestSettings updates the project settings on gitlab
func (*ProjectManager) UpdateProjectSettings ¶
func (m *ProjectManager) UpdateProjectSettings(project gitlab.Project, dryrun bool) error
UpdateProjectSettings updates the settings in GitLab for the provided project, using the Project API https://docs.gitlab.com/ee/api/projects.html
type ProjectSettings ¶
type ProjectSettings struct { Approval gitlab.ProjectApprovals `json:"approval_settings,omitempty"` General gitlab.Project `json:"project_settings,omitempty"` }
currentState stores current Project state for each project interacted with