fix(project): exempt cdn_channel consumers from released-source validation; review polish
build-binaries / build-binaries (pull_request) Successful in 2m24s
test-image / build-image (pull_request) Successful in 50s
test / test (pull_request) Successful in 1m34s

- Extend ValidateLayout exemption so cdn_channel consumers skip root/include/
  derive/manifest requirements (they resolve entirely from Source.* at runtime).
- Add TestValidateLayoutAcceptsCDNChannelConsumerWithoutReleasedSourceFields.
- Fix inverted precedence comment in CDN-base resolution block (autogen.go:325).
- Add broken-YAML subtest to TestResolveCDNChannelHardFail.
- Add assumption comment to autogenConsumerManagedLockKeyMatcher re folder_name+preserve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 15:09:12 +02:00
co-authored by Claude Sonnet 4.6
parent e674f5cad9
commit f833f979ea
4 changed files with 67 additions and 4 deletions
+5 -1
View File
@@ -189,6 +189,10 @@ func autogenConsumerManagedLockKeyMatcher(consumer project.AutogenConsumerConfig
prefix := dataset + ":"
// Build the group set from the resolved policy so consumers that omit
// AccessoryVisualeffects.Groups still match the four default group names.
// NOTE: this matcher assumes the default folder_name+preserve group
// representation. Keys produced under case:lower or
// group_token_source:prefix would not match and would escape pruning;
// no production config uses those combinations.
policy := resolveAccessoryVisualeffectsPolicy(consumer, nil)
groups := make(map[string]struct{}, len(policy.Groups))
for group := range policy.Groups {
@@ -322,7 +326,7 @@ func resolveCDNChannelManifest(p *project.Project, consumer project.AutogenConsu
channel = deriveAssetChannel(p.Root)
}
// 3. CDN base: env override, then config literal, then baked default.
// 3. CDN base: baked default, then env override, then config literal (most specific wins).
cdnBase := defaultBunnyCDNBase
if envName := strings.TrimSpace(src.CDNBaseEnv); envName != "" {
if v := strings.TrimSpace(os.Getenv(envName)); v != "" {