You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(slm): a limited ansible run proves every host it names, not just one (#19766) - #20434
limit_run_failure accepted an exit-0 run when any named host beyond localhost had run. With several hosts, one that ran covered for one that was skipped, and the run reported success for a node that did nothing.
What Changed
services/ansible_utils.py: every non-localhost host in the limit needs ok>=1 in the last recap, or the run fails and names those that did not. The tolerance for group names is gone.
execute_playbook(must_run=...) narrows that. Self-update passes only the SLM's own node: its limit adds every row at the machine's IP, including stale rows and rows no play targets, and a false failure after a working update clears the resume plan and marks the stage failed. Co-located rows that did not run are printed as a NOTE, and fail nothing. This is narrower than the issue's text, on purpose; noted on fix(slm): an exit-0 ansible run limited to several hosts passes when only one of them ran #19766.
Verification
test_fleet_skip_lines_are_not_failures_19762.py and playbook_executor_limit_proof_19762_test.py pass locally; only these. New: two named hosts with one skipped fails and names only it, both ran passes, an all-skipped host (ok=0) fails, self-update passes with a stale row and prints it, and fails if the SLM node itself did not run. The single-host and mixed-play cases from #19762 are unchanged. No real fleet run.
Worth reviewing:
Group names: I read the limit at every execute_playbook caller, and they pass node ids or inventory names, not groups. api/infrastructure.py takes free limit_hosts but builds its own command, so this proof does not apply there. A future caller passing a group would read as a host that did not run; a test pins that.
The strict rule stays for the multi-host callers, which each pass a list someone chose: settings.py and llm_config.py (request.node_ids, both with --tags), updates.py (node_ids), secrets.py (nodes of the dependent roles), setup_wizard.py (reachable nodes). A host there with ok=0, from a --tags run matching nothing or all tasks skipped, now fails the run; single-host runs already did. Not run on a real fleet.
updates.py falls back to a bare IP when it finds no inventory name. Such a run now fails naming the IP.
limit_run_failure now fails when any non-localhost entry in the limit is absent from the last recap or has ok < 1. Tests cover missing and present hosts, and the updated failure message.
The check reports limit entries that are absent from the last recap or have ok < 1. Tests cover missing hosts, hosts that ran, and the updated error message.
Severity of issue fixed: Medium
Merge Risk: Minimal · previous review b7b5d
The stricter limit check requires successful-task evidence for every named remote host. No new merge-blocking issue is established; the infrastructure API's existing completion-check gap remains a separate follow-up.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a limited Ansible run must prove every host it names ran, not just one. The raw summary confirms that limit_run_failure now fails when any non-localhost host named in …
Linked Issues check
Issue #19766 requires proof for every non-localhost limit entry. limit_run_failure reads the last PLAY RECAP and reports each entry that is absent or has ok < 1. The tests cover two named hosts …
Out of Scope Changes check
The changes are limited to the limit-proof logic and its focused tests. The group-name test verifies the stated removal of group tolerance. The test updates support issue #19766 behaviour. No unrelate…
Full details: Title check
Explanation
The title names the main change: a limited Ansible run must prove every host it names ran, not just one. The raw summary confirms that limit_run_failure now fails when any non-localhost host named in the limit is missing from the recap or has ok < 1. The title is specific and matches the linked issue objective. It uses a conventional commit prefix and an issue reference, which is acceptable.
Full details: Linked Issues check
Explanation
Issue #19766 requires proof for every non-localhost limit entry. limit_run_failure reads the last PLAY RECAP and reports each entry that is absent or has ok < 1. The tests cover two named hosts with one skipped, both named hosts running, localhost-only behaviour, and the existing single-host and mixed-play cases from #19762. The executor test also confirms that the failed result names the missing host and that a complete recap succeeds.
Full details: Out of Scope Changes check
Explanation
The changes are limited to the limit-proof logic and its focused tests. The group-name test verifies the stated removal of group tolerance. The test updates support issue #19766 behaviour. No unrelated change is demonstrated.
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Notice: 29 open PRs — past the runaway threshold (25)
This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.
This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.
If the queue is draining normally, ignore this. Otherwise:
Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
Look for a loop opening near-identical PRs
Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.
The reason will be displayed to describe this comment to others. Learn more.
Follow-up Comments
Apply the per-host limit check to the infrastructure API run.
88-88: Major · Functional Correctness · Quick win
Apply the per-host limit check to the infrastructure API run.
_run_playbook marks a limited run COMPLETED when any host ran. A named host can still be skipped. This path predates the change, but this PR's rule does not reach it. Call limit_run_failure(text, limit_hosts) after ansible_run_failure returns None.
Suggested fix
Add limit_run_failure to the existing import from services.ansible_utils. The import line was not inspected, so the diff covers only the call site.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Code review on PR #20434 (head a7e2789): approve. Delta since b7b5dc7, read only: self-update requires only its own node to have run, and co-located rows that did not run print as a note. Strict stays for the five named callers. Risk: --tags on the strict multi-host callers can now fail where a tag matches nothing on one host; not run on a fleet. Narrower than the issue text, as noted there.
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
phase:M1.4Wizard and SLM: choose a mode, apply it, default models work
1 participant
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.
Thinking Path
limit_run_failureaccepted an exit-0 run when any named host beyond localhost had run. With several hosts, one that ran covered for one that was skipped, and the run reported success for a node that did nothing.What Changed
services/ansible_utils.py: every non-localhost host in the limit needsok>=1in the last recap, or the run fails and names those that did not. The tolerance for group names is gone.execute_playbook(must_run=...)narrows that. Self-update passes only the SLM's own node: its limit adds every row at the machine's IP, including stale rows and rows no play targets, and a false failure after a working update clears the resume plan and marks the stage failed. Co-located rows that did not run are printed as aNOTE, and fail nothing. This is narrower than the issue's text, on purpose; noted on fix(slm): an exit-0 ansible run limited to several hosts passes when only one of them ran #19766.Verification
test_fleet_skip_lines_are_not_failures_19762.pyandplaybook_executor_limit_proof_19762_test.pypass locally; only these. New: two named hosts with one skipped fails and names only it, both ran passes, an all-skipped host (ok=0) fails, self-update passes with a stale row and prints it, and fails if the SLM node itself did not run. The single-host and mixed-play cases from #19762 are unchanged. No real fleet run.Worth reviewing:
execute_playbookcaller, and they pass node ids or inventory names, not groups.api/infrastructure.pytakes freelimit_hostsbut builds its own command, so this proof does not apply there. A future caller passing a group would read as a host that did not run; a test pins that.settings.pyandllm_config.py(request.node_ids, both with--tags),updates.py(node_ids),secrets.py(nodes of the dependent roles),setup_wizard.py(reachable nodes). A host there with ok=0, from a--tagsrun matching nothing or all tasks skipped, now fails the run; single-host runs already did. Not run on a real fleet.updates.pyfalls back to a bare IP when it finds no inventory name. Such a run now fails naming the IP.Model Used
Claude Opus 5.5
Closes #19766
🤖 Generated with Claude Code