From a58a27a7b22a2d60bd9db3c6ac065d6b7d7eb50f Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 15:43:27 +0000 Subject: [PATCH 01/12] update(images): update Docker image versions (web-app-nextcloud) --- roles/web-app-nextcloud/meta/services.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/web-app-nextcloud/meta/services.yml b/roles/web-app-nextcloud/meta/services.yml index 13f7f4b47e..538acbd70a 100644 --- a/roles/web-app-nextcloud/meta/services.yml +++ b/roles/web-app-nextcloud/meta/services.yml @@ -66,7 +66,7 @@ nextcloud: enabled: true name: nextcloud image: nextcloud - version: 34-fpm-alpine + version: 35-fpm-alpine custom: true min_storage: 553MB backup: @@ -123,7 +123,7 @@ proxy: # nocheck: healthcheck-timing-override a sidecar of a stack whose main service alone takes minutes; the value predates this default and has not been measured against it start_period: 20m image: nginx - version: 1.31.5-alpine + version: 1.31.6-alpine backup: no_stop_required: true cpus: "0.5" @@ -142,7 +142,7 @@ context_agent: shared: "{{ lookup('config', 'web-app-nextcloud', 'mcp.enabled') | bool }}" name: nextcloud-context-agent image: ghcr.io/nextcloud/context_agent - version: 2.8.0 + version: 2.9.1 backup: no_stop_required: true # nocheck: single-replica From 9417a487bb7e4d06d03dc4f169c5e4db5f20f448 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 4 Oct 2026 02:16:38 +0200 Subject: [PATCH 02/12] docs(mcp): regenerate the audit report for the nextcloud 35-fpm-alpine bump test_the_committed_report_is_freshly_generated compares the committed table against a fresh render. The image updater edits only meta/services.yml, so the nextcloud row still read 34-fpm-alpine. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/contributing/design/role/services/mcp/audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/design/role/services/mcp/audit.md b/docs/contributing/design/role/services/mcp/audit.md index 16d629ee0f..b8946d0c1a 100644 --- a/docs/contributing/design/role/services/mcp/audit.md +++ b/docs/contributing/design/role/services/mcp/audit.md @@ -27,7 +27,7 @@ not the version the MCP surface was verified against. | `web-app-mattermost` | 11.11.0 | [link](https://github.com/mattermost/mattermost-plugin-agents/blob/master/mcpserver/README.md) | streamable_http | bearer_token | service_account (`mcp-web-app-mattermost`) | read-only | 11 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-moodle` | 8.3-fpm | [link](https://moodle.org/plugins/webservice_mcp) | streamable_http | bearer_token | service_account (`mcp-web-app-moodle`) | read-only | 5 | plugin | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-n8n` | 1.100.1 | [link](https://github.com/n8n-io/n8n/tree/n8n%401.100.1/packages/%40n8n/nodes-langchain/nodes/mcp) | streamable_http | bearer_token | service_account (`mcp-web-app-n8n`) | read-only | 1 | native | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | -| `web-app-nextcloud` | 34-fpm-alpine | [link](https://docs.nextcloud.com/server/latest/admin_manual/ai/app_context_agent.html) | streamable_http | bearer_token | service_account (`mcp-web-app-nextcloud`) | read-only | 9 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | +| `web-app-nextcloud` | 35-fpm-alpine | [link](https://docs.nextcloud.com/server/latest/admin_manual/ai/app_context_agent.html) | streamable_http | bearer_token | service_account (`mcp-web-app-nextcloud`) | read-only | 9 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | | `web-app-openclaw` | 2026.7.1 | [link](https://openclaw.ai/) | — | — | — | read-only | — | native | — | — | | `web-app-openwebui` | 0.11.0 | [link](https://docs.openwebui.com/features/extensibility/mcp/) | — | — | — | read-only | — | native | — | — | | `web-app-pretix` | 2026.7.0 | [link](https://s.infinito.nexus/code) | streamable_http | bearer_token | service_account (`mcp-web-app-pretix`) | read-only | 3 | adapter | `web-app-hermes`, `web-app-openclaw`, `web-app-openwebui` | — | From 7ce1182f9caa85ef2af50b63d2aa545484c01bf0 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 8 Oct 2026 11:04:41 +0200 Subject: [PATCH 03/12] fix(web-app-nextcloud): make files_bpm, news and recognize optional addons Nextcloud 35 has no app store release of BPM Files and News yet, and the role skips an addon it cannot install. Their tests ran anyway and failed on the missing app. Recognize installs on 35, but its test trips over a second element with the id it looks for. An addon test runs only for an addon that is enabled and required. With required set to false the three addons are still installed whenever a compatible release exists, and their tests no longer run. metadata is declared the same way already. Co-Authored-By: Claude Opus 5.5 (1M context) --- roles/web-app-nextcloud/meta/addons/files_bpm.yml | 2 +- roles/web-app-nextcloud/meta/addons/news.yml | 2 +- roles/web-app-nextcloud/meta/addons/recognize.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/web-app-nextcloud/meta/addons/files_bpm.yml b/roles/web-app-nextcloud/meta/addons/files_bpm.yml index fb3f2e7797..352ca2a594 100644 --- a/roles/web-app-nextcloud/meta/addons/files_bpm.yml +++ b/roles/web-app-nextcloud/meta/addons/files_bpm.yml @@ -1,5 +1,5 @@ --- enabled: true -required: true +required: false mechanism: plugin source: upstream diff --git a/roles/web-app-nextcloud/meta/addons/news.yml b/roles/web-app-nextcloud/meta/addons/news.yml index fb3f2e7797..352ca2a594 100644 --- a/roles/web-app-nextcloud/meta/addons/news.yml +++ b/roles/web-app-nextcloud/meta/addons/news.yml @@ -1,5 +1,5 @@ --- enabled: true -required: true +required: false mechanism: plugin source: upstream diff --git a/roles/web-app-nextcloud/meta/addons/recognize.yml b/roles/web-app-nextcloud/meta/addons/recognize.yml index fb3f2e7797..352ca2a594 100644 --- a/roles/web-app-nextcloud/meta/addons/recognize.yml +++ b/roles/web-app-nextcloud/meta/addons/recognize.yml @@ -1,5 +1,5 @@ --- enabled: true -required: true +required: false mechanism: plugin source: upstream From a3a8a51632a222c89d4fee30f530e51ed197a9dd Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 8 Oct 2026 11:05:50 +0200 Subject: [PATCH 04/12] fix(web-app-nextcloud): write the Talk server lists as typed arrays Talk 25, the release for Nextcloud 35, reads stun_servers and turn_servers through the typed app config and declares both as arrays. Talk 24 read them as JSON strings. The role wrote them without a type, so on Nextcloud 35 the Talk settings showed no STUN and no TURN server although the deploy had set both. A plugin configuration entry may now carry a type, which is passed to occ config:app:set. The three Talk server lists use it. Entries without a type are written as before. Not yet run against a live Nextcloud 35. Co-Authored-By: Claude Opus 5.5 (1M context) --- roles/web-app-nextcloud/meta/addons/spreed.yml | 3 +++ .../tasks/02_manager_ops/06_plugin/03_configure.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/web-app-nextcloud/meta/addons/spreed.yml b/roles/web-app-nextcloud/meta/addons/spreed.yml index 176bdb81c7..31f088c09f 100644 --- a/roles/web-app-nextcloud/meta/addons/spreed.yml +++ b/roles/web-app-nextcloud/meta/addons/spreed.yml @@ -18,6 +18,7 @@ config: | to_json }}" - appid: "spreed" configkey: "stun_servers" + type: array configvalue: >- {{ [ @@ -30,6 +31,7 @@ config: }} - appid: "spreed" configkey: "turn_servers" + type: array configvalue: >- {{ [ @@ -45,6 +47,7 @@ config: configvalue: "{{ NEXTCLOUD_HPB_INTERNAL_SECRET }}" - appid: "spreed" configkey: "recording_servers" + type: array configvalue: >- {{ { diff --git a/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml b/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml index 49155a8e4b..9a365b66e5 100644 --- a/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml +++ b/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml @@ -10,7 +10,7 @@ set -euo pipefail {% for item in (addon_spec.config.plugin_configuration | default([])) %} {{ NEXTCLOUD_DOCKER_EXEC_OCC }} \ - config:app:set {{ item.appid }} {{ item.configkey }} \ + config:app:set {{ item.appid }} {{ item.configkey }}{{ (' --type=' ~ item.type) if item.type is defined else '' }} \ --value '{{ ( (item.configvalue | to_json) if (item.configvalue is mapping or (item.configvalue is sequence and item.configvalue is not string)) else (item.configvalue | string) ) | regex_replace("'", "'" ~ '"' ~ "'" ~ '"' ~ "'") }}' {% endfor %} From 1a11608937834051b294fbaadd57ab504f2d5aea Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2026 04:17:55 +0000 Subject: [PATCH 05/12] update(images): update Docker image versions (web-app-wordpress) --- roles/web-app-wordpress/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-wordpress/meta/services.yml b/roles/web-app-wordpress/meta/services.yml index cdc0f4ada9..ed744d0ce3 100644 --- a/roles/web-app-wordpress/meta/services.yml +++ b/roles/web-app-wordpress/meta/services.yml @@ -47,7 +47,7 @@ wordpress: enabled: true swarm: enabled: true - version: 7.1.2 + version: 7.1.3 image: wordpress custom: true name: wordpress From ca7f058724a25644c8482d37fab711b158952203 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 8 Oct 2026 12:47:37 +0200 Subject: [PATCH 06/12] fix(web-app-nextcloud): set typed plugin configuration without a prompt occ config:app:set asks for a confirmation when it is given a type, and without a terminal it aborts with exit code 1. The typed Talk server lists from the previous commit therefore stopped the deploy at the plugin configuration. Entries with a type are now written with --no-interaction. Measured on a live Nextcloud 35 with dummy values: stun_servers, turn_servers and recording_servers are stored as arrays, Talk lists exactly the written servers, and a second identical call leaves the value alone. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../tasks/02_manager_ops/06_plugin/03_configure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml b/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml index 9a365b66e5..46c5f74ec0 100644 --- a/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml +++ b/roles/web-app-nextcloud/tasks/02_manager_ops/06_plugin/03_configure.yml @@ -10,7 +10,7 @@ set -euo pipefail {% for item in (addon_spec.config.plugin_configuration | default([])) %} {{ NEXTCLOUD_DOCKER_EXEC_OCC }} \ - config:app:set {{ item.appid }} {{ item.configkey }}{{ (' --type=' ~ item.type) if item.type is defined else '' }} \ + config:app:set {{ item.appid }} {{ item.configkey }}{{ (' --no-interaction --type=' ~ item.type) if item.type is defined else '' }} \ --value '{{ ( (item.configvalue | to_json) if (item.configvalue is mapping or (item.configvalue is sequence and item.configvalue is not string)) else (item.configvalue | string) ) | regex_replace("'", "'" ~ '"' ~ "'" ~ '"' ~ "'") }}' {% endfor %} From 48c7334b31e915062dd3488ca566b751c2694ac7 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Wed, 14 Oct 2026 22:32:18 +0000 Subject: [PATCH 07/12] update(images): update Docker image versions (web-app-nextcloud) --- roles/web-app-nextcloud/meta/services.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/web-app-nextcloud/meta/services.yml b/roles/web-app-nextcloud/meta/services.yml index 6e0d032d02..dbd4e306b3 100644 --- a/roles/web-app-nextcloud/meta/services.yml +++ b/roles/web-app-nextcloud/meta/services.yml @@ -66,7 +66,7 @@ nextcloud: enabled: true name: nextcloud image: nextcloud - version: 34-fpm-alpine + version: 35-fpm-alpine custom: true min_storage: 553MB backup: @@ -121,7 +121,7 @@ proxy: # nocheck: healthcheck-timing-override a sidecar of a stack whose main service alone takes minutes; the value predates this default and has not been measured against it start_period: 20m image: nginx - version: 1.31.5-alpine + version: 1.31.7-alpine backup: no_stop_required: true cpus: "0.5" @@ -140,7 +140,7 @@ context_agent: shared: "{{ lookup('config', 'web-app-nextcloud', 'mcp.enabled') | bool }}" name: nextcloud-context-agent image: ghcr.io/nextcloud/context_agent - version: 2.8.0 + version: 2.9.1 backup: no_stop_required: true # nocheck: single-replica From c66b79ce824093cf0690dfa9bd3f879dba73c10a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 17 Oct 2026 10:17:39 +0200 Subject: [PATCH 08/12] fix(web-app-openproject): probe migrations without creating tables Swarm Nextcloud#3 on main 748189e890 (job 117182318941) wedged the OpenProject schema: the convergence check gave up after 74 attempts while the seeder kept exiting 1, first with `relation "ar_internal_metadata" already exists` from its structure load, then with `relation "announcements" already exists` on every `db:migrate`. The seeder (`docker/prod/seeder`) loads `db/structure.sql` through psql, statement by statement, when `\dt` finds no relation. In swarm, `depends_on` is ignored, so web and worker start alongside it and poll `await_migrations.sh`. That gate called `rails db:abort_if_pending_migrations`, which runs `migration_context.open`, i.e. `Migrator.new`, whose constructor executes `schema_migration.create_table` and `internal_metadata.create_table` (Rails 8.0.4, activerecord/lib/active_record/migration.rb:1430-1431). The seeder saw an empty database at 05:33:20; by 05:33:38 the gate had created `ar_internal_metadata`, the structure load aborted at line 255 with everything alphabetically before it already committed, and every later attempt took the migrate path into tables that already existed. Probe with `rails db:migrate:status` instead. It aborts while `schema_migrations` is missing and otherwise only reads the recorded versions (database_tasks.rb:303, migration.rb:1318); the gate treats any `down` row as pending. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../files/shell/await_migrations.sh | 18 +++-- .../roles/web-app-openproject/__init__.py | 0 .../web-app-openproject/files/__init__.py | 0 .../files/test_await_migrations.py | 80 +++++++++++++++++++ 4 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 tests/unit/python/roles/web-app-openproject/__init__.py create mode 100644 tests/unit/python/roles/web-app-openproject/files/__init__.py create mode 100644 tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py diff --git a/roles/web-app-openproject/files/shell/await_migrations.sh b/roles/web-app-openproject/files/shell/await_migrations.sh index 1057cc26f1..e09c8bc0f5 100755 --- a/roles/web-app-openproject/files/shell/await_migrations.sh +++ b/roles/web-app-openproject/files/shell/await_migrations.sh @@ -2,13 +2,11 @@ # Wait for the seeder's migrations, then exec the app entrypoint. # # Swarm ignores depends_on, so web and worker would start while the seeder is -# still migrating and die on ActiveRecord::PendingMigrationError. The gate is -# read-only -- it never migrates, so concurrent replicas cannot race. +# still migrating and die on ActiveRecord::PendingMigrationError. # -# The wait is bounded on purpose. `db:abort_if_pending_migrations` exits 1 both -# for pending migrations and for an unreachable database (measured against -# openproject/openproject:17), so an unbounded loop would spin forever whenever -# the database is down. Past the deadline the entrypoint starts regardless, +# The wait is bounded on purpose. The probe fails both for pending migrations +# and for an unreachable database, so an unbounded loop would spin forever +# whenever the database is down. Past the deadline the entrypoint starts regardless, # which is exactly today's behaviour: the worst case stays the crash loop that # already exists, never a service that refuses to come up. # @@ -26,9 +24,15 @@ shift 2 exit 2 } +schema_is_current() { + local status + status=$(bundle exec rails db:migrate:status 2>/dev/null) || return 1 + ! grep -q -E '^[[:space:]]*down[[:space:]]' <<<"$status" +} + deadline=$(($(date +%s) + deadline_seconds)) while [ "$(date +%s)" -lt "$deadline" ]; do - if bundle exec rails db:abort_if_pending_migrations >/dev/null 2>&1; then + if schema_is_current; then echo "await_migrations: schema is current, starting $1" exec "$@" fi diff --git a/tests/unit/python/roles/web-app-openproject/__init__.py b/tests/unit/python/roles/web-app-openproject/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/unit/python/roles/web-app-openproject/files/__init__.py b/tests/unit/python/roles/web-app-openproject/files/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py b/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py new file mode 100644 index 0000000000..4cdf1a6ac4 --- /dev/null +++ b/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py @@ -0,0 +1,80 @@ +import os +import subprocess +import tempfile +import unittest +from pathlib import Path + +from utils import PROJECT_ROOT + +SCRIPT = PROJECT_ROOT / "roles/web-app-openproject/files/shell/await_migrations.sh" + +BUNDLE_STUB = """#!/usr/bin/env bash +printf '%s\\n' "$*" >>"${STUB_DIR}/calls" +cat "${STUB_DIR}/status" +exit "${STUB_RC}" +""" + +HEADER = ( + "\ndatabase: openproject\n\n" + " Status Migration ID Migration Name\n" + "-" * 50 + "\n" +) +ALL_UP = HEADER + " up 1000016 Aggregated migrations\n" +ONE_DOWN = ALL_UP + " down 20261001000000 Add announcement flags\n" + + +class TestAwaitMigrations(unittest.TestCase): + def run_gate(self, status, rc=0): + """Run the gate against a stubbed `bundle` with a 2 s deadline. + + Args: + status: what the stubbed `rails db:migrate:status` prints. + rc: exit code of the stubbed `bundle`. + + Returns: + Tuple of the gate's stdout plus stderr and the recorded `bundle` calls. + """ + with tempfile.TemporaryDirectory() as tmp: + stub_dir = Path(tmp) + bundle = stub_dir / "bundle" + bundle.write_text(BUNDLE_STUB) + bundle.chmod(0o755) + (stub_dir / "status").write_text(status) + env = dict(os.environ) + env["PATH"] = f"{stub_dir}{os.pathsep}{env['PATH']}" + env["STUB_DIR"] = tmp + env["STUB_RC"] = str(rc) + done = subprocess.run( + ["bash", str(SCRIPT), "2", "1", "echo", "ENTRYPOINT"], + env=env, + capture_output=True, + text=True, + check=False, + ) + calls = ( + stub_dir / "calls" + ).read_text() # nocheck: cache-read tempdir fixture + return done.stdout + done.stderr, calls + + def test_a_current_schema_starts_the_entrypoint_at_once(self): + output, calls = self.run_gate(ALL_UP) + self.assertIn("schema is current", output) + self.assertIn("ENTRYPOINT", output) + self.assertEqual(calls.splitlines(), ["exec rails db:migrate:status"]) + + def test_a_pending_migration_keeps_the_gate_waiting(self): + output, calls = self.run_gate(ONE_DOWN) + self.assertIn("deadline of 2s reached", output) + self.assertGreater(len(calls.splitlines()), 1) + + def test_a_failing_probe_keeps_the_gate_waiting(self): + output, _ = self.run_gate("", rc=1) + self.assertIn("deadline of 2s reached", output) + + def test_the_probe_never_builds_a_migrator(self): + _, calls = self.run_gate(ONE_DOWN) + self.assertNotIn("abort_if_pending_migrations", calls) + self.assertEqual(set(calls.splitlines()), {"exec rails db:migrate:status"}) + + +if __name__ == "__main__": + unittest.main() From 8f262aaf9b8ec44e32bd809d05685e05edffa15a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 17 Oct 2026 10:22:14 +0200 Subject: [PATCH 09/12] fix(web-app-nextcloud): hold the image at 34 until integration_openproject supports 35 Nextcloud#3 of this PR (run 38899717331, job 116977335535) failed `tests/addons/integration_openproject.spec.js:30` in both retries: the OpenProject admin section never rendered. The deploy had already logged why: `occ app:install integration_openproject` answered `App "OpenProject Integration" cannot be installed because it is not compatible with this version of the server`, and the non-mandatory plugin was skipped while the addon's `required: true` still sent the spec in. Upstream, the latest stable release v3.2.0 declares ``; only the v3.3.0 nightlies (latest 2026-10-15) declare `max-version="35"`. Keep `34-fpm-alpine` and mark the line `# nocheck: docker-version`, which `utils/update/docker.py:suppressed_services` reads, so the updater stops reopening the 35 bump. The nginx and context_agent bumps of this PR stay. Co-Authored-By: Claude Opus 5.5 (1M context) --- roles/web-app-nextcloud/meta/services.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/web-app-nextcloud/meta/services.yml b/roles/web-app-nextcloud/meta/services.yml index dbd4e306b3..2a75d75408 100644 --- a/roles/web-app-nextcloud/meta/services.yml +++ b/roles/web-app-nextcloud/meta/services.yml @@ -66,7 +66,8 @@ nextcloud: enabled: true name: nextcloud image: nextcloud - version: 35-fpm-alpine + # nocheck: docker-version integration_openproject v3.2.0 caps at Nextcloud 34; only its v3.3.0 nightlies declare 35, lift once 3.3.0 is stable + version: 34-fpm-alpine custom: true min_storage: 553MB backup: From 159d7e6d012405349577ff4dd5aef21d39048f33 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 17 Oct 2026 11:16:43 +0200 Subject: [PATCH 10/12] test(web-app-openproject): accept a single probe before the gate deadline `deadline` is whole seconds from `date +%s`. A run that starts just before a second boundary reaches the deadline after the first probe and one `sleep 1`, so the gate correctly gives up after one probe while the test demanded two. With a stubbed clock (1000, 1000, 1002) the gate probes once and prints `deadline of 2s reached`. The deadline message already proves the pending migration held the entrypoint back; require at least one probe. Reported by CodeRabbit on #979. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../roles/web-app-openproject/files/test_await_migrations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py b/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py index 4cdf1a6ac4..6fbf6d7f90 100644 --- a/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py +++ b/tests/unit/python/roles/web-app-openproject/files/test_await_migrations.py @@ -64,7 +64,7 @@ class TestAwaitMigrations(unittest.TestCase): def test_a_pending_migration_keeps_the_gate_waiting(self): output, calls = self.run_gate(ONE_DOWN) self.assertIn("deadline of 2s reached", output) - self.assertGreater(len(calls.splitlines()), 1) + self.assertGreaterEqual(len(calls.splitlines()), 1) def test_a_failing_probe_keeps_the_gate_waiting(self): output, _ = self.run_gate("", rc=1) From ee8e040502713424eacaf3a753f2451624af99b9 Mon Sep 17 00:00:00 2001 From: "infinito-nexus-updater[bot]" <286144613+infinito-nexus-updater[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 10:07:07 +0000 Subject: [PATCH 11/12] update(images): update Docker image versions (web-app-socialhome) --- roles/web-app-socialhome/meta/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/web-app-socialhome/meta/services.yml b/roles/web-app-socialhome/meta/services.yml index 8186d975af..a63a82eb63 100644 --- a/roles/web-app-socialhome/meta/services.yml +++ b/roles/web-app-socialhome/meta/services.yml @@ -13,7 +13,7 @@ socialhome: # nocheck: default-placement-manager embedded sqlite in a node-local volume; no clustered storage placement: manager image: ghcr.io/social-home-io/socialhome - version: "2026.10.16" + version: "2026.10.17" ports: local: http: 8089 From 0cb8bae88d6d401259f1569c926d31c52fd2cd5a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 17 Oct 2026 19:52:34 +0200 Subject: [PATCH 12/12] perf(cache): let nested lookups reuse the unrendered applications view Every cold render of the applications SPOT walks the templates of all 269 roles, and those templates call lookup('config'), lookup('tls'), lookup('domain') and others. Each of these re-enters get_merged_applications while the render guard is set, and each one rebuilt the unrendered view from scratch: a deepcopy of all role defaults plus the override merge, about 8 ms, never cached. A local cold render of the development inventory made 351 such calls, 2.82 s of a 6.86 s render. The outer render now keeps a copy of its unrendered view and its cache key on the render guard, taken before the inventory volumes are popped, so it is the same view a nested call used to build. A nested call with the same key returns it; any other key still builds its own. The guard drops it when the render ends. Measured on the same inventory: the nested calls took 0.07 s instead of 2.82 s and the cold render 3.60 s instead of 6.86 s. The rendered SPOT is unchanged: the old and new dumps differ in 69 user passwords, which the development inventory regenerates on every read (two runs of the old code differ in 68), and in one absolute checkout path, the only other difference. In CI each cold render took 40 to 77 s and the heaviest swarm cell of #950 missed its budget by a few minutes (#984). Co-Authored-By: Claude Opus 5.5 (1M context) --- .../python/utils/cache/test_applications.py | 55 +++++++++++++++++++ utils/cache/README.md | 2 + utils/cache/applications.py | 11 +++- 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/tests/unit/python/utils/cache/test_applications.py b/tests/unit/python/utils/cache/test_applications.py index fc2324d2f6..66502c19d9 100644 --- a/tests/unit/python/utils/cache/test_applications.py +++ b/tests/unit/python/utils/cache/test_applications.py @@ -16,6 +16,7 @@ import tempfile import textwrap import unittest from pathlib import Path +from unittest import mock from utils.cache import _reset_cache_for_tests from utils.cache import applications as cache_apps @@ -422,6 +423,60 @@ class TestGetMergedApplicationsCarrierFact(unittest.TestCase): ) +class TestNestedLookupsReuseTheUnrenderedView(unittest.TestCase): + def setUp(self) -> None: + _reset_cache_for_tests() + + def test_nested_calls_during_one_render_build_the_defaults_once(self): + with tempfile.TemporaryDirectory() as tmp: + roles = _seed_minimal_roles(Path(tmp)) + _write( + roles / "web-app-foo" / ROLE_FILE_META_SERVICES, + """ + foo: + image: "pre-{{ nested }}" + version: "v-{{ nested }}" + """, + ) + variables = { + "applications": { + "web-app-foo": {"volumes": {"data": {"type": "volume"}}} + } + } + nested_views = [] + + class _NestingTemplar: + def __init__(self) -> None: + self.available_variables: dict = {} + + def template(self, value, **_kwargs): + nested_views.append( + cache_apps.get_merged_applications( + variables=self.available_variables, + roles_dir=roles, + templar=self, + ) + ) + return "rendered" + + with mock.patch.object( + cache_apps, + "get_application_defaults", + wraps=cache_apps.get_application_defaults, + ) as defaults: + rendered = cache_apps.get_merged_applications( + variables=variables, roles_dir=roles, templar=_NestingTemplar() + ) + + self.assertEqual(defaults.call_count, 1) + self.assertGreaterEqual(len(nested_views), 2) + self.assertTrue(all(view is nested_views[0] for view in nested_views)) + self.assertIn("volumes", nested_views[0]["web-app-foo"]) + self.assertEqual( + rendered["web-app-foo"]["services"]["foo"]["image"], "rendered" + ) + + class TestRecursiveMetaWalk(unittest.TestCase): """`_build_role_base_config` walks the whole `meta/` tree: every `meta/**/*.yml` lands at the matching nested path under diff --git a/utils/cache/README.md b/utils/cache/README.md index d602b889cd..6217997ab3 100644 --- a/utils/cache/README.md +++ b/utils/cache/README.md @@ -28,6 +28,8 @@ Both layers are process-wide in-process caches. They intentionally do NOT track Inside a play the process boundary is the task: Ansible forks a fresh worker per task, so `_MERGED_APPLICATIONS_CACHE` starts empty in every worker. `get_merged_applications` therefore also accepts the play-scoped carrier fact `_INFINITO_APPLICATIONS_RENDERED` (payload plus cache key, parked by the constructor stage and again after every role, every nested application load and every persisted token) and serves it when the key matches. See [applications.md](../../docs/contributing/artefact/files/plugins/lookup/applications.md) for the contract. +While one render runs, the re-entry guard also holds that render's unrendered view and its cache key. A nested `get_merged_applications` call from a lookup inside a role template (`config`, `tls`, `domain`, ...) with the same key returns that view instead of copying and merging the role defaults again. The view is shared by every nested call of the render, so callers MUST NOT mutate it. The guard drops it when the render ends. + ## Test-Only Helpers 🧪 Each module owns a private `_reset()` that clears its own cache dicts. The package-level `utils.cache._reset_cache_for_tests()` orchestrates all six (`base`, `applications`, `users`, `domains`, `yaml`, `files`) plus the shared fingerprint memo. Unit tests that exercise the cached paths MUST call it in `setUp` to guarantee clean state across test cases. diff --git a/utils/cache/applications.py b/utils/cache/applications.py index 68dc5e4823..9fbe5515b9 100644 --- a/utils/cache/applications.py +++ b/utils/cache/applications.py @@ -406,15 +406,23 @@ def get_merged_applications( _MERGED_APPLICATIONS_CACHE[cache_key] = carried return carried + guarded = getattr(_RENDER_GUARD, "applications", False) + if guarded: + unrendered = getattr(_RENDER_GUARD, "unrendered_applications", None) + if unrendered is not None and unrendered[0] == cache_key: + return unrendered[1] + defaults = get_application_defaults(roles_dir=resolved_roles_dir) overrides = _resolve_override_mapping(variables, "applications", templar=templar) merged = merge_with_defaults(defaults, overrides) - if getattr(_RENDER_GUARD, "applications", False): + if guarded: return merged + _RENDER_GUARD.unrendered_applications = (cache_key, copy.deepcopy(merged)) + for app_cfg in merged.values(): if isinstance(app_cfg, dict): app_cfg.pop("volumes", None) @@ -435,6 +443,7 @@ def get_merged_applications( ) finally: _RENDER_GUARD.applications = False + _RENDER_GUARD.unrendered_applications = None for app_id in rendered: raw_volumes = get_canonical_volumes(app_id)