Migrate facade tests to the new configuration contracts

This commit is contained in:
2026-11-21 14:36:07 +00:00
parent cf03bca753
commit bab3422e62
47 changed files with 183 additions and 155 deletions

View File

@@ -239,6 +239,11 @@ func publicSurfaceViolations(pkg *types.Package, modulePath string) []string {
case *types.Named:
inspectTypeArgs(value.TypeArgs(), where)
if isInternalPackage(value.Obj().Pkg(), modulePath) {
if isSharedSettingsType(value.Obj(), modulePath) {
inspect(value.Underlying(), where)
inspectMethods(value, where)
return
}
record(where, value)
return
}
@@ -343,6 +348,18 @@ func publicSurfaceViolations(pkg *types.Package, modulePath string) []string {
return compactStrings(violations)
}
func isSharedSettingsType(obj *types.TypeName, modulePath string) bool {
if obj == nil || obj.Pkg() == nil || obj.Pkg().Path() != modulePath+"/internal/settings" {
return false
}
switch obj.Name() {
case "Settings", "CollectionSettings", "BackendSettings", "ProfileSettings", "PromptSettings", "PromptInputSettings", "PromptMessageSettings", "PromptCacheControlSettings", "PromptOutputSettings", "BackendSmokeTestConfig", "ReachabilityProbeConfig", "AuthenticationProbeConfig":
return true
default:
return false
}
}
func isInternalPackage(pkg *types.Package, modulePath string) bool {
return pkg != nil && strings.HasPrefix(pkg.Path(), modulePath+"/internal/")
}