Track the main version through sequence movement
This commit is contained in:
@@ -229,6 +229,8 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
||||
}
|
||||
}
|
||||
if request.ordinary {
|
||||
versionState.locateMainVersion(input.document)
|
||||
mainOptions.Definition.Version = versionState.effectiveRule
|
||||
input, diagnostics = applyInputLayers(request.main.source, mainOptions, input)
|
||||
} else {
|
||||
input, diagnostics = assembleLayeredInput(request, input, accounting)
|
||||
@@ -239,6 +241,7 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
||||
if hasErrors(diagnostics) {
|
||||
return nil, accumulator.loadError()
|
||||
}
|
||||
request.effectiveVersion = versionState.effectiveRule
|
||||
if request.ordinary && input.parsed.source != nil {
|
||||
baseSources := make([]SourceInfo, 0, len(input.sources))
|
||||
for _, source := range input.sources {
|
||||
@@ -268,10 +271,13 @@ func executeLoadRequest[T any](request loadRequest[T], secrets SecretBinding, lo
|
||||
accumulator.add(problems...)
|
||||
return nil, accumulator.loadError()
|
||||
}
|
||||
if problem := inheritanceVersionDiagnostic(request.protectionVersion(), expanded); problem != nil {
|
||||
effectiveVersion, problem := projectInheritanceVersion(request.protectionVersion(), expanded)
|
||||
if problem != nil {
|
||||
accumulator.add(*problem)
|
||||
return nil, accumulator.loadError()
|
||||
}
|
||||
request.effectiveVersion = effectiveVersion
|
||||
versionState.effectiveRule = effectiveVersion
|
||||
input.composition = composition
|
||||
input.inheritance = expanded
|
||||
input.document = expanded.root
|
||||
|
||||
Reference in New Issue
Block a user