go: go.chromium.org/chromiumos/infra/go/internal/branch Index | Files

package branch

import "go.chromium.org/chromiumos/infra/go/internal/branch"


Package Files

branch_api.go bump.go common.go helper.go manifest_repo.go


const VersionFileProjectPath = "src/third_party/chromiumos-overlay"


var (
    StdoutLog        *log.Logger
    StderrLog        *log.Logger
    WorkingManifest  repo.Manifest
    RepoToolPath     string
    ManifestCheckout string
var (
    ManifestProjects = map[string]bool{
        "chromiumos/manifest":        true,
        "chromeos/manifest-internal": true,
    // A Chrome OS branch name as a prefix to a string, starting with a dash.
    // e.g. -release-R77-12371.B
    BranchPrefix = regexp.MustCompile("^-.*[.]B")

func AssertBranchesDoNotExist Uses

func AssertBranchesDoNotExist(branches []ProjectBranch, workerCount int) error

AssertBranchesDoNotExist checks that branches do not already exist.

func BranchExists Uses

func BranchExists(branchPattern *regexp.Regexp, buildNumber string, branchType string, remoteBranches []string) (bool, error)

BranchExists checks that a branch matching the given pattern exists in a particular project.

func BranchType Uses

func BranchType(release, factory, firmware, stabilize bool, custom string) (string, bool)

BranchType determines the type of branch to be created.

func BumpForCreate Uses

func BumpForCreate(componentToBump chromeos_version.VersionComponent, release, push bool, branchName, sourceUpstream string) error

BumpForCreate bumps the version in chromeos_version.sh, as needed, in the source branch for a branch creation command.

func CheckIfAlreadyBranched Uses

func CheckIfAlreadyBranched(vinfo mv.VersionInfo, manifestInternal repo.Project, force bool, branchType string) error

CheckIfAlreadyBranched checks if there's already a branch for the desired new branch to create on the manifest-internal repo.

func CheckSelfGroupMembership Uses

func CheckSelfGroupMembership(authedClient *http.Client, gerritUrl, expectedGroup string) (bool, error)

CheckSelfGroupMembership checks if the authenticated user is in the given group on the given Gerrit host. It returns a bool indicating whether or not that's the case, or an error if the lookup fails.

func CreateRemoteBranches Uses

func CreateRemoteBranches(branches []ProjectBranch, dryRun, force bool, workerCount int) error

CreateRemoteBranches makes the requested branches on the remote Gerrit hosts using git checkouts and pushes.

func CreateRemoteBranchesApi Uses

func CreateRemoteBranchesApi(authedClient *http.Client, branches []GerritProjectBranch, dryRun bool, gerritQps float64) error

CreateRemoteBranches creates a bunch of branches on remote Gerrit instances for the specified inputs using the Gerrit API.

func GetProjectCheckout Uses

func GetProjectCheckout(projectPath string, opts *CheckoutOptions) (string, error)

GetProjectCheckout gets a local checkout of a particular project.

func InitWorkingManifest Uses

func InitWorkingManifest(manifestUrl, br string) error

InitWorkingManifest initializes a local working manifest (a.k.a. buildspec) from a Gerrit path.

func LogErr Uses

func LogErr(format string, a ...interface{})

LogOut logs to stderr.

func LogOut Uses

func LogOut(format string, a ...interface{})

LogOut logs to stdout.

func NewBranchName Uses

func NewBranchName(vinfo mv.VersionInfo, custom, descriptor string, release, factory, firmware, stabilize bool) string

Determine the name for a new branch. By convention, standard branch names must end with the stripped version string from which they were created, followed by '.B'.

For example:

- A branch created from 1.0.0 must end with -1.B
- A branch created from 1.2.0 must end with -1.2.B

Release branches have a slightly different naming scheme. They include

the milestone from which they were created. Example: release-R12-1.2.B

func ProjectFetchUrl Uses

func ProjectFetchUrl(projectPath string) (string, error)

ProjectFetchUrl returns the fetch URL for a remote Project.

func RepairManifestRepositories Uses

func RepairManifestRepositories(branches []ProjectBranch, dryRun, force bool) error

RepairManifestRepositories repairs all manifests in all manifest repositories on the current branch and commits the changes. It then pushes the state of the local git branches to remote.

func WhichVersionShouldBump Uses

func WhichVersionShouldBump(vinfo mv.VersionInfo) (mv.VersionComponent, error)

WhichVersionShouldBump returns which version is incremented by builds on a new branch.

type CheckoutOptions Uses

type CheckoutOptions struct {
    // If set, will get only this Ref.
    // If not set, will get the full repo.
    Ref string
    // To be used with the git clone --depth flag.
    Depth int

CheckoutOptions describes how to check out a Git repo.

type GerritProjectBranch Uses

type GerritProjectBranch struct {
    GerritURL string
    Project   string
    Branch    string
    SrcRef    string

GerritProjectBranch contains all the details for creating a new Gerrit branch based on an existing one.

func GerritProjectBranches Uses

func GerritProjectBranches(pbs []ProjectBranch) ([]GerritProjectBranch, error)

GerritProjectBranches creates a slice of GerritProjectBranch objects, which are representations of ProjectBranches that are useful for API based branching.

func GetNonManifestBranches Uses

func GetNonManifestBranches(branches []GerritProjectBranch) []GerritProjectBranch

GetNonManifestBranches filters out non-Manifest branches.

type ManifestRepo Uses

type ManifestRepo struct {
    ProjectCheckout string
    Project         repo.Project

func (*ManifestRepo) RepairManifestsOnDisk Uses

func (m *ManifestRepo) RepairManifestsOnDisk(branchesByPath map[string]string) error

RepairManifestsOnDisk repairs the revision and upstream attributes of manifest elements on disk for the given projects.

type ProjectBranch Uses

type ProjectBranch struct {
    Project    repo.Project
    BranchName string

ProjectBranch is a project and a branch.

func ProjectBranches Uses

func ProjectBranches(br, original string) []ProjectBranch

ProjectBranches returns a list of ProjectBranch structs: one for each branchable project. The original parameter is the CrOS branch from which the current checkout stems.

Package branch imports 23 packages (graph) and is imported by 1 packages. Updated 2020-12-01. Refresh now. Tools for package owners.