Rename the retained history limit diagnostic
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Pre-v1 Public API Cleanup Implementation Plan
|
# Pre-v1 Public API Cleanup Implementation Plan
|
||||||
|
|
||||||
Status: in progress; Stages 1–7 are complete and Stages 8–11 are pending.
|
Status: in progress; Stages 1–8 are complete and Stages 9–11 are pending.
|
||||||
Baseline: `07e4ae5d9236935389e81b207d4a8f00543fafce`.
|
Baseline: `07e4ae5d9236935389e81b207d4a8f00543fafce`.
|
||||||
Audience: a Luna coding agent executing the stages sequentially.
|
Audience: a Luna coding agent executing the stages sequentially.
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ and spelling without attribution/precedence changes.
|
|||||||
|
|
||||||
## Stage 8 — Rename The History Diagnostic And Remove The Unused Code
|
## Stage 8 — Rename The History Diagnostic And Remove The Unused Code
|
||||||
|
|
||||||
Status: pending. Implements N3 and D8.
|
Status: complete. Implements N3 and D8.
|
||||||
|
|
||||||
1. Replace root/engine `CodeExplainLimitExceeded` with
|
1. Replace root/engine `CodeExplainLimitExceeded` with
|
||||||
`CodeHistoryLimitExceeded = "history.limit_exceeded"`. Update every producer,
|
`CodeHistoryLimitExceeded = "history.limit_exceeded"`. Update every producer,
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ func hasHistoryLimitDiagnostic(t *testing.T, err error) bool {
|
|||||||
t.Fatalf("error type = %T, want *LoadError", err)
|
t.Fatalf("error type = %T, want *LoadError", err)
|
||||||
}
|
}
|
||||||
for _, diagnostic := range loadErr.Diagnostics() {
|
for _, diagnostic := range loadErr.Diagnostics() {
|
||||||
if diagnostic.Code == CodeExplainLimitExceeded {
|
if diagnostic.Code == CodeHistoryLimitExceeded {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ func TestHistoryNodeBudgetCountsSharedInheritanceRootsOnce(t *testing.T) {
|
|||||||
|
|
||||||
func TestInheritanceExpansionEnforcesRetainedHistoryBudget(t *testing.T) {
|
func TestInheritanceExpansionEnforcesRetainedHistoryBudget(t *testing.T) {
|
||||||
input := parseCompositionDocument(t, "source-1", "parent: {value: original}\nchild: {extends: parent, value: replacement}\n")
|
input := parseCompositionDocument(t, "source-1", "parent: {value: original}\nchild: {extends: parent, value: replacement}\n")
|
||||||
if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 2); len(diagnostics) != 1 || diagnostics[0].Code != CodeExplainLimitExceeded {
|
if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 2); len(diagnostics) != 1 || diagnostics[0].Code != CodeHistoryLimitExceeded {
|
||||||
t.Fatalf("retained history limit = %#v", diagnostics)
|
t.Fatalf("retained history limit = %#v", diagnostics)
|
||||||
}
|
}
|
||||||
if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 100); len(diagnostics) != 0 {
|
if _, diagnostics := expandInheritanceWithBudgets(input, nil, defaultProjectionLimits(), 100); len(diagnostics) != 0 {
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ func inheritanceBudgetDiagnostic(path Path, location document.Location) Diagnost
|
|||||||
func inheritanceHistoryBudgetDiagnostic(path Path, location document.Location) Diagnostic {
|
func inheritanceHistoryBudgetDiagnostic(path Path, location document.Location) Diagnostic {
|
||||||
primary := publicLocation(location)
|
primary := publicLocation(location)
|
||||||
return Diagnostic{
|
return Diagnostic{
|
||||||
Code: CodeExplainLimitExceeded, Severity: SeverityError, Path: path,
|
Code: CodeHistoryLimitExceeded, Severity: SeverityError, Path: path,
|
||||||
Message: "retained inheritance history exceeds the node limit", Primary: &primary,
|
Message: "retained inheritance history exceeds the node limit", Primary: &primary,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
|||||||
counter := newRetainedNodeCounter(historyLimit)
|
counter := newRetainedNodeCounter(historyLimit)
|
||||||
inspection, admitted := prepareInspectionHistory(resolved, counter)
|
inspection, admitted := prepareInspectionHistory(resolved, counter)
|
||||||
if !admitted {
|
if !admitted {
|
||||||
accumulator.add(Diagnostic{Code: CodeExplainLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"})
|
accumulator.add(Diagnostic{Code: CodeHistoryLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"})
|
||||||
return nil, accumulator.loadError()
|
return nil, accumulator.loadError()
|
||||||
}
|
}
|
||||||
// Detach resolver-borrowed values before reference mutation or validation.
|
// Detach resolver-borrowed values before reference mutation or validation.
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ const (
|
|||||||
CodeDecodeArrayLength Code = "decode.array_length"
|
CodeDecodeArrayLength Code = "decode.array_length"
|
||||||
|
|
||||||
CodeOptionsInvalid Code = "options.invalid"
|
CodeOptionsInvalid Code = "options.invalid"
|
||||||
CodeOptionsUnavailable Code = "options.unavailable"
|
|
||||||
|
|
||||||
CodeImportDisabled Code = "import.disabled"
|
CodeImportDisabled Code = "import.disabled"
|
||||||
CodeImportInvalid Code = "import.invalid"
|
CodeImportInvalid Code = "import.invalid"
|
||||||
@@ -163,7 +162,7 @@ const (
|
|||||||
CodeOverrideVersion Code = "override.version"
|
CodeOverrideVersion Code = "override.version"
|
||||||
CodeOverrideLimitExceeded Code = "override.limit_exceeded"
|
CodeOverrideLimitExceeded Code = "override.limit_exceeded"
|
||||||
|
|
||||||
CodeExplainLimitExceeded Code = "explain.limit_exceeded"
|
CodeHistoryLimitExceeded Code = "history.limit_exceeded"
|
||||||
|
|
||||||
CodeInheritanceInvalid Code = "inheritance.invalid"
|
CodeInheritanceInvalid Code = "inheritance.invalid"
|
||||||
CodeInheritanceMissing Code = "inheritance.missing"
|
CodeInheritanceMissing Code = "inheritance.missing"
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ const (
|
|||||||
CodeDecodeArrayLength Code = "decode.array_length"
|
CodeDecodeArrayLength Code = "decode.array_length"
|
||||||
|
|
||||||
CodeOptionsInvalid Code = "options.invalid"
|
CodeOptionsInvalid Code = "options.invalid"
|
||||||
CodeOptionsUnavailable Code = "options.unavailable"
|
|
||||||
|
|
||||||
CodeImportDisabled Code = "import.disabled"
|
CodeImportDisabled Code = "import.disabled"
|
||||||
CodeImportInvalid Code = "import.invalid"
|
CodeImportInvalid Code = "import.invalid"
|
||||||
@@ -164,7 +163,7 @@ const (
|
|||||||
CodeOverrideVersion Code = "override.version"
|
CodeOverrideVersion Code = "override.version"
|
||||||
CodeOverrideLimitExceeded Code = "override.limit_exceeded"
|
CodeOverrideLimitExceeded Code = "override.limit_exceeded"
|
||||||
|
|
||||||
CodeExplainLimitExceeded Code = "explain.limit_exceeded"
|
CodeHistoryLimitExceeded Code = "history.limit_exceeded"
|
||||||
|
|
||||||
CodeInheritanceInvalid Code = "inheritance.invalid"
|
CodeInheritanceInvalid Code = "inheritance.invalid"
|
||||||
CodeInheritanceMissing Code = "inheritance.missing"
|
CodeInheritanceMissing Code = "inheritance.missing"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ func TestOverlayPublicValues(t *testing.T) {
|
|||||||
CodeOverlayDirective: "overlay.directive",
|
CodeOverlayDirective: "overlay.directive",
|
||||||
CodeOverlayVersion: "overlay.version",
|
CodeOverlayVersion: "overlay.version",
|
||||||
CodeOverlayLimitExceeded: "overlay.limit_exceeded",
|
CodeOverlayLimitExceeded: "overlay.limit_exceeded",
|
||||||
|
CodeHistoryLimitExceeded: "history.limit_exceeded",
|
||||||
} {
|
} {
|
||||||
if string(code) != value {
|
if string(code) != value {
|
||||||
t.Errorf("code = %q, want %q", code, value)
|
t.Errorf("code = %q, want %q", code, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user