gitlab

package
v0.0.0-...-5cb3060 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 16 Imported by: 1

Documentation

Index

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

  1. the default branch exists
  2. 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

func (m *ProjectManager) GetSubgroupID(path string, indent int, group_ID int) (int, error)

GetSubgroupID walks the provided path, returning the Group ID of the last desired subgroup.

func (*ProjectManager) SendEmail

func (m *ProjectManager) SendEmail(to []string, from string, subject string, body string) error

SendEmail

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

Jump to

Keyboard shortcuts

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