fix(project): exempt cdn_channel consumers from released-source validation; review polish
- 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:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user