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:
@@ -1425,6 +1425,51 @@ func TestValidateLayoutRejectsInvalidAccessoryVisualeffectsNamingConfig(t *testi
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateLayoutAcceptsCDNChannelConsumerWithoutReleasedSourceFields(t *testing.T) {
|
||||
// cdn_channel consumers resolve entirely from Source.* at runtime; they must
|
||||
// not be required to supply root/include/derive/manifest fields.
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
mkdirAll(t, filepath.Join(root, "build"))
|
||||
|
||||
proj := &Project{
|
||||
Root: root,
|
||||
Config: Config{
|
||||
Module: ModuleConfig{Name: "Test", ResRef: "test"},
|
||||
Paths: PathConfig{Source: "src", Build: "build"},
|
||||
Autogen: AutogenConfig{
|
||||
Consumers: []AutogenConsumerConfig{
|
||||
{
|
||||
ID: "accessory_visualeffects",
|
||||
Producer: "accessory_visualeffects",
|
||||
Dataset: "visualeffects",
|
||||
Mode: "accessory_visualeffects",
|
||||
Optional: true,
|
||||
AccessoryVisualeffects: AccessoryVisualeffectsConfig{
|
||||
Groups: map[string]AccessoryVisualeffectGroupConfig{
|
||||
"head_accessories": {Prefix: "head_acc_"},
|
||||
"chest_accessories": {Prefix: "chest_acc_"},
|
||||
"head_decorations": {Prefix: "head_dec_"},
|
||||
"head_features": {Prefix: "head_feat_"},
|
||||
},
|
||||
},
|
||||
Source: AutogenSourceConfig{
|
||||
Kind: "cdn_channel",
|
||||
ChannelsPath: "releases/haks/channels.json",
|
||||
ManifestPath: "releases/haks/{tag}/vfxs.yml",
|
||||
},
|
||||
// Intentionally omitted: Root, Include, Derive, Manifest
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if err := proj.ValidateLayout(); err != nil {
|
||||
t.Fatalf("cdn_channel consumer should pass ValidateLayout without released-source fields, got: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadRejectsLegacyAccessoryVisualeffectsNamingFields(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
writeProjectFile(t, filepath.Join(root, ConfigFile), `
|
||||
|
||||
Reference in New Issue
Block a user