Track the main version through sequence movement
This commit is contained in:
@@ -172,7 +172,7 @@ func loadSelectedOverlayWithAccessAndVersion(access *filesystemAccess, base *ass
|
||||
return sources, failures
|
||||
}
|
||||
overlayPayload := processed.payload
|
||||
if versionNode := fragmentVersionClaim(overlayPayload, rule); versionNode != nil {
|
||||
if versionNode := fragmentVersionClaim(overlayPayload, rule); len(policies) == 0 && versionNode != nil {
|
||||
location := publicLocation(versionNode.Location)
|
||||
return sources, []Diagnostic{{
|
||||
Code: CodeOverlayVersion, Severity: SeverityError, Path: rule.Path.clone(),
|
||||
@@ -194,6 +194,18 @@ func loadSelectedOverlayWithAccessAndVersion(access *filesystemAccess, base *ass
|
||||
if len(overlayDiagnostics) != 0 {
|
||||
return sources, overlayDiagnostics
|
||||
}
|
||||
if len(policies) != 0 {
|
||||
// The selected overlay retains one application with the actual item
|
||||
// assignments. Raw list indexes cannot identify an upsert's destination.
|
||||
application := base.current.applications[len(base.current.applications)-1]
|
||||
if node := versionClaimFromApplication(application, rule); node != nil {
|
||||
location := publicLocation(node.Location)
|
||||
return sources, []Diagnostic{{
|
||||
Code: CodeOverlayVersion, Severity: SeverityError, Path: rule.Path.clone(),
|
||||
Message: "overlays cannot contribute to or replace the schema-version path", Primary: &location,
|
||||
}}
|
||||
}
|
||||
}
|
||||
base.current.inputBytes += int64(len(data))
|
||||
base.current.inputNodes += nodeCount
|
||||
return sources, nil
|
||||
|
||||
Reference in New Issue
Block a user