Repository navigation
runtime/flybot-image: keep the model-api recipe test off the host secret store - #3492
Merged
Merged
Conversation
…ret store
The model-api test asserted that resolveModelApiPath({}) and loadModelApi({})
are undefined, which only holds on a host without a provisioned model-api
file. On a configured host the default candidate list finds the real
/run/secrets file, both assertions fail, and the recipe suite can never be
green there while CI stays green because the runner has no such file.
Take the default candidate list as an optional second argument, pass an
explicit empty list from the test, and assert that every default candidate
lives under an allowed prefix. Production callers keep the single-argument
form, so the default resolution path is unchanged.
Refs #3490
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
runtime/flybot-image's model-api test asserted thatresolveModelApiPath({})andloadModelApi({})areundefined. That only holds on a host with no provisioned model-api file: on a configured host/run/secrets/flybot-workspace-model-api.jsonexists, the default candidate list finds it, and both assertions fail. CI stays green only because the runner has no such file, so the recipe suite can never be green on an operational host.resolveModelApiPath(env, defaults = DEFAULT_FILES)andloadModelApi(env, defaults = DEFAULT_FILES): the default candidate list becomes an optional second argument. Single-argument callers (runtime/flybot-image/ds-bot-bridge.mjs,launch.mjs) behave exactly as before.DEFAULT_FILESlives under anALLOWED_PREFIXESdirectory. This keeps the invariant the old assertion was reaching for — the defaults must be pathsreadModelApiFileaccepts — and is whyALLOWED_PREFIXESis now exported.Acceptance
runtime/flybot-imagenpm testgives 29/29 pass; basea062ba2158261ed0e5e5e217723e19df290ff02agives 28/29 with this test as the single failure.defaultsargument makes it fail again.Local readings (not CI)
runtime/flybot-imagenpm test: 29 tests, 29 pass, 0 fail, rc 0 (host has/run/secrets/flybot-workspace-model-api.json, 272 B).node --test --test-concurrency=2 tests/*.test.mjs: 974 pass, 0 fail, rc 0, 8.3 s.3f164e11test/model-api.test.jsalone: 4 pass, 1 fail.Scope
Two files. The default resolution path for production callers is unchanged; only the test's view of host state changes.
Refs #3490