Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1833 from anguswilliams/push-mirror-regexp
Browse files Browse the repository at this point in the history
Adds `mirror_branch_regex` option for project push and pull mirrors
  • Loading branch information
svanharmelen authored Nov 13, 2023
2 parents ff0b255 + fdf5310 commit 0540320
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions project_mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type ProjectMirror struct {
LastSuccessfulUpdateAt *time.Time `json:"last_successful_update_at"`
LastUpdateAt *time.Time `json:"last_update_at"`
LastUpdateStartedAt *time.Time `json:"last_update_started_at"`
MirrorBranchRegex string `json:"mirror_branch_regex"`
OnlyProtectedBranches bool `json:"only_protected_branches"`
KeepDivergentRefs bool `json:"keep_divergent_refs"`
UpdateStatus string `json:"update_status"`
Expand Down Expand Up @@ -107,8 +108,9 @@ func (s *ProjectMirrorService) GetProjectMirror(pid interface{}, mirror int, opt
type AddProjectMirrorOptions struct {
URL *string `url:"url,omitempty" json:"url,omitempty"`
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
OnlyProtectedBranches *bool `url:"only_protected_branches,omitempty" json:"only_protected_branches,omitempty"`
KeepDivergentRefs *bool `url:"keep_divergent_refs,omitempty" json:"keep_divergent_refs,omitempty"`
OnlyProtectedBranches *bool `url:"only_protected_branches,omitempty" json:"only_protected_branches,omitempty"`
MirrorBranchRegex *string `url:"mirror_branch_regex,omitempty" json:"mirror_branch_regex,omitempty"`
}

// AddProjectMirror creates a new mirror on the project.
Expand Down Expand Up @@ -142,9 +144,10 @@ func (s *ProjectMirrorService) AddProjectMirror(pid interface{}, opt *AddProject
// GitLab API docs:
// https://docs.gitlab.com/ee/api/remote_mirrors.html#update-a-remote-mirrors-attributes
type EditProjectMirrorOptions struct {
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
OnlyProtectedBranches *bool `url:"only_protected_branches,omitempty" json:"only_protected_branches,omitempty"`
KeepDivergentRefs *bool `url:"keep_divergent_refs,omitempty" json:"keep_divergent_refs,omitempty"`
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
KeepDivergentRefs *bool `url:"keep_divergent_refs,omitempty" json:"keep_divergent_refs,omitempty"`
OnlyProtectedBranches *bool `url:"only_protected_branches,omitempty" json:"only_protected_branches,omitempty"`
MirrorBranchRegex *string `url:"mirror_branch_regex,omitempty" json:"mirror_branch_regex,omitempty"`
}

// EditProjectMirror updates a project team member to a specified access level..
Expand Down
1 change: 1 addition & 0 deletions projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ type EditProjectOptions struct {
MergeRequestsTemplate *string `url:"merge_requests_template,omitempty" json:"merge_requests_template,omitempty"`
MergeTrainsEnabled *bool `url:"merge_trains_enabled,omitempty" json:"merge_trains_enabled,omitempty"`
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"`
MirrorBranchRegex *string `url:"mirror_branch_regex,omitempty" json:"mirror_branch_regex,omitempty"`
MirrorOverwritesDivergedBranches *bool `url:"mirror_overwrites_diverged_branches,omitempty" json:"mirror_overwrites_diverged_branches,omitempty"`
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"`
MirrorUserID *int `url:"mirror_user_id,omitempty" json:"mirror_user_id,omitempty"`
Expand Down

0 comments on commit 0540320

Please sign in to comment.