Remove legacy client-manager workflows
This commit is contained in:
@@ -24,7 +24,6 @@ func ValidateGamePluginRuntimeProfiles(profiles domain.GamePluginRuntimeProfiles
|
||||
transportProfiles := map[string]domain.RuntimeTransportProfile{}
|
||||
dataTargetKeys := map[string]struct{}{}
|
||||
dataTargetWorkspaces := map[string]struct{}{}
|
||||
managerKeys := map[string]struct{}{}
|
||||
dllExtensionKeys := map[string]struct{}{}
|
||||
dllExtensionStates := map[string]string{}
|
||||
discoveryKeys := map[string]struct{}{}
|
||||
@@ -66,7 +65,7 @@ func ValidateGamePluginRuntimeProfiles(profiles domain.GamePluginRuntimeProfiles
|
||||
}
|
||||
violations = append(violations, duplicateViolations(prefix+".transportKeys", profile.TransportKeys)...)
|
||||
if profile.ClientManagerRef != "" {
|
||||
violations = append(violations, validateProfileKey(prefix+".clientManagerRef", profile.ClientManagerRef)...)
|
||||
violations = append(violations, prefix+".clientManagerRef is no longer supported")
|
||||
}
|
||||
for j, key := range profile.DLLExtensionRefs {
|
||||
violations = append(violations, validateProfileKey(fmt.Sprintf("%s.dllExtensionRefs[%d]", prefix, j), key)...)
|
||||
@@ -235,7 +234,7 @@ func ValidateGamePluginRuntimeProfiles(profiles domain.GamePluginRuntimeProfiles
|
||||
prefix := fmt.Sprintf("runtimeProfiles.logSources[%d]", i)
|
||||
violations = append(violations, validateProfileKey(prefix+".key", source.Key)...)
|
||||
violations = append(violations, recordRuntimeProfileKey(logSourceKeys, prefix+".key", source.Key)...)
|
||||
if !oneOf(source.Kind, "process.stdout", "process.stderr", "file.tail", "ftp.poll", "sql.query", "client-manager") {
|
||||
if !oneOf(source.Kind, "process.stdout", "process.stderr", "file.tail", "ftp.poll", "sql.query") {
|
||||
violations = append(violations, prefix+".kind is invalid")
|
||||
}
|
||||
if source.TargetKey != "" {
|
||||
@@ -299,133 +298,8 @@ func ValidateGamePluginRuntimeProfiles(profiles domain.GamePluginRuntimeProfiles
|
||||
violations = append(violations, prefix+".transportKey must reference a declared SQLite query transport")
|
||||
}
|
||||
}
|
||||
for i, manager := range profiles.ClientManagers {
|
||||
prefix := fmt.Sprintf("runtimeProfiles.clientManagers[%d]", i)
|
||||
violations = append(violations, validateProfileKey(prefix+".key", manager.Key)...)
|
||||
violations = append(violations, recordRuntimeProfileKey(managerKeys, prefix+".key", manager.Key)...)
|
||||
parsed, err := url.Parse(manager.RepositoryURL)
|
||||
if err != nil || parsed.Scheme != "https" || parsed.Host == "" || parsed.User != nil || parsed.RawQuery != "" || parsed.Fragment != "" || !strings.HasSuffix(parsed.Path, ".git") {
|
||||
violations = append(violations, prefix+".repository.url must be a credential-free HTTPS .git URL")
|
||||
}
|
||||
if !oneOf(manager.RevisionPolicy, "pinned", "branch", "tag") {
|
||||
violations = append(violations, prefix+".repository.revisionPolicy is invalid")
|
||||
}
|
||||
switch manager.RevisionPolicy {
|
||||
case "pinned":
|
||||
if manager.Revision == "" {
|
||||
violations = append(violations, prefix+".repository.revision is required for pinned policy")
|
||||
}
|
||||
case "branch":
|
||||
if manager.Branch == "" {
|
||||
violations = append(violations, prefix+".repository.branch is required for branch policy")
|
||||
}
|
||||
case "tag":
|
||||
if manager.Tag == "" {
|
||||
violations = append(violations, prefix+".repository.tag is required for tag policy")
|
||||
}
|
||||
}
|
||||
if !oneOf(manager.BuildSystem, "go", "npm", "cargo", "make") {
|
||||
violations = append(violations, prefix+".build.system is invalid")
|
||||
}
|
||||
if len(manager.SupportedTargets) == 0 {
|
||||
violations = append(violations, prefix+".supportedTargets must not be empty")
|
||||
}
|
||||
if len(manager.OutputArtifacts) == 0 {
|
||||
violations = append(violations, prefix+".outputArtifacts must not be empty")
|
||||
}
|
||||
for field, value := range map[string]string{"displayName": manager.DisplayName, "branch": manager.Branch, "tag": manager.Tag, "revision": manager.Revision, "workspaceRef": manager.WorkspaceRef, "entryRef": manager.EntryRef} {
|
||||
violations = append(violations, validateSafeRuntimeValue(prefix+"."+field, value)...)
|
||||
}
|
||||
targets := map[string]struct{}{}
|
||||
for j, target := range manager.SupportedTargets {
|
||||
if !validPluginSupportedOS(target.OS) || !oneOf(target.Arch, "amd64", "arm64") {
|
||||
violations = append(violations, fmt.Sprintf("%s.supportedTargets[%d] is invalid", prefix, j))
|
||||
}
|
||||
targetKey := target.OS + "/" + target.Arch
|
||||
if _, exists := targets[targetKey]; exists {
|
||||
violations = append(violations, fmt.Sprintf("%s.supportedTargets[%d] is duplicated", prefix, j))
|
||||
}
|
||||
targets[targetKey] = struct{}{}
|
||||
}
|
||||
configKeys := map[string]struct{}{}
|
||||
for j, config := range manager.ConfigTemplates {
|
||||
violations = append(violations, validateProfileKey(fmt.Sprintf("%s.configTemplates[%d].key", prefix, j), config.Key)...)
|
||||
violations = append(violations, recordRuntimeProfileKey(configKeys, fmt.Sprintf("%s.configTemplates[%d].key", prefix, j), config.Key)...)
|
||||
violations = append(violations, validateSafeRuntimeValue(prefix+".configTemplates.templateRef", config.TemplateRef)...)
|
||||
violations = append(violations, validateSafeRuntimeValue(prefix+".configTemplates.outputRef", config.OutputRef)...)
|
||||
}
|
||||
for j, output := range manager.OutputArtifacts {
|
||||
violations = append(violations, validateSafeRuntimeValue(fmt.Sprintf("%s.outputArtifacts[%d]", prefix, j), output)...)
|
||||
}
|
||||
violations = append(violations, duplicateViolations(prefix+".outputArtifacts", manager.OutputArtifacts)...)
|
||||
if manager.Deployment.Mode != "" {
|
||||
if manager.Deployment.Mode != "run-supervised" {
|
||||
violations = append(violations, prefix+".deployment.mode is invalid")
|
||||
}
|
||||
if !validSemanticVersion(manager.Version) {
|
||||
violations = append(violations, prefix+".version must be semantic when deployment is declared")
|
||||
}
|
||||
violations = append(violations, validateSafeRelativeRuntimePath(prefix+".deployment.executableRef", manager.Deployment.ExecutableRef)...)
|
||||
if !containsString(manager.OutputArtifacts, manager.Deployment.ExecutableRef) {
|
||||
violations = append(violations, prefix+".deployment.executableRef must name an output artifact")
|
||||
}
|
||||
for j, argument := range manager.Deployment.Arguments {
|
||||
if !regexp.MustCompile(`^[A-Za-z0-9_./:=@+-]{1,120}$`).MatchString(argument) {
|
||||
violations = append(violations, fmt.Sprintf("%s.deployment.arguments[%d] is invalid", prefix, j))
|
||||
}
|
||||
violations = append(violations, validateSafeRuntimeValue(fmt.Sprintf("%s.deployment.arguments[%d]", prefix, j), argument)...)
|
||||
}
|
||||
if len(manager.Deployment.RequiredRunCapabilities) == 0 || !containsString(manager.Deployment.RequiredRunCapabilities, domain.JobCapabilityClientManagerDeploy) {
|
||||
violations = append(violations, prefix+".deployment.requiredRunCapabilities must include client-manager.deploy")
|
||||
}
|
||||
for j, capability := range manager.Deployment.RequiredRunCapabilities {
|
||||
if !oneOf(capability, domain.JobCapabilityClientManagerDeploy, domain.JobCapabilityClientManagerControl, domain.JobCapabilityClientManagerUpdate, domain.JobCapabilityClientManagerRollback, domain.JobCapabilityClientManagerUninstall) {
|
||||
violations = append(violations, fmt.Sprintf("%s.deployment.requiredRunCapabilities[%d] is invalid", prefix, j))
|
||||
}
|
||||
}
|
||||
violations = append(violations, duplicateViolations(prefix+".deployment.requiredRunCapabilities", manager.Deployment.RequiredRunCapabilities)...)
|
||||
if len(manager.Lifecycle.Actions) == 0 || manager.Lifecycle.StartupTimeoutSeconds < 1 || manager.Lifecycle.StartupTimeoutSeconds > 300 || manager.Lifecycle.StopTimeoutSeconds < 1 || manager.Lifecycle.StopTimeoutSeconds > 120 {
|
||||
violations = append(violations, prefix+".lifecycle actions and bounded timeouts are required")
|
||||
}
|
||||
for j, action := range manager.Lifecycle.Actions {
|
||||
if !oneOf(action, "start", "stop", "restart", "status", "update", "rollback", "uninstall") {
|
||||
violations = append(violations, fmt.Sprintf("%s.lifecycle.actions[%d] is invalid", prefix, j))
|
||||
}
|
||||
}
|
||||
violations = append(violations, duplicateViolations(prefix+".lifecycle.actions", manager.Lifecycle.Actions)...)
|
||||
if containsAny(manager.Lifecycle.Actions, []string{"start", "stop", "restart", "status"}) && !containsString(manager.Deployment.RequiredRunCapabilities, domain.JobCapabilityClientManagerControl) {
|
||||
violations = append(violations, prefix+".lifecycle control actions require client-manager.control")
|
||||
}
|
||||
if containsString(manager.Lifecycle.Actions, "update") && !containsString(manager.Deployment.RequiredRunCapabilities, domain.JobCapabilityClientManagerUpdate) {
|
||||
violations = append(violations, prefix+".lifecycle update requires client-manager.update")
|
||||
}
|
||||
if containsString(manager.Lifecycle.Actions, "rollback") && !containsString(manager.Deployment.RequiredRunCapabilities, domain.JobCapabilityClientManagerRollback) {
|
||||
violations = append(violations, prefix+".lifecycle rollback requires client-manager.rollback")
|
||||
}
|
||||
if containsString(manager.Lifecycle.Actions, "uninstall") && !containsString(manager.Deployment.RequiredRunCapabilities, domain.JobCapabilityClientManagerUninstall) {
|
||||
violations = append(violations, prefix+".lifecycle uninstall requires client-manager.uninstall")
|
||||
}
|
||||
if !oneOf(manager.Health.Mode, "component-heartbeat", "process") || manager.Health.IntervalSeconds < 5 || manager.Health.IntervalSeconds > 300 || manager.Health.DegradedAfterSeconds < manager.Health.IntervalSeconds*2 || manager.Health.OfflineAfterSeconds <= manager.Health.DegradedAfterSeconds || manager.Health.OfflineAfterSeconds > 3600 {
|
||||
violations = append(violations, prefix+".health mode and thresholds are invalid")
|
||||
}
|
||||
for j, capability := range manager.Health.RequiredCapabilities {
|
||||
if !oneOf(capability, "component.register", "component.heartbeat", "component.health", "component.control", "game-client.bridge", "logs.stream") {
|
||||
violations = append(violations, fmt.Sprintf("%s.health.requiredCapabilities[%d] is invalid", prefix, j))
|
||||
}
|
||||
}
|
||||
if manager.Health.Mode == "component-heartbeat" && !containsAny(manager.Health.RequiredCapabilities, []string{"component.register"}) || manager.Health.Mode == "component-heartbeat" && !containsString(manager.Health.RequiredCapabilities, "component.heartbeat") || manager.Health.Mode == "component-heartbeat" && !containsString(manager.Health.RequiredCapabilities, "component.health") {
|
||||
violations = append(violations, prefix+".health component-heartbeat requires register, heartbeat, and health capabilities")
|
||||
}
|
||||
minimum, minimumOK := semanticVersionTuple(manager.Compatibility.MinimumVersion)
|
||||
maximum, maximumOK := semanticVersionTuple(manager.Compatibility.MaximumVersion)
|
||||
version, _ := semanticVersionTuple(manager.Version)
|
||||
if manager.Compatibility.MinimumVersion != "" && !minimumOK || manager.Compatibility.MaximumVersion != "" && !maximumOK || minimumOK && maximumOK && compareSemanticVersion(minimum, maximum) > 0 || minimumOK && compareSemanticVersion(version, minimum) < 0 || maximumOK && compareSemanticVersion(version, maximum) > 0 {
|
||||
violations = append(violations, prefix+".compatibility version bounds are invalid")
|
||||
}
|
||||
if manager.UpdatePolicy.Strategy != "manual-staged" || !manager.UpdatePolicy.RequireApproval || !manager.UpdatePolicy.RetainPrevious || manager.UpdatePolicy.HealthConfirmationSeconds < manager.Health.IntervalSeconds || manager.UpdatePolicy.HealthConfirmationSeconds > 600 {
|
||||
violations = append(violations, prefix+".updatePolicy must be approved, staged, health checked, and retain previous")
|
||||
}
|
||||
}
|
||||
if len(profiles.ClientManagers) > 0 {
|
||||
violations = append(violations, "runtimeProfiles.clientManagers is no longer supported")
|
||||
}
|
||||
for i, extension := range profiles.DLLExtensions {
|
||||
prefix := fmt.Sprintf("runtimeProfiles.dllExtensions[%d]", i)
|
||||
@@ -442,11 +316,6 @@ func ValidateGamePluginRuntimeProfiles(profiles domain.GamePluginRuntimeProfiles
|
||||
violations = append(violations, fmt.Sprintf("runtimeProfiles.lifecycleProfiles[%d].transportKeys references undeclared transport %q", i, key))
|
||||
}
|
||||
}
|
||||
if profile.ClientManagerRef != "" {
|
||||
if _, ok := managerKeys[profile.ClientManagerRef]; !ok {
|
||||
violations = append(violations, fmt.Sprintf("runtimeProfiles.lifecycleProfiles[%d].clientManagerRef references undeclared client manager", i))
|
||||
}
|
||||
}
|
||||
if len(profile.DLLExtensionRefs) > 0 {
|
||||
if profile.Mode != "local-process" || !containsString(profile.Capabilities, domain.LifecycleCapabilityStart) || len(profile.Platforms) != 1 || profile.Platforms[0] != "windows" {
|
||||
violations = append(violations, fmt.Sprintf("runtimeProfiles.lifecycleProfiles[%d] DLL extensions require a windows local-process start profile", i))
|
||||
@@ -626,11 +495,8 @@ func validateRuntimeProfileCapabilityDeclarations(profiles domain.GamePluginRunt
|
||||
for i, transport := range profiles.TransportProfiles {
|
||||
check(fmt.Sprintf("runtimeProfiles.transportProfiles[%d].capabilities", i), transport.Capabilities)
|
||||
}
|
||||
for i, manager := range profiles.ClientManagers {
|
||||
check(fmt.Sprintf("runtimeProfiles.clientManagers[%d].deployment.requiredRunCapabilities", i), manager.Deployment.RequiredRunCapabilities)
|
||||
return violations
|
||||
}
|
||||
return violations
|
||||
}
|
||||
|
||||
func validateLifecycleActionsOptional(actions domain.PluginLifecycleActions) []string {
|
||||
var violations []string
|
||||
|
||||
Reference in New Issue
Block a user