reporting

package
v0.0.0-...-9d61cdf Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImpactedSourcesMapToGroupMapping

func ImpactedSourcesMapToGroupMapping(impactedSources map[string]digger_config.ProjectToSourceMapping, jobMapping map[string]scheduler.SerializedJob, jobSpecMapping map[string]orchestrator.JobJson, footprintsMap map[string]terraform_utils.TerraformPlanFootprint) map[string][]ProjectNameSourceDetail

returns a map inverting locations

Types

type CiReporter

type CiReporter struct {
	CiService         orchestrator.PullRequestService
	PrNumber          int
	IsSupportMarkdown bool
	ReportStrategy    ReportStrategy
}

func (*CiReporter) Flush

func (ciReporter *CiReporter) Flush() (string, string, error)

func (*CiReporter) Report

func (ciReporter *CiReporter) Report(report string, reportFormatting func(report string) string) (string, string, error)

func (*CiReporter) SupportsMarkdown

func (ciReporter *CiReporter) SupportsMarkdown() bool

func (*CiReporter) Suppress

func (ciReporter *CiReporter) Suppress() error

type CiReporterLazy

type CiReporterLazy struct {
	CiReporter CiReporter
	// contains filtered or unexported fields
}

func NewCiReporterLazy

func NewCiReporterLazy(ciReporter CiReporter) *CiReporterLazy

func (*CiReporterLazy) Flush

func (lazyReporter *CiReporterLazy) Flush() (string, string, error)

func (*CiReporterLazy) Report

func (lazyReporter *CiReporterLazy) Report(report string, reportFormatting func(report string) string) (string, string, error)

func (*CiReporterLazy) SupportsMarkdown

func (lazyReporter *CiReporterLazy) SupportsMarkdown() bool

func (*CiReporterLazy) Suppress

func (lazyReporter *CiReporterLazy) Suppress() error

type CommentPerRunStrategy

type CommentPerRunStrategy struct {
	Title     string
	TimeOfRun time.Time
}

func (CommentPerRunStrategy) Report

func (strategy CommentPerRunStrategy) Report(ciService orchestrator.PullRequestService, PrNumber int, report string, reportFormatter func(report string) string, supportsCollapsibleComment bool) (string, string, error)

type LatestRunCommentStrategy

type LatestRunCommentStrategy struct {
	TimeOfRun time.Time
}

func (*LatestRunCommentStrategy) Report

func (strategy *LatestRunCommentStrategy) Report(ciService orchestrator.PullRequestService, PrNumber int, report string, reportFormatter func(report string) string, supportsCollapsibleComment bool) (string, string, error)

type MockReporter

type MockReporter struct {
	// contains filtered or unexported fields
}

func (*MockReporter) Flush

func (mockReporter *MockReporter) Flush() (string, string, error)

func (*MockReporter) Report

func (mockReporter *MockReporter) Report(report string, reportFormatting func(report string) string) (string, string, error)

func (*MockReporter) SupportsMarkdown

func (mockReporter *MockReporter) SupportsMarkdown() bool

func (*MockReporter) Suppress

func (mockReporter *MockReporter) Suppress() error

type MultipleCommentsStrategy

type MultipleCommentsStrategy struct{}

func (*MultipleCommentsStrategy) Report

func (strategy *MultipleCommentsStrategy) Report(ciService orchestrator.PullRequestService, PrNumber int, report string, reportFormatter func(report string) string, supportsCollapsibleComment bool) (string, string, error)

type NoopReporter

type NoopReporter struct{}

func (NoopReporter) Flush

func (reporter NoopReporter) Flush() (string, string, error)

func (NoopReporter) Report

func (reporter NoopReporter) Report(report string, reportFormatting func(report string) string) (string, string, error)

func (NoopReporter) SupportsMarkdown

func (reporter NoopReporter) SupportsMarkdown() bool

func (NoopReporter) Suppress

func (reporter NoopReporter) Suppress() error

type ProjectNameSourceDetail

type ProjectNameSourceDetail struct {
	ProjectName   string
	Source        string
	Job           scheduler.SerializedJob
	JobSpec       orchestrator.JobJson
	PlanFootPrint terraform_utils.TerraformPlanFootprint
}

type ReportStrategy

type ReportStrategy interface {
	Report(ciService orchestrator.PullRequestService, PrNumber int, report string, reportFormatter func(report string) string, supportsCollapsibleComment bool) (commentId string, commentUrl string, error error)
}

type Reporter

type Reporter interface {
	Report(report string, reportFormatting func(report string) string) (commentId string, commentUrl string, error error)
	Flush() (string, string, error)
	Suppress() error
	SupportsMarkdown() bool
}

type SourceDetails

type SourceDetails struct {
	SourceLocation string   `json:"source_location"`
	CommentId      string   `json:"comment_id"`
	Projects       []string `json:"projects"`
}

func PostInitialSourceComments

func PostInitialSourceComments(ghService *dg_github.GithubService, prNumber int, impactedProjectsSourceMapping map[string]dg_configuration.ProjectToSourceMapping) ([]SourceDetails, error)

type SourceGroupingReporter

type SourceGroupingReporter struct {
	Jobs      []scheduler.SerializedJob
	PrNumber  int
	PrService orchestrator.PullRequestService
}

func (SourceGroupingReporter) UpdateComment

func (r SourceGroupingReporter) UpdateComment(sourceDetails []SourceDetails, location string, terraformOutputs map[string]string) error

type StdOutReporter

type StdOutReporter struct{}

func (*StdOutReporter) Flush

func (reporter *StdOutReporter) Flush() (string, string, error)

func (*StdOutReporter) Report

func (reporter *StdOutReporter) Report(report string, reportFormatting func(report string) string) (string, string, error)

func (*StdOutReporter) SupportsMarkdown

func (reporter *StdOutReporter) SupportsMarkdown() bool

func (*StdOutReporter) Suppress

func (reporter *StdOutReporter) Suppress() error

Jump to

Keyboard shortcuts

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