parser

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPRDetails    = 100
	MaxLogIssues    = 20
	MaxIssueMsgLen  = 256
	MaxFormattedLen = 1024
)

Variables

This section is empty.

Functions

func LevelLabel

func LevelLabel(level LogLevel) string

Types

type BranchResultSummary added in v0.4.0

type BranchResultSummary struct {
	ResultsByType map[string]int
}

type DependencySummary added in v0.4.0

type DependencySummary struct {
	TotalDeps               int
	OutdatedDeps            int
	UpdatesByType           map[string]int
	VulnerabilityFixesAvail int
}

type FormattedLine

type FormattedLine struct {
	Level   LogLevel
	Message string
	Class   string
	Time    string
	Raw     string
}

func (FormattedLine) LevelLabel

func (f FormattedLine) LevelLabel() string

type LogIssue

type LogIssue struct {
	Level   int
	Message string
}

type LogIssues

type LogIssues struct {
	WarnCount  int
	ErrorCount int
	Issues     []LogIssue
	Truncated  bool
}

type LogLevel

type LogLevel int
const (
	LogLevelTrace LogLevel = 10
	LogLevelDebug LogLevel = 20
	LogLevelInfo  LogLevel = 30
	LogLevelWarn  LogLevel = 40
	LogLevelError LogLevel = 50
	LogLevelFatal LogLevel = 60
)

type PRAction

type PRAction string
const (
	PRActionAutomerged    PRAction = "automerged"
	PRActionCreated       PRAction = "created"
	PRActionUpdated       PRAction = "updated"
	PRActionNeedsApproval PRAction = "needs-approval"
	PRActionUnchanged     PRAction = "unchanged"
)

type PRActivity

type PRActivity struct {
	Automerged    int
	Created       int
	Updated       int
	NeedsApproval int
	Unchanged     int
	PRs           []PRDetail
	Truncated     bool
}

type PRDetail

type PRDetail struct {
	Branch string
	Number int
	Title  string
	Action PRAction
	URL    string
}

type ParseLogsResult added in v0.4.0

type ParseLogsResult struct {
	HasIssues     bool
	WarnCount     int
	ErrorCount    int
	PRActivity    *PRActivity
	Dependencies  *DependencySummary
	BranchResults *BranchResultSummary
}

ParseLogsResult is the aggregated result of scanning a Renovate NDJSON log.

func ParseLogs added in v0.4.0

func ParseLogs(r io.Reader, maxBytes int64) (*ParseLogsResult, error)

ParseLogs streams a Renovate NDJSON log from r and returns the aggregated PR activity along with whether WARN/ERROR entries were seen. A single scanner pass feeds both the metrics and UI consumers so they cannot drift. The reader is consumed up to maxBytes; pass a negative value for no cap.

type ParseResult

type ParseResult struct {
	HasIssues            bool
	RenovateResultStatus string
	PRActivity           *PRActivity
	LogIssues            *LogIssues
	Lines                []FormattedLine
}

func ParseRenovateLogs

func ParseRenovateLogs(logs string) *ParseResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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