reports

package
v0.93.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// CONDITIONREPORTTEMPLATE defines
	CONDITIONREPORTTEMPLATE string = `` /* 190-byte string literal not displayed */

	// TARGETREPORTTEMPLATE ...
	TARGETREPORTTEMPLATE string = `` /* 172-byte string literal not displayed */

	// SOURCEREPORTTEMPLATE ...
	SOURCEREPORTTEMPLATE string = `` /* 169-byte string literal not displayed */

	// REPORTTEMPLATE ...
	REPORTTEMPLATE string = `` /* 833-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func MergeFromString added in v0.49.0

func MergeFromString(old, new string) string

Types

type Action added in v0.49.0

type Action struct {
	// ID is the unique identifier of the action
	ID string `xml:"id,attr" json:"id,omitempty"`
	// Title is the title of the action
	Title string `xml:"-" json:"title,omitempty"`
	// PipelineTitle is the title of the pipeline
	PipelineTitle string `xml:"h3,omitempty" json:"pipelineTitle,omitempty"`
	// Description is the description of the action
	Description string `xml:"p,omitempty" json:"description,omitempty"`
	// Targets is the list of targets IDs associated with the action
	Targets []ActionTarget `xml:"details,omitempty" json:"targets,omitempty"`
	// using a pointer to avoid empty tag
	PipelineURL *PipelineURL `xml:"a,omitempty" json:"pipelineURL,omitempty"`
	// Link is the URL of the action
	Link string `xml:"link,omitempty" json:"actionUrl,omitempty"`
}

Action is a struct used to store the result of an action. It is used to generate pullrequest body

func (*Action) Merge added in v0.49.0

func (a *Action) Merge(sourceAction *Action)

func (*Action) String added in v0.49.0

func (a *Action) String() string

String show an action report formatted as a string

func (Action) ToActionsMarkdownString added in v0.86.0

func (a Action) ToActionsMarkdownString() string

ToActionsMarkdownString show an action report formatted as a string using markdown

func (Action) ToActionsString added in v0.49.0

func (a Action) ToActionsString() string

ToActionsString show an action report formatted as a string

func (*Action) UpdatePipelineURL added in v0.66.0

func (a *Action) UpdatePipelineURL()

UpdatePipelineURL analyze the local environment to guess if Updatecli is executed from a CI pipeline

type ActionTarget added in v0.49.0

type ActionTarget struct {
	ID          string                  `xml:"id,attr"`
	Title       string                  `xml:"summary,omitempty"`
	Description string                  `xml:"p,omitempty"`
	Changelogs  []ActionTargetChangelog `xml:"details,omitempty"`
}

ActionTarget holds target data to describe an action report

func (*ActionTarget) Merge added in v0.49.0

func (a *ActionTarget) Merge(sourceActionTarget *ActionTarget)

type ActionTargetChangelog added in v0.49.0

type ActionTargetChangelog struct {
	// Title is the title of the changelog
	Title string `xml:"summary,omitempty" json:"title,omitempty"`
	// Description is the description of the changelog
	Description string `xml:"pre,omitempty" json:"description,omitempty"`
}

ActionTargetChangelog is a struct used to store a target changelog

type Actions added in v0.49.0

type Actions struct {
	Actions []Action `xml:"action"`
}

func (*Actions) Merge added in v0.49.0

func (a *Actions) Merge(sourceActions *Actions)

func (*Actions) String added in v0.49.0

func (a *Actions) String() string

String show an action report formatted as a string

type PipelineURL added in v0.66.0

type PipelineURL struct {
	// URL is the URL of the pipeline
	URL string `xml:"href,attr"`
	// Name is the name of the pipeline
	Name string `xml:",chardata"`
}

PipelineURL is a struct used to store a pipeline URL

type Report

type Report struct {
	Name   string
	Err    string
	Result string
	// ID defines the report ID
	ID string
	// PipelineID represents the Updatecli manifest pipelineID
	PipelineID string
	Actions    map[string]*Action
	Sources    map[string]*result.Source
	Conditions map[string]*result.Condition
	Targets    map[string]*result.Target
	ReportURL  string
}

Report contains a list of Rules

func (*Report) String

func (r *Report) String(mode string) (report string, err error)

String returns a report as a string

func (*Report) UpdateID added in v0.55.0

func (r *Report) UpdateID() error

type Reports

type Reports []Report

Reports contains a list of report

func (*Reports) Show

func (r *Reports) Show() error

Show return a small reports of what has been changed

func (*Reports) Sort added in v0.76.0

func (r *Reports) Sort()

Sort reports by result in the following order SUCCESS > SKIPPED > ATTENTION > FAILURE > UNKNOWN

func (*Reports) Summary

func (r *Reports) Summary() (successCounter, changedCounter, failedCounter, skippedCounter int, actionLinks []string)

Summary display a summary of

type Stage

type Stage struct {
	Name   string
	Kind   string
	Result string
}

Stage contains the information if specific stage reported a success, a change, an error

Jump to

Keyboard shortcuts

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