Repository navigation
Conversation
…preter through one lookup (#20932)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Code review (code-reviewer pass) at b9c58d0Verdict: APPROVE-READY — all seven earlier findings are fixed at this head; no new findings.
New findings at this head: none Not checked: I ran no tests (neither the shell tests nor pytest) and no Ansible runs; this is a read of the diff. Behaviour of |
Thinking Path
Once
autobot_sharedrefuses interpreters below the.python-versionfloor at import (#20903), a node venv built with a barepython3is unusable on any node whosepython3is older, and a hard-codedpython3.14is right only until the next floor bump. The Ansible side already had one derivation (python_interpreter_binary), so the fix extends that role rather than adding a second lookup; scripts outside Ansible get one small shared shell helper that mirrors howinstall.shprovisions Python from deadsnakes. A guard then keeps both from coming back.What Changed
roles/python_interpreter/tasks/resolve.yml(new): the single derivation ofpython_interpreter_version/python_interpreter_binaryfrom.python-version;tasks/main.ymlincludes it instead of carrying its own copy. Roles that only need the name call it withtasks_from: resolve.python3replaced with the floor binary:slm_agentrole,enroll-node.yml(npu-worker and ai-stack paths, now also installing the interpreter first),dependency_patching/update-venv.yml(both pip fallbacks).python3.14replaced with{{ python_interpreter_binary }}: npu-worker, tts-worker, agent_config, backend, backend_services, ai-stack, slm_manager, redis/chromadb (create step, pip fallbacks,ensure_venv_versiontargets). In ai-stack and slm_manager the stale-venv version checks derive from the same variable instead of a3.14literal.scripts/lib/python_floor.sh(new, withpython_floor_test.sh, registered inrepo_tests/shell_lib_test.py):version | binary | ensure;ensureinstalls from deadsnakes when missing and otherwise refuses with a clear message; no fallback version. Used bydeploy-autobot-native.sh,setup_repair.sh,code_analysis/install.sh,bootstrap-slm.sh(through a one-line remote command, so the file stays at its size ceiling) anddeploy_autobot.py(through the helper).repo_tests/venv_builders_use_floor_interpreter_20932_test.py: no bare or hard-codedpython3[.N] -m venvand novenv_python: python3.Nin the deploy and infrastructure paths; control strings for both directions; every allowlist entry needs a reason and must still match.resolvetasks and the include calls that run only them are taggedalways(a--tags venvrun no longer leavespython_interpreter_binaryundefined);slm_agentand bothenroll-node.ymlcreate tasks runensure_venv_versionfirst;python_floor_venv_matches(version check on a venv'sbin/python) is used bydeploy-autobot-native.shandsetup_repair.shto rebuild a venv on an older interpreter; deadsnakes provisioning is Ubuntu-only (/etc/os-releaseID=ubuntu), other OSes are refused naming the OS and interpreter, and the hidden|| trueis gone; auto-install prints a notice and is documented in the helper header;.python-versionwithout a trailing newline reads correctly; the venv dir for the remote command must match^[A-Za-z0-9_./-]+$.repo_tests/python_version_declaration_drift_test.py: one line now reads the derivation fromresolve.yml(where it moved).Not in this PR:
autobot-infrastructure/shared/scripts/install-slm.sh(barepython3 -m venv): open PRs feat(slm): a stored SSH password deletion is proposed through the review queue (#20046) #20587 and feat(approvals): an approved realign of the backend's internal key is applied by the next update (#20750) #20777 edit it. It joins this same PR after they land, which is why this PR isRefs, notCloses.playbooks/deploy-native-services.yml(three hard-codedpython3.14sites): same two open PRs touch it. Allowlisted in the guard with that reason, to be converted together withinstall-slm.sh.setup-runner-python.sh:66andfix-backend-environment.yml:51only print a hint, they build nothing (allowlisted with that reason).Verification
~/.venv-python-suite/bin/python -m pytest repo_tests/venv_builders_use_floor_interpreter_20932_test.py repo_tests/python_version_declaration_drift_test.py repo_tests/ansible_pip_venv_creation_test.py repo_tests/shell_lib_test.py -qbash scripts/lib/python_floor_test.sh(21 cases, including a floor bump to 3.15 and a missing interpreter refusing)ansible-playbook --syntax-checkonenroll-node.ymlanddeploy-full.yml;autobot-slm-backend/ansible/tests/check_venv_producers.py;autobot-slm-backend/tests/services/test_role_registry.py.Risks
slm_agentandenroll-nodenow install the floor interpreter (deadsnakes) on nodes that did not have it; that is the intent, but it is a new apt step on those paths.Model Used
Claude Sonnet 5.5 (claude-sonnet-5-5)
Issue Link
Refs #20932
Changelog fragment
changelog/unreleased/{issue}-{slug}.md— or N/A (internal change)Checklist
CLAUDE.mdgit commitruns them automatically)main(notrelease)Single-issue rationale: install-slm.sh must follow this change in the same PR once its two open PRs land, so it cannot be batched with another issue.