summaryengine

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CommentMarker = ci.CommentMarker

CommentMarker is used to identify terraci comments for updates

Variables

This section is empty.

Functions

func FilterPlanOutput

func FilterPlanOutput(rawOutput string) string

FilterPlanOutput extracts only the diff portion from terraform plan output

func FormatCostCell

func FormatCostCell(p *ci.ModulePlan) string

FormatCostCell formats the cost cell for a module plan

func FormatCostDiff

func FormatCostDiff(diff float64) string

FormatCostDiff formats a cost difference with sign

func FormatMonthlyCost

func FormatMonthlyCost(cost float64) string

FormatMonthlyCost formats a monthly cost value

func FormatPlanDetails

func FormatPlanDetails(p *plan.ParsedPlan) string

FormatPlanDetails formats a parsed plan as structured resource list grouped by action

func FormatPlanSummary

func FormatPlanSummary(p *plan.ParsedPlan) string

FormatPlanSummary formats a parsed plan as a compact summary line

func HasReportableChanges

func HasReportableChanges(plans []ci.ModulePlan, policySummary *ci.PolicySummary) bool

HasReportableChanges returns true if there are plan changes, failures, or policy violations that warrant posting a comment.

func ParseModulePathComponents

func ParseModulePathComponents(modulePath string, segments []string) map[string]string

ParseModulePathComponents parses a module path using the given segment names and returns a map of component name to value. Extra path parts beyond the defined segments are joined as "submodule".

func ScanPlanResults

func ScanPlanResults(rootDir string, segments []string) (*ci.PlanResultCollection, error)

ScanPlanResults scans for plan.json files in module directories and builds a collection of plan results from their contents. If segments is nil or empty, default segments (service/environment/region/module) are used.

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to maxLen characters

Types

type CommentData

type CommentData struct {
	Plans         []ci.ModulePlan
	PolicySummary *ci.PolicySummary
	PipelineURL   string
	PipelineID    string
	CommitSHA     string
	GeneratedAt   time.Time
	TotalModules  int
}

CommentData contains all data needed to render a PR/MR comment

type CommentRenderer

type CommentRenderer struct{}

CommentRenderer renders PR/MR comments

func NewCommentRenderer

func NewCommentRenderer() *CommentRenderer

NewCommentRenderer creates a new comment renderer

func (*CommentRenderer) Render

func (r *CommentRenderer) Render(data *CommentData) string

Render generates the comment body

Jump to

Keyboard shortcuts

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