Fix local run freshness and plugin asset handling
This commit is contained in:
@@ -402,9 +402,10 @@ type GamePluginManifestRegistrationRequest struct {
|
||||
}
|
||||
|
||||
type PluginAssetFileBody struct {
|
||||
Path string `json:"path"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Mode int `json:"mode,omitempty"`
|
||||
Path string `json:"path"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Encoding string `json:"encoding,omitempty"`
|
||||
Mode int `json:"mode,omitempty"`
|
||||
}
|
||||
|
||||
type GamePluginCreateRequest struct {
|
||||
@@ -1039,7 +1040,7 @@ func pluginAssetFilesToDomain(files []PluginAssetFileBody) []domain.PluginAssetF
|
||||
}
|
||||
out := make([]domain.PluginAssetFile, len(files))
|
||||
for i, file := range files {
|
||||
out[i] = domain.PluginAssetFile{Path: file.Path, Content: file.Content, Mode: file.Mode}
|
||||
out[i] = domain.PluginAssetFile{Path: file.Path, Content: file.Content, Encoding: file.Encoding, Mode: file.Mode}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func TestGamePluginManifestRegistrationToDomainCopiesSlices(t *testing.T) {
|
||||
AI: GamePluginManifestAIBody{Purposes: []string{"logs.diagnose"}},
|
||||
},
|
||||
AssetFiles: []PluginAssetFileBody{
|
||||
{Path: "actions/install.json", Content: "{}", Mode: 0o600},
|
||||
{Path: "actions/install.json", Content: "{}", Encoding: "base64", Mode: 0o600},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func TestGamePluginManifestRegistrationToDomainCopiesSlices(t *testing.T) {
|
||||
domainRegistration.Manifest.Pages[0].Permissions[0] = "ai.invoke"
|
||||
domainRegistration.Manifest.AI.Purposes[0] = "config.suggest"
|
||||
|
||||
if request.Manifest.Tags[0] != "example" || request.Manifest.Server.SupportedOS[0] != "linux" || request.Manifest.AssetFiles[0].Path != "actions/install.json" || request.AssetFiles[0].Content != "{}" || request.Manifest.Pages[0].Permissions[0] != "server.logs.read" || request.Manifest.AI.Purposes[0] != "logs.diagnose" {
|
||||
if request.Manifest.Tags[0] != "example" || request.Manifest.Server.SupportedOS[0] != "linux" || request.Manifest.AssetFiles[0].Path != "actions/install.json" || request.AssetFiles[0].Content != "{}" || request.AssetFiles[0].Encoding != "base64" || request.Manifest.Pages[0].Permissions[0] != "server.logs.read" || request.Manifest.AI.Purposes[0] != "logs.diagnose" {
|
||||
t.Fatalf("expected manifest request slices to be copied, got %+v", request)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user