match

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package match implements branch matching

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRefForRepo

func GetRefForRepo(ri RepoInfo, branches []BranchInfo) (sha string, branch string, err error)

GetRefForRepo contains the core branch matching algorithm. The input is data about the triggering repository/PR and the extant branches for the repo in question. Output is the branch and SHA to use for the repo

Types

type BranchInfo

type BranchInfo struct {
	Name string
	SHA  string
}

BranchInfo includes the information about a specific branch of a git repo

type RefMap

type RefMap map[string]BranchInfo

RefMap is a map of repository name to the ref (branch/sha) to use for that repo

func (RefMap) CommitSHAMap

func (rm RefMap) CommitSHAMap() map[string]string

CommitSHAMap returns a map that can be cast to models.CommitSHAMap

func (RefMap) RefMap

func (rm RefMap) RefMap() map[string]string

RefMap returns a map that can be cast to models.RefMap

type RepoInfo

type RepoInfo struct {
	SourceBranch  string
	BaseBranch    string
	BranchMatch   bool
	DefaultBranch string
}

RepoInfo models the information about parent (triggered) repository

Jump to

Keyboard shortcuts

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