Identify pipeline entries in reports and diagnostics
This commit is contained in:
@@ -2,6 +2,7 @@ package reporting
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -171,6 +172,7 @@ func recoveryReasons(records []RecoveryRecord) map[string]int {
|
||||
}
|
||||
|
||||
func escapeMarkdown(value string) string {
|
||||
value = html.EscapeString(value)
|
||||
value = strings.ReplaceAll(value, "\\", "\\\\")
|
||||
value = strings.ReplaceAll(value, "|", "\\|")
|
||||
value = strings.ReplaceAll(value, "`", "\\`")
|
||||
|
||||
@@ -52,6 +52,7 @@ type Failure struct {
|
||||
type ErrorRecord struct {
|
||||
Scope string `yaml:"scope"`
|
||||
StageIndex *int `yaml:"stage_index,omitempty"`
|
||||
StageID *string `yaml:"stage_id,omitempty"`
|
||||
ModuleKey string `yaml:"module_key,omitempty"`
|
||||
ModuleInstance string `yaml:"module_instance,omitempty"`
|
||||
ChunkIndex *int `yaml:"chunk_index,omitempty"`
|
||||
@@ -76,6 +77,7 @@ type FilteredProposal struct {
|
||||
|
||||
type RecoveryRecord struct {
|
||||
StageIndex int `yaml:"stage_index"`
|
||||
StageID *string `yaml:"stage_id,omitempty"`
|
||||
ModuleKey string `yaml:"module_key"`
|
||||
ModuleInstance string `yaml:"module_instance"`
|
||||
ChunkIndex int `yaml:"chunk_index"`
|
||||
@@ -115,6 +117,7 @@ type RecoveriesDocument struct {
|
||||
// WorkUnit is payload-free matrix input for report.md.
|
||||
type WorkUnit struct {
|
||||
StageIndex int
|
||||
StageID *string
|
||||
ModuleKey string
|
||||
ModuleInstance string
|
||||
ChunkIndex int
|
||||
@@ -178,3 +181,11 @@ func YAML(document any, secrets ...string) ([]byte, error) {
|
||||
}
|
||||
return safe, nil
|
||||
}
|
||||
|
||||
// StageLabel identifies a configured entry by position, module, and optional ID.
|
||||
func StageLabel(index int, module string, id *string) string {
|
||||
if id != nil {
|
||||
return fmt.Sprintf("%d: %s (%s)", index+1, module, *id)
|
||||
}
|
||||
return fmt.Sprintf("%d: %s", index+1, module)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user