conflict

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNoWaitingChange = errors.New("no waiting change in progress")

ErrorNoWaitingChange signals that an abort or continue had no change to resume: no change is in progress for the workshop at all. Match it with errors.Is.

Functions

func BackgroundDiscard added in v0.9.1

func BackgroundDiscard(chg *state.Change, workshop string)

func ChangeAttempt

func ChangeAttempt(change *state.Change) (int, error)

func CheckChangeConflict

func CheckChangeConflict(st *state.State, projectId, workshop string, ignoreKinds []string) error

Iterates over the list of running tasks and returns a ChangeConflictError if there is a change running for the provided projectID / workshop pair. Ignores certain kinds of changes based on the ignoreKinds argument. Ignore discarded changes.

func FindChangeByKind

func FindChangeByKind(st *state.State, projectId, workshop, kind string) (string, error)

Iterates over the list of running tasks and returns a change ID if there is a change running for the provided projectID, workshop and kind. Ignore discard-background changes.

func ResumeAfterWait

func ResumeAfterWait(
	st *state.State, format sdk.Revision, workshop string, projectId string, mode Mode, action string,
) (*state.Change, error)

Attempt to resume the change associated with the Resume/Launch operation for the given workshop. Depending on the mode the change will either be turned into Doing (Continue mode) or Abort (Abort mode).

Types

type ChangeActionMismatch added in v0.9.2

type ChangeActionMismatch string

func (ChangeActionMismatch) Error added in v0.9.2

func (e ChangeActionMismatch) Error() string

type ChangeConflictError

type ChangeConflictError struct {
	ProjectId    string
	Workshop     string
	ChangeKind   string
	ChangeStatus string
	// a Message is optional, otherwise one is composed from the other information
	Message string
	// ChangeID can optionally be set to the ID of the change with which the operation conflicts
	ChangeID string
}

ChangeConflictError represents an error because of snap conflicts between changes.

func (*ChangeConflictError) Error

func (e *ChangeConflictError) Error() string

type ChangeSetup

type ChangeSetup struct {
	Mode string `json:"mode"`
}

type Mode

type Mode int
const (
	ChangeTransactional Mode = iota
	ChangeWaitOnError
	ChangeContinue
	ChangeAbort
)

func ParseMode

func ParseMode(s string) (Mode, error)

func (Mode) Resume

func (s Mode) Resume() bool

func (Mode) String

func (s Mode) String() string

type RefreshOption

type RefreshOption int
const (
	RefreshUpdate RefreshOption = iota
	RefreshRestore
)

func ParseRefreshSetting

func ParseRefreshSetting(s string) (RefreshOption, error)

func (RefreshOption) String

func (s RefreshOption) String() string

Jump to

Keyboard shortcuts

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