mergepolicy

package
v0.201.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mergepolicy owns fleet policy inspection and durable mutation operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchInspection

type BranchInspection struct {
	ProtectionSHA string
	RulesSHA      string
	ClassicBody   []byte
	ClassicLinear bool
	Conflicts     []string
	Rules         []githubEffectiveRule
}

type Dependencies

type Dependencies struct {
	AuthUser   func() (string, error)
	MemberOrgs func() ([]string, error)
	ListRemote func(string) ([]discover.Repo, error)
	Discover   func(root, filter string, Owners, Repositories []string, IncludeUser bool) ([]discover.Repo, error)
	Read       func(ctx context.Context, endpoint string) ([]byte, error)
	Execute    func(ctx context.Context, args ...string) githubobserver.CommandResponse
	Persist    func(Report) error
	NewTicker  func(time.Duration) (<-chan time.Time, func())
}

Dependencies are immutable bindings copied into one policy service.

type Desired

type Desired struct {
	AllowMergeCommit bool   `json:"allow_merge_commit"`
	AllowSquashMerge bool   `json:"allow_squash_merge"`
	AllowRebaseMerge bool   `json:"allow_rebase_merge"`
	MergeCommitTitle string `json:"merge_commit_title"`
	MergeCommitBody  string `json:"merge_commit_message"`
}

type Options

type Options struct {
	Apply        bool
	IncludeUser  bool
	Owners       []string
	Parallel     int
	Repositories []string
	ReportDir    string
	Resume       bool
}

type Report

type Report struct {
	SchemaVersion int             `json:"schema_version"`
	Mode          string          `json:"mode"`
	Desired       Desired         `json:"desired"`
	Repositories  []Repository    `json:"repositories"`
	Rulesets      []RulesetChange `json:"rulesets,omitempty"`
	Summary       Summary         `json:"summary"`
	ReportPath    string          `json:"report_path,omitempty"`
}

type Repository

type Repository struct {
	Repository     string    `json:"repository"`
	DefaultBranch  string    `json:"default_branch,omitempty"`
	Disposition    string    `json:"disposition"`
	Drift          []string  `json:"drift,omitempty"`
	Conflicts      []string  `json:"conflicts,omitempty"`
	Rulesets       []RuleRef `json:"rulesets,omitempty"`
	ObservedSHA    string    `json:"observed_sha,omitempty"`
	ProtectionSHA  string    `json:"protection_sha,omitempty"`
	RulesSHA       string    `json:"rules_sha,omitempty"`
	ClassicLinear  bool      `json:"classic_required_linear_history,omitempty"`
	AppliedActions []string  `json:"applied_actions,omitempty"`
	Error          string    `json:"error,omitempty"`
}

type Request

type Request struct {
	Scope
	Options
}

type RuleRef

type RuleRef struct {
	Type       string   `json:"type"`
	SourceType string   `json:"source_type"`
	Source     string   `json:"source"`
	ID         int64    `json:"id"`
	Methods    []string `json:"allowed_merge_methods,omitempty"`
}

type RulesetChange

type RulesetChange struct {
	SourceType   string   `json:"source_type"`
	Source       string   `json:"source"`
	ID           int64    `json:"id"`
	Repositories []string `json:"selected_repositories"`
	Disposition  string   `json:"disposition"`
	ObservedSHA  string   `json:"observed_sha,omitempty"`
	Error        string   `json:"error,omitempty"`
}

type Scope

type Scope struct{ ProjectsRoot, Filter string }

type Service

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

func New

func New() *Service

func (*Service) Run

func (service *Service) Run(ctx context.Context, request Request, progress io.Writer) (Report, error)

type Summary

type Summary struct {
	Inspected int `json:"inspected"`
	Compliant int `json:"compliant"`
	Drift     int `json:"drift"`
	Blocked   int `json:"blocked"`
	Errors    int `json:"errors"`
	Applied   int `json:"applied"`
}

Jump to

Keyboard shortcuts

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