Publish inspection through one frozen history model
This commit is contained in:
@@ -87,25 +87,22 @@ type Loaded[T any] struct {
|
||||
// Inspection owns frozen load snapshots and detached query state.
|
||||
type Inspection struct {
|
||||
metadata Metadata
|
||||
history *historyModel
|
||||
sources []SourceInfo
|
||||
contexts map[string]ResourceContext
|
||||
diagnostics []Diagnostic
|
||||
baseline *document.Node
|
||||
input *document.Node
|
||||
inputOrigins map[string]Origin
|
||||
preCLI *document.Node
|
||||
preCLIOrigins map[string]Origin
|
||||
postDecodeApps []historyApplication
|
||||
final *document.Node
|
||||
immutableLookup *documentLookup
|
||||
resolution []resolutionSnapshot
|
||||
resolutionReplay []resolutionReplayGroup
|
||||
applications []historyApplication
|
||||
inheritance []inheritanceOperation
|
||||
secrets map[string]bool
|
||||
secretReferences map[string]string
|
||||
}
|
||||
|
||||
func (r *Inspection) documentLookup() *documentLookup {
|
||||
if r == nil || r.history == nil {
|
||||
return nil
|
||||
}
|
||||
return r.history.documentLookup
|
||||
}
|
||||
|
||||
// Metadata returns detached effective presence, origin, and history records.
|
||||
func (r *Inspection) Metadata() Metadata {
|
||||
if r == nil {
|
||||
@@ -321,14 +318,6 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
||||
accumulator.add(Diagnostic{Code: CodeExplainLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"})
|
||||
return nil, accumulator.loadError()
|
||||
}
|
||||
historyApplications := make([]historyApplication, 0, len(inspection.applications)+len(inspection.postDecodeApps))
|
||||
historyApplications = append(historyApplications, inspection.applications...)
|
||||
historyApplications = append(historyApplications, inspection.postDecodeApps...)
|
||||
if !addInspectionHistory(counter, inspection) {
|
||||
accumulator.add(Diagnostic{Code: CodeExplainLimitExceeded, Severity: SeverityError, Message: "retained configuration history exceeds the node limit"})
|
||||
return nil, accumulator.loadError()
|
||||
}
|
||||
|
||||
// Detach resolver-borrowed values before reference mutation or validation.
|
||||
configuration, ownershipIssue := detachLoadConfiguration(schema, resolved.configuration, cloneUnresolvedSecrets)
|
||||
if ownershipIssue != nil {
|
||||
@@ -355,5 +344,5 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
||||
resolved.configuration = configuration
|
||||
// Publication detaches equal-valued validator replacements, preserving the
|
||||
// validated secret state, then finalizes metadata and sensitivity.
|
||||
return publishLoadResult(schema, request.definition, resolved, inspection, historyApplications, secretResolution.references, &accumulator)
|
||||
return publishLoadResult(schema, request.definition, resolved, inspection, secretResolution.references, &accumulator)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user