fix(builder): boot drafts with the settings a new server really gets
The builder's boot test filled every blank password-like setting with a throwaway value. A real deploy only fills x-generate fields, so a draft whose server refuses to run with an empty join password passed the builder and CI, and then shut down on its first real deploy. The builder now boots drafts with boottest-payload -as-deployed: only x-generate fields are filled, everything else exactly as the template's defaults. A server that won't run with its own defaults fails the build, and the model is told that empty settings stay empty, so the value must come from a default or x-generate. CI's boot test is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d1505991e4
commit
72a4280d44
3 files changed
+25
-4
No files matched your search
@@ -32,6 +32,8 @@ func runBootTestPayload(args []string) error {
|
||||
fs := flag.NewFlagSet("boottest-payload", flag.ExitOnError)
|
||||
gamesDir := fs.String("games", "games", "directory holding one folder per game")
|
||||
out := fs.String("out", "", "file to write (default stdout)")
|
||||
asDeployed := fs.Bool("as-deployed", false, "settings exactly as a new server gets them: only x-generate fields filled, "+
|
||||
"no throwaway passwords (the AI builder boots drafts this way)")
|
||||
fs.Parse(args)
|
||||
if fs.NArg() != 1 {
|
||||
return errors.New("boottest-payload needs a game id")
|
||||
@@ -72,10 +74,11 @@ func runBootTestPayload(args []string) error {
|
||||
}
|
||||
}
|
||||
// Like the panel fills blank x-generate fields on deploy; other blank passwords (which an owner
|
||||
// would type in, and some games refuse to start without) get a throwaway value too
|
||||
// would type in, and some games refuse to start without) get a throwaway value too, except
|
||||
// -as-deployed: a draft must start with exactly what a new server gets
|
||||
for key, p := range schemaProperties(g) {
|
||||
prop, _ := p.(map[string]any)
|
||||
if prop["x-generate"] == nil && !passwordKey.MatchString(key) {
|
||||
if prop["x-generate"] == nil && (*asDeployed || !passwordKey.MatchString(key)) {
|
||||
continue
|
||||
}
|
||||
// Only missing or empty text: ports, booleans and other values are never touched
|
||||
|
||||
Reference in new issue
Block a user