Skip to content

fix(updater): the internal-key proposal step can no longer abort a node's update (#21343) - #21399

Merged
mrveiss merged 10 commits into
mainfrom
issue-21343-updater-proposal-not-fatal
Nov 12, 2026
Merged

mrveiss merged 10 commits into
mainfrom
issue-21343-updater-proposal-not-fatal

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Refs #21343
Refs #20750

Thinking Path

  • The main node's updater play ends at Internal key | Propose re-aligning the backend's key to the SLM's (#20750): logged FAILED about 2 ms after its banner on every run (output hidden by no_log), so no remote module ran. Everything after it in Play 2 is skipped (restarts of the backend, Celery, AI stack and workers; module syncs; user-frontend sync and build).
  • failed_when: false absorbs only a module result, so an HTTP refusal would have been reported, not fatal. The failure is in templating the task's arguments.
  • How the updater's inventory is built, by reading: the self-update generates its inventory from the node registry into a temp file whose globals are only the fixed set in the inventory builder (user, key file, interpreter, slm_host, subnet, gateway). The executor then symlinks inventory/group_vars/ beside it, so all.yml and infrastructure.yml load for the groups the node is in.
Variable Defined on the updater's inventory? From
infrastructure (dict) yes, for hosts in the infrastructure group inventory/group_vars/infrastructure.yml, linked beside the generated inventory
infrastructure.hosts.* templated as part of the dict; raised for a missing group same file, unguarded groups[...][0]
backend_port NOT globally; only after playbooks/vars/backend-env.yml is loaded that vars file, loaded by include_vars in Play 2
vnc_nodes group no all.yml already treats it as optional
  • Most probable root cause (unproven until an update runs): the include's URL used infrastructure.ports.backend; looking up infrastructure templates the whole dict, and its reserved_1 entry indexes the vnc_nodes group, which does not exist, so templating raised before any HTTP call. The evidence supports "defined but raising", not "undefined".
  • Play 2 restarts are inline tasks (no handlers); Play 2 keeps any_errors_fatal.

What Changed

  • playbooks/update-all-nodes.yml: the key URL (both include sites) and the "Wait for API to be ready" probe use backend_port, the variable the backend's unit and env are rendered from in this play (playbooks/vars/backend-env.yml). The include of that file moved before the proposal include and is tagged exactly always: readers sit under backend, env and restart, and a skip tag matches any tag on a task, so any tag other than always could be skipped while a reader still ran. Its 'backend' in group_names condition is unchanged; --skip-tags always is the one selection that skips it. The probe's hardcoded port is gone, with its stale entry in the hardcoded-values baseline.
  • inventory/group_vars/infrastructure.yml: all 8 host entries use the idiom all.yml uses for vnc_nodes: {{ (hostvars[groups['x'][0]]['ansible_host'] | default('127.0.0.1')) if groups.get('x') else '127.0.0.1' }}. Same value when the group exists.
  • _shared/tasks/realign_internal_api_key_claim.yml: the propose/claim unit is a block with a rescue that records a key-free line (HTTP status, result field names, error text only if it holds neither key; braces neutralised; keys cast to strings; every variable defaulted) and prints it.
  • Play 3 summary gets a "Credential re-alignment" line.
  • repo_tests/updater_realign_proposal_not_fatal_21343_test.py: guards for the rescue, the URL not using the infrastructure dict, every URL variable being defined by the vars file loaded before it or by the registry inventory's globals (shared parse cache), the probe using the same variable, the vars load tagged exactly always and preceding its first reader, and the guarded idiom for each host entry.
  • The port is still stated in several other places; consolidating them is deploy: state the backend port once and derive every other statement from it #21400 (sub-issue of bug(updater): update leaves the main backend and workers running pre-update code — no restart after code sync #21343).

Verification

  • NOT verified: no ansible run, no local tests (CI only). The changed YAML files load.
  • Unproven: that the infrastructure templating was the actual failure; that the guarded idiom behaves as intended on the controller's Ansible version; whether a no_log task's failed result keeps msg for the rescue line; that a rescued failure avoids the play's any_errors_fatal (the playbook's agent-redeploy rescue relies on it).
  • Host evidence needed after the next update: main backend, Celery and workers restarted; user frontend synced and rebuilt; the summary shows a pending approval id or the reported shape. bug(updater): update leaves the main backend and workers running pre-update code — no restart after code sync #21343 stays open until then.

Model Used

Claude Sonnet 5.5

@mrveiss mrveiss added bug Something isn't working priority: high backend deployment infrastructure area: deploy-lifecycle Wave 1 · cluster O — Deploy, provision & lifecycle phase:M1.4 Wizard and SLM: choose a mode, apply it, default models work labels Nov 12, 2026
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 95511a1 and c38e4ad.

Files ignored due to path filters: 1

  • pipeline-scripts/hardcoded_values_baseline.txt is excluded by !**/*_baseline.txt, !pipeline-scripts/hardcoded_values_baseline.txt
Files selected for processing: 4

  • autobot-slm-backend/ansible/_shared/tasks/realign_internal_api_key_claim.yml
  • autobot-slm-backend/ansible/inventory/group_vars/infrastructure.yml
  • autobot-slm-backend/ansible/playbooks/update-all-nodes.yml
  • repo_tests/updater_realign_proposal_not_fatal_21343_test.py
  • 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.

Share

@github-actions

Copy link
Copy Markdown
Contributor

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.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. 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
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CHANGES @ 91f8d16

The rescue is the right shape and is safe to continue past, but the PR leaves the actual defect in place, so the credential re-alignment stays dead on every run. One rescue-side hazard is also unaddressed.

Severity Where Finding Required fix
High playbooks/update-all-nodes.yml L1201 (and L1508); inventory/group_vars/infrastructure.yml L53 Most probable root cause (not proven; see below). internal_api_key_backend_url is http://127.0.0.1:{{ infrastructure.ports.backend }}. These two include sites are the only uses of infrastructure.* in this playbook. Ansible templates the whole infrastructure dict when the variable is looked up, including hosts.reserved_1, which is hostvars[groups['vnc_nodes'][0]].... vnc_nodes is not a group in the inventory (all.yml L501 itself treats it as optional with groups.get('vnc_nodes', [])). groups['vnc_nodes'][0] raises, and the | default after it never applies. That is a controller-side templating error in the task's url, which failed_when: false cannot absorb, hidden by no_log, and it matches a failure about 2 ms after the banner. The existing ansible test (test_internal_key_realign_ansible_20750.py) passes internal_api_key_backend_url directly, so it never exercised this expression. Fix the cause as well as rescuing it. Derive the URL from a flat port variable instead of the infrastructure convenience dict (L1201 and L1508), and make reserved_1 tolerate a missing group (groups.get('vnc_nodes', [])). Without this the rescue turns a loud fatal into a permanent no-op: no proposal is ever raised, and the "A person must raise the approval" text does not say how.
Medium rescue set_fact / debug (claim file) and Play 3 summary The report embeds ansible_failed_result.msg and is then re-templated twice (msg: "{{ internal_api_key_realign_report }}", and the Play 3 join). The set_fact result is not marked unsafe. If the error text carries Jinja delimiters (templating errors can quote the offending string), the debug inside the rescue fails with a second templating error. The rescue then fails, and any_errors_fatal ends the play, which is the original symptom. Neutralise braces in the embedded text (e.g. | replace('{','(') | replace('}',')')), or emit it through to_json, before it enters the variable.
Medium rescue set_fact The key check is select('in', _msg) over by_file.values() + [canonical] with empty values dropped. A digit-only key could be coerced to int by set_fact and make in raise TypeError inside the rescue. The check also depends on by_file being a dict. Cast to string in the list (| map('string')) and keep the default wrappers, which are otherwise present on every expression.
Low rescue / no_log The rescue relies on ansible_failed_result.msg carrying the cause although the failed task is no_log. Ansible censors in the callback, not in the stored result, so it should work, but this is unverified. If it does not, the report shows only censored and the PR's stated purpose (reveal the cause) fails. Confirm on the host after the next update; state the result in #21343.
Low durability (#17038) The only trace of a proposal that could not be recorded is a play-output line and the Play 3 summary. The playbook's other FINDING and WARNING lines are also debug-only, so this is consistent. But with no approval row created, the maintenance UI shows nothing. Say so in #21343 and keep it open until the root cause is fixed and a proposal is observed.
Low tests test_nothing_in_the_rescue_can_fail_again checks only that failed_when is not true; it does not pin default(...) on referenced variables or brace-neutralising. Nothing pins the URL source from the High finding. Otherwise they are fair shape pins: removing the rescue turns test 1 red; the no_log test works; no randomness; names are unique; YAML is read via read_text. Add a pin that no variable in the rescue lacks default, and a pin that internal_api_key_backend_url does not reference infrastructure.*.

Checked and fine:

  • Rescued failures do not mark the host failed, so any_errors_fatal does not trigger (rescued=1 in the recap). The playbook already relies on this in Play 2 at the slm_agent redeploy block, though that does not prove the behaviour for this Ansible version.
  • Continuing past the rescue is safe. The "Apply" set_fact reads _internal_key_realign_claim.status | default(0), which is false when undefined. The verify include only runs when applying. The env render keeps each file's own key, as before bug(secrets): every SLM System-vault call to the backend is refused (401) on the dev host; 0 of 118 succeeded in 7 days #20750.
  • Play 3 reads the report through extract plus select('defined'), so a node that never reached the include is skipped safely.
  • No path writes, rotates or aligns a key, and nothing is created pre-approved.
  • The pending, approved and refused lines carry only an approval id and an HTTP status.
  • No unresolved threads. Refs is used, not Closes, so the issue stays open. Labels and milestone are present.

Not verified: no ansible run; the root cause is a source-reading inference. The single line that would settle it is the rescue report (or the task run without no_log) showing "no attribute 'vnc_nodes'" or an undefined-variable text.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Round update for the review at 91f8d16, now at 2efc171:

  • High: the include's URL no longer uses the infrastructure dict (both sites use the inventory's flat backend_port), and every groups[...][0] host entry in infrastructure.yml is guarded with groups.get. Guards pin both.
  • Medium: braces in the embedded error text are neutralised; keys are cast with map('string'); the key map is checked with is mapping.
  • Low: the rescue test now pins a default on each variable the rescue reads, and brace neutralisation.
    Still unproven: no ansible run; whether a no_log failed result keeps msg. The PR body says so.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CHANGES @ 2efc171

The rescue hardening looks sound by reading. The URL fix looks like it swaps one templating fatal for another, and the new group_vars expressions are not shown to be safe.

Severity Where Finding Required fix
High update-all-nodes.yml (both internal_api_key_backend_url sites) backend_port is not defined on the inventory the updater actually uses. The self-update runs through playbook_executor._select_inventory, which generates the inventory with inventory_builder.build_registry_inventory. Its global vars (_ALL_VARS: user, key file, interpreter, slm_host, subnet, gateway) contain no backend_port. The fallback is the static slm-nodes.yml, which has none either. backend_port exists only in production.yml L39 (a different static inventory) and in inventory/dynamic/generate_inventory.py (a script the updater does not call). group_vars/all.yml references it (L116) but never defines it. So {{ backend_port }} raises an undefined-variable error when the url is templated: the same class of fatal. The rescue absorbs it, but the proposal still never runs. Do not use a variable that only some inventories define. Either keep infrastructure.ports.backend and make its hosts entries safe (see next row), or add backend_port to the registry inventory's _ALL_VARS and use backend_port | default(<SSOT value>). Pin whichever you choose in the tests against inventory_builder.py.
High group_vars/infrastructure.yml L45-53 hostvars.get(groups.get('x', []) | first | default(''), {}).get('ansible_host', '127.0.0.1') is not shown to be safe. hostvars is an Ansible HostVars mapping, not a dict. It has no get override, so Mapping.get falls through to __getitem__. For an unknown host, __getitem__ returns an undefined object instead of raising KeyError, so the {} default is not applied. The chained .get('ansible_host', ...) call on that undefined object then raises. If so, the expression still fails in exactly the missing-group case it was written for. This is from reading Ansible's design, not a run. The repo has no precedent: the only hostvars.get( on main is in a test helper. The established pattern is groups.get('vnc_nodes', []) membership (all.yml ~L498-501). Use the all.yml pattern. Example: {{ (hostvars[groups['x'][0]]['ansible_host'] | default('127.0.0.1')) if groups.get('x') else '127.0.0.1' }}. This must not touch hostvars[...] unless the group is non-empty.
Low twice-defined The backend port is stated three times: infrastructure.ports.backend (literal 8001), production.yml backend_port: 8001, and the dynamic-inventory script (AUTOBOT_BACKEND_PORT, default 8001). None derives from another. Settle on one source when fixing the High row; do not add a fourth.
Info rescue Braces are neutralised (replace('{','('), replace('}',')')) before the text is truncated and embedded, so the later debug and the Play 3 summary no longer re-template Jinja from the error text. Every variable has a default, is mapping guards sit before .values() and .keys(), and the key check uses map('string'). I see no path inside the rescue that can fail. none
Info scope and threads 0 unresolved review threads. A path search for other open PRs touching infrastructure.yml found only this one, but that search is crude. I did not run the ansible-parity or hardcoded-values guards, so I cannot say whether the 127.0.0.1 literals leave their baseline unchanged. CI to confirm.

backend_port by inventory:

Inventory Defined? Value source
Registry-built inventory (the updater's default) No not set in _ALL_VARS
slm-nodes.yml (the updater's fallback) No not set
production.yml Yes literal 8001
generate_inventory.py output Yes AUTOBOT_BACKEND_PORT, default 8001

Unproven until a host update runs:

  • whether the proposal call actually fires
  • whether HostVars handles the new expressions
  • whether ansible_failed_result.msg survives no_log
  • whether the 31 other consumers of infrastructure.* are unchanged on a host with a missing group
  • tests: the pins for the URL source and the guarded groups (and the claim that the new tests contain no ast.parse) were not read this round; I read only the diff and the playbook sources.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Round update for the review at 2efc171, now at c4c8522:

  • High (port): the updater's generated inventory defines no backend_port, so that variable was replaced by the one the backend's own unit and env are rendered from in this play (playbooks/vars/backend-env.yml). Its include now runs before the proposal include, and the health probe uses it too (hardcode removed, with its stale baseline entry). Other statements of the port: deploy: state the backend port once and derive every other statement from it #21400.
  • High (hosts): the 8 entries now use the all.yml idiom, indexing hostvars[groups[x][0]] only when groups.get(x) is non-empty.
  • Tests: the URL's variables must be defined by the vars file loaded earlier or by the registry inventory's globals (shared parse cache, no direct parse); the probe uses the same variable; each host entry is pinned to the guarded idiom. Each test claims only what it reads.
    Still unproven: no ansible run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CHANGES @ c4c8522

The root-cause fix is now sound for the update path. One tag-selection regression remains, introduced by this PR.

Severity Where Finding Required fix
Medium update-all-nodes.yml "Load shared backend env vars" (tags [backend, env]) vs "Wait for API to be ready" and the verify include (tags [backend, restart]) backend_port is now loaded only by a task tagged backend, env, but both the health probe and the verify include read it under tags backend, restart. A run selected with --tags restart, or with --skip-tags env (or a skipped backend tag combination that keeps restart), skips the include_vars and still runs the probe. The probe URL then raises an undefined-variable error. Before this PR that probe was a literal and worked. The playbook already treats env,restart as separate selections (the can_apply logic in the claim file), so this is a reachable selection. Give the include_vars task the tags of every consumer ([backend, env, restart]), or always. Add a pin that the tags of the task loading backend_port cover the tags of each task that reads it.
Info hardcoded-values baseline Only the single stale :8001 line was removed. One :8001 remains in update-all-nodes.yml, in a comment (L1486). Main had two :8001 lines against a baseline count of 1, so comments appear not to be counted. Not run, so this stays unproven until CI. CI to confirm.
Info infrastructure.yml The guarded idiom is correct. Jinja's inline if evaluates only the chosen branch, so hostvars[groups['x'][0]] is never touched when the group is missing or empty. A group that exists with a host lacking ansible_host yields an undefined attribute, and default applies; this is the same as before the PR. none
Info include_vars move Between the new position and the old one sit two tasks: the DB-password read (shell, register) and the admin-seed read include. Neither reads or sets any variable the vars file defines (backend_*, service_auth_*). The realign and resolve tasks use autobot_backend_env_file, which the file does not define. Nothing later changes value or precedence, because the file now loads earlier, not later. none
Info rest backend_port in vars/backend-env.yml L20 is a literal 8001, the same variable the unit's ExecStart and backend.env.j2 (AUTOBOT_BACKEND_PORT) render from, so the URL tracks the listening port. #21400 is a sub-issue of #21343 and lists the remaining duplicates. The tests read _ALL_VARS through the shared parse cache and pin the URL variable and the infrastructure exclusion; the URL test would fail on the previous head, where backend_port was in neither _ALL_VARS nor the loaded vars file. No tag pin exists. 0 unresolved threads. The PR body lists what is unproven. none

Unproven until a host update runs:

  • the original failure was the infrastructure templating
  • the proposal call reaches the backend
  • the guarded idiom on the controller's Ansible version
  • ansible_failed_result.msg surviving no_log
  • a rescued failure not tripping the play's any_errors_fatal
  • the hardcoded-values baseline count

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Round update (febeb38): the vars load now carries the tags of every task that reads its variables (backend, env, restart), so --tags restart or --skip-tags env no longer reaches the health probe without it; a test compares each reader's tags with the load's. The comment that stated a literal port now names the variable. Still unproven: no ansible run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CHANGES @ febeb38

The commit fixes --tags selections but not --skip-tags selections, and the playbook's own logic treats --skip-tags as a supported way to run.

Severity Where Finding Required fix
Medium update-all-nodes.yml "Load shared backend env vars" (tags: [backend, env, restart]) --skip-tags env skips every task that HAS the env tag, even one that also carries restart. The load keeps env, so it is skipped, while the health probe ("Wait for API to be ready", tags backend, restart) still runs and reads the undefined backend_port. Under that selection the regression from the previous round remains. The authors do treat skip selections as supported: the claim file's can_apply reads ansible_skip_tags for backend, env, restart and celery. A union of consumer tags cannot be right for skip selections, because the load can carry a skip tag that a consumer lacks. Tag the load always and nothing else (keep when: 'backend' in group_names). Do not combine always with env: a skip tag still matches any listed tag, so [always, env] is skipped by --skip-tags env. Only --skip-tags always would skip an always-only task.
Low test_the_backend_vars_load_runs_for_every_tag_selection_that_reads_it The subset check is correct for --tags: the union covers --tags env, --tags restart and --tags backend. It does not model --skip-tags at all, so it passes in the skip case above. It also treats always as covering everything, even if always is combined with another tag. Make the test require the load to be tagged exactly always, or model skip selections (no tag of the load may be a tag a consumer lacks).
Info rest of the commit It is the only commit since c4c8522. Under --tags restart and --tags backend the load runs. The consumers I enumerated in Play 2 are the proposal include (backend, env), the health probe (backend, restart) and the verify include (backend, restart); the second include site near L1508 is tagged backend, restart, which the union covers. The two comments that stated the literal port now name the variable. No 8001 remains in update-all-nodes.yml (grep returns nothing). The baseline needs no further line: its only remaining entry was already removed last round. 0 unresolved threads. none

Selection table:

Selection Load runs? Probe runs? Result
none / --tags backend yes yes ok
--tags restart yes yes ok
--tags env yes no ok
--skip-tags env no yes probe reads undefined backend_port
--skip-tags restart yes no ok
always-only tagging (proposed) yes in every selection except --skip-tags always as before ok

Unproven until a host update runs:

  • the original failure was the infrastructure templating
  • the proposal call reaches the backend
  • the guarded idiom on the controller's Ansible version
  • ansible_failed_result.msg surviving no_log
  • a rescued failure not tripping any_errors_fatal
  • the hardcoded-values guard result
  • tag behaviour on real --tags and --skip-tags runs

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Round update (fdefeda): the backend vars load is tagged exactly always (a skip tag matches any tag on a task, so [always, env] could be skipped while a restart reader still ran); its 'backend' in group_names condition is unchanged. The test pins exact tags, the condition, and that it precedes its first reader. Still unproven: no ansible run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE @ fdefeda

No findings.

  • Only commit since febeb38 is fdefeda, touching the playbook and the test.
  • The vars load now reads tags: [always] with when: "'backend' in group_names" unchanged. The test asserts both, plus a non-empty reader list and that the load precedes the first reader. The tag-selection table now holds for every row except --skip-tags always, which skips the load by design.
  • The PR body has all four required headings (Thinking Path, What Changed, Verification, Model Used), Refs #21343 and Refs #20750 (not Closes), states the root cause as unproven, and contains nothing internal.
  • 0 unresolved threads.

Unproven until an update runs on a host:

  • The original failure was the infrastructure templating. This is read from source, not reproduced.
  • A no_log task's failed result keeps msg for the rescue line.
  • A rescued failure avoids the play's any_errors_fatal.
  • The guarded group idiom behaves as intended on the host's Ansible version.
  • The main backend, Celery and workers restart; the user frontend is synced and rebuilt; the summary shows a pending approval id or the reported failure shape.
  • Tag behaviour on real --tags and --skip-tags runs.
  • The hardcoded-values guard result in CI.

mrveiss added a commit that referenced this pull request Nov 12, 2026
@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Pre-board guard lane failure (guards shard 2/6) was a stale assertion in the test, not a playbook defect: the rescue now binds the failed result to a variable with a default, so the literal spelling the test searched for is gone. The test now pins the behaviour: the rescue binds from the failed result with a default, reads the HTTP status from that binding with a default, reports the field names, and never interpolates the raw result (bare or via to_json); an in-test control confirms each of those 'print it all' spellings is still caught. All other tests in the file were read against the current playbook, claim file and vars files and match. Pushed as 0e6babe; no playbook change.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE @ 0e6babe

Conditional on the pre-board guard-lane run on this head ending green or green_with_skips. At the time of writing that run (headSha 0e6babe) was still queued.

The only non-merge commit since fdefeda is 0e6babe, and it touches only the test file. At fdefeda the lane's one failure was test_the_rescue_reports_status_and_field_names_not_the_whole_result; the other tests in that file passed in the same shard (1 failed, 2932 passed).

Findings:

Severity Where Finding Fix
Low _embeds_the_whole_result It catches {{ x }} and ` to_json / to_nice_json / string / to_yaml / to_nice_yamlonansible_failed_resultand every name bound from it with a default. It does not catchtojson, pprint, or printing a sub-field that can carry request data (e.g. _r.invocation`).
Info vacuity Not vacuous. names always includes ansible_failed_result, so a bare print is caught even when no binding matches, and the test asserts that a binding exists. The control test uses four bad spellings and one good one, and each is classified correctly by the regexes. A rescue that printed the whole result would fail the test. none

Walk of every assertion against the files at the branch tip, done by loading the YAML and checking each condition:

# Test Asserts Satisfied
1 proposal inside block with rescue one block; rescue exists; the propose task is inside it and not top-level yes
2 nothing in rescue can fail again failed_when not true; defaults on ansible_failed_result, internal_api_key_by_file, internal_api_key_canonical, _r.msg, _r.status; is mapping; map('string') yes
3 braces neutralised replace('{','(') and replace('}',')') present yes
4 status and field names, not whole result one bound name (_r); _r.status | default(; _r.keys(); report variable; no whole-result print yes
5 whole-result control four bad spellings detected, one good not yes
6 withholds error text with a key rescue setter has no_log and select('in', _msg) yes
7 key-carrying tasks are no_log propose and claim tasks both no_log: true yes
8 summary prints the report the "Display update summary" task contains internal_key_realign_lines yes (exactly one such task)
9 restarts inline after the proposal include Restart service task exists once, comes after the include; no notify in Play 2 yes
10 URL does not use infrastructure exactly 2 include sites; neither URL mentions it yes
11 URL variables are defined load precedes the include; URL variable backend_port is in the vars file; _ALL_VARS keys read via the parse cache yes
12 health probe uses the same variable uri.url contains {{ backend_port }} yes
13 guarded idiom all templated host entries match the pattern (reserved_2 is a plain literal and is skipped) yes
14 vars load tagged always and first tags exactly ["always"]; when as stated; first reader is task 23, after the load at 22 yes

Unproven until an update runs on a host:

  • The original failure was the infrastructure templating.
  • A no_log task's failed result keeps msg for the rescue line.
  • A rescued failure avoids the play's any_errors_fatal.
  • The guarded idiom behaves as intended on the host's Ansible version.
  • The restarts, the user-frontend rebuild, and a pending approval or the reported failure shape in the summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: deploy-lifecycle Wave 1 · cluster O — Deploy, provision & lifecycle backend bug Something isn't working deployment infrastructure phase:M1.4 Wizard and SLM: choose a mode, apply it, default models work priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant