mirror of
https://scm.tikali.ai/tikali/applications/monky/monky-deployd.git
synced 2026-09-18 05:36:15 +00:00
fix(bundle): ${VAR} inside comment lines is not a reference
The renderer's .env.template header literally says "substitutes every
${VAR}", which the refusal check counted as an unresolved variable
(ENV_INCOMPLETE: unresolved: VAR) — env-qa-02's first bundle was refused.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KLB7jieMNRkTsJ2epr4Ds1
This commit is contained in:
@@ -79,3 +79,16 @@ def test_disk_need_bytes_spellings():
|
||||
assert b.parse(tar_bytes(make_files(meta={"agent": {"disk_need_bytes": 5}}))).disk_need_bytes == 5
|
||||
assert b.parse(tar_bytes(make_files(meta={"disk": {"need_bytes": 7}}))).disk_need_bytes == 7
|
||||
assert b.parse(tar_bytes(make_files())).disk_need_bytes == 0
|
||||
|
||||
|
||||
def test_placeholders_in_comment_lines_are_not_references():
|
||||
"""The renderer's .env.template header says '... substitutes every ${VAR} ...' — that must not
|
||||
become an unresolved 'VAR' (env-qa-02 pilot: ENV_INCOMPLETE: unresolved: VAR)."""
|
||||
from monky_deployd.bundle import defaulted_vars, referenced_vars
|
||||
|
||||
text = (
|
||||
"# The on-box agent substitutes every ${VAR} from OpenBao per secrets.manifest.json.\n"
|
||||
" # ${ALSO_COMMENT}\nGEMINI_API_KEY=${GEMINI_API_KEY}\nPG=${PGPASSWORD:-x}\n"
|
||||
)
|
||||
assert referenced_vars(text) == {"GEMINI_API_KEY", "PGPASSWORD"}
|
||||
assert defaulted_vars(text) == {"PGPASSWORD"}
|
||||
|
||||
Reference in New Issue
Block a user