Documentation
¶
Index ¶
- Constants
- func BuildSummarySections(plans []ci.PlanResult, reports []*ci.Report) ([]ci.ReportSection, error)
- func BuildSummarySectionsWithOptions(plans []ci.PlanResult, reports []*ci.Report, includeDetails bool) ([]ci.ReportSection, error)
- func ComposeComment(plans []ci.PlanResult, reports []*ci.Report, commitSHA, pipelineID string, ...) (string, error)
- func ComposeCommentWithOptions(plans []ci.PlanResult, reports []*ci.Report, commitSHA, pipelineID string, ...) (string, error)
- func HasReportableChanges(plans []ci.PlanResult, reports []*ci.Report) bool
- func Truncate(s string, maxLen int) string
- type Config
- type LabelRequest
- type LabelResult
- type LabelTemplate
- type PlanParser
- type PlanScanner
- type Provider
- type ProviderResolver
- type Request
- type Result
- type Runtime
Constants ¶
const CommentMarker = ci.CommentMarker
CommentMarker is used to identify terraci comments for updates.
const ReportProducer = "summary"
ReportProducer is the producer name used by summary's own reports/comments.
Variables ¶
This section is empty.
Functions ¶
func BuildSummarySections ¶
func BuildSummarySections(plans []ci.PlanResult, reports []*ci.Report) ([]ci.ReportSection, error)
BuildSummarySections builds the filtered summary view from plan results and render-ready plugin reports.
func BuildSummarySectionsWithOptions ¶
func BuildSummarySectionsWithOptions(plans []ci.PlanResult, reports []*ci.Report, includeDetails bool) ([]ci.ReportSection, error)
BuildSummarySectionsWithOptions builds the filtered summary view with explicit rendering options.
func ComposeComment ¶
func ComposeComment(plans []ci.PlanResult, reports []*ci.Report, commitSHA, pipelineID string, generatedAt time.Time) (string, error)
ComposeComment builds the final markdown comment from plans and typed plugin reports.
func ComposeCommentWithOptions ¶
func ComposeCommentWithOptions(plans []ci.PlanResult, reports []*ci.Report, commitSHA, pipelineID string, generatedAt time.Time, includeDetails bool) (string, error)
ComposeCommentWithOptions builds the final markdown comment with explicit rendering options.
func HasReportableChanges ¶
func HasReportableChanges(plans []ci.PlanResult, reports []*ci.Report) bool
HasReportableChanges reports whether the run has any module or report signal worth posting.
Types ¶
type Config ¶
type Config struct {
Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
OnChangesOnly bool `yaml:"on_changes_only,omitempty" json:"on_changes_only,omitempty"`
IncludeDetails *bool `yaml:"include_details,omitempty" json:"include_details,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
}
Config holds summary plugin settings.
func (*Config) IncludeDetailsEnabled ¶
IncludeDetailsEnabled reports whether detailed report sections should be rendered.
func (*Config) Normalized ¶
Normalized returns a value copy with stable defaults and owned slices.
type LabelRequest ¶
type LabelRequest struct {
WorkDir string
Segments []string
Plans []ci.PlanResult
Templates []string
Parser PlanParser
}
LabelRequest contains the data needed to resolve summary labels.
type LabelResult ¶
LabelResult is the deterministic output of label resolution.
func ResolveLabels ¶
func ResolveLabels(req LabelRequest) LabelResult
ResolveLabels resolves static, module-level, and resource-level label templates.
type LabelTemplate ¶
type LabelTemplate string
LabelTemplate is a configured summary label expression.
func (LabelTemplate) HasResourcePlaceholders ¶
func (t LabelTemplate) HasResourcePlaceholders() bool
HasResourcePlaceholders reports whether this template needs plan.json resources.
func (LabelTemplate) Placeholders ¶
func (t LabelTemplate) Placeholders() []string
Placeholders returns the unique placeholders used by the template.
type PlanParser ¶
type PlanParser interface {
ParsePlan(path string) (*tfplan.ParsedPlan, error)
}
PlanParser parses a terraform plan JSON file for resource-level labels.
type PlanScanner ¶
type PlanScanner interface {
ScanPlanResults(rootDir string, segments []string) (*ci.PlanResultCollection, error)
}
PlanScanner loads plan result artifacts.
type Provider ¶
type Provider interface {
CommitSHA() string
PipelineID() string
CommentService() (ci.CommentService, bool)
}
Provider is the CI-provider surface needed by the summary use case.
type ProviderResolver ¶
ProviderResolver resolves the active CI provider for the current command.
type Request ¶
type Request struct{}
Request is reserved for command-time options. The summary command currently has no flags; keeping the request explicit keeps the use case stable.
type Result ¶
type Result struct {
Collection *ci.PlanResultCollection
Plans []ci.PlanResult
Reports []*ci.Report
Body string
Labels []string
LabelWarnings []string
ReportWarnings []string
PostedComment bool
SyncedLabels bool
SkippedReason string
ProviderDetected bool
}
Result reports what the summary use case did.
type Runtime ¶
type Runtime struct {
Config Config
WorkDir string
ServiceDir string
Segments []string
ProviderResolver ProviderResolver
PlanScanner PlanScanner
ReportStore ci.ReportStore
LabelParser PlanParser
}
Runtime holds normalized summary configuration and command-independent dependencies.