change

package
v0.0.0-...-4d54ae9 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LabelCharacters = "a-zA-Z0-9-_"

LabelCharacters is the list of valid character for a Bazel package

View Source
var PackageLabelRegex = regexp.MustCompile(fmt.Sprintf(":[%s]+", LabelCharacters))

PackageLabelRegex the regex to find labels of the current package

View Source
var RepoLabelRegex = regexp.MustCompile(fmt.Sprintf("//([%s]+/)*[%s]+(:[%s]+){0,1}", LabelCharacters, LabelCharacters, LabelCharacters))

RepoLabelRegex the regex to find labels of the current repository

Functions

This section is empty.

Types

type CommitMsg

type CommitMsg struct {
	Tags        []string
	ReleasePlan *actions.ReleasePlan `json:",omitempty"`
}

CommitMsg contains the list of commit message tags

type Detector

type Detector struct {
	RootPath       string
	PreviousCommit string
	CurrentCommit  string
	KaeterModules  []modules.KaeterModule
	PullRequest    *PullRequest
}

Detector contains the configuration of the change detector

func (*Detector) Check

func (d *Detector) Check() (info *Information, err error)

Check performs the change detection over all modules

func (*Detector) CommitCheck

func (d *Detector) CommitCheck(_ *Information) (c CommitMsg)

CommitCheck returns information about the current commit message (current as defined by the parameters, not necessarily HEAD). This includes the first 3 [tags] in the subject line, the release plan if one is available.

func (*Detector) FileCheck

func (d *Detector) FileCheck(_ *Information) (files Files, err error)

FileCheck reads the git changes between two commit and compiles a list of added, changed and deleted files

func (*Detector) HelmCheck

func (d *Detector) HelmCheck(changes *Information) (c HelmChange)

HelmCheck performs change detection on Helm chart and returns the summary in HelmChange

func (*Detector) KaeterCheck

func (d *Detector) KaeterCheck(changes *Information) (kc KaeterChange, err error)

KaeterCheck attempts to find all Kaeter modules and infers based on the change set which module were altered

func (*Detector) PullRequestCommitCheck

func (d *Detector) PullRequestCommitCheck(_ *Information) (pr *PullRequest)

PullRequestCommitCheck allows checking for a release to be from a pull request assuming: - The PR has a title and body - The title and body combined will beocome the merged commit message This in turns allows loading kaeter release plans on what is to be released.

type Files

type Files struct {
	Added    []string
	Removed  []string
	Modified []string
}

Files the list of add, modified and deleted files

type HelmChange

type HelmChange struct {
	Charts []string
}

HelmChange contains the list of modified Helm charts

type Information

type Information struct {
	Files       Files
	Commit      CommitMsg
	Kaeter      KaeterChange
	Helm        HelmChange
	PullRequest *PullRequest `json:",omitempty"`
}

Information contains the summary of all changes

func LoadChangeset

func LoadChangeset(changesetPath string) (info *Information, err error)

LoadChangeset reads changeset.json back into Information.

type KaeterChange

type KaeterChange struct {
	Modules map[string]modules.KaeterModule
}

KaeterChange contains a map of changed Modules by ids

type PullRequest

type PullRequest struct {
	Title       string               `json:"title,omitempty"`
	Body        string               `json:"body,omitempty"`
	ReleasePlan *actions.ReleasePlan `json:",omitempty"`
}

PullRequest can hold optional informations if a pull request is open on the vcs hosting platform

Jump to

Keyboard shortcuts

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