mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-10 04:36:40 +00:00
Merge branch 'feature/designer' into feature/store-i18n
Two conflicts, both resolved by combining rather than by picking a side. `roles/web-app-socialhome/tasks/02_design.yml`: designer restructured the pass, moving the token request and the theme write into the new `02_design/converge.yml` and adding a stat of the name-state file. HEAD still carried the converge block inline. Kept designer's stat, dropped HEAD's inline block: the merged body below the conflict already includes `converge.yml` and reads `socialhome_name_marker`, which only designer defines, so keeping HEAD's side would have duplicated the token request and left that variable undefined. HEAD's `retries: 0` on the token request is deliberately not carried over; the default of 30 retries covers a service that is not yet accepting connections, which matters more here than failing fast on bad credentials. `roles/web-app-fider/files/playwright/test-design.js`: the import line takes both sides, since the merged body uses designer's `apiGetOnion` and HEAD's `requireDotenvValue`. The env block keeps HEAD's `requireDotenvValue` form, because designer's `|| ""` defaults are what `tests/lint/ansible/.../test_unguarded_env_default.py` exists to reject, and drops HEAD's module-scope `title` and `logoEnabled`: the merged body defines `title` locally and reads `DESIGN_LOGO_ENABLED` directly, so both were dead and would fail `no-unused-vars`. Checked after resolution: no conflict markers (`git diff --check`), no `nocheck` line dropped by the merge, and no duplicated YAML key in the seven merged files. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
bf5aa1abd8
26 files changed
+535
-165
No files matched your search
@@ -12,21 +12,30 @@ class _FakeTask:
|
||||
self.args = {} if args is None else dict(args)
|
||||
|
||||
|
||||
class _FakeTemplar:
|
||||
def __init__(self, available_variables=None):
|
||||
self.available_variables = available_variables
|
||||
|
||||
|
||||
class _FakeLookup:
|
||||
def __init__(self, carrier):
|
||||
def __init__(self, carrier, templar=None):
|
||||
self.carrier = carrier
|
||||
self.templar = templar
|
||||
self.calls = []
|
||||
self.templar_variables = []
|
||||
|
||||
def run(self, terms, variables=None, **kwargs):
|
||||
self.calls.append((terms, variables, kwargs))
|
||||
if self.templar is not None:
|
||||
self.templar_variables.append(dict(self.templar.available_variables))
|
||||
return [self.carrier]
|
||||
|
||||
|
||||
def _make_action(task: _FakeTask) -> ActionModule:
|
||||
def _make_action(task: _FakeTask, templar=None) -> ActionModule:
|
||||
action = object.__new__(ActionModule)
|
||||
action._task = task
|
||||
action._loader = None
|
||||
action._templar = None
|
||||
action._templar = _FakeTemplar() if templar is None else templar
|
||||
return action
|
||||
|
||||
|
||||
@@ -56,6 +65,31 @@ class TestApplicationsCarrierActionPlugin(unittest.TestCase):
|
||||
self.assertEqual(variables, {"applications": {}})
|
||||
self.assertTrue(kwargs["carrier"])
|
||||
|
||||
def test_renders_without_the_callers_application_id(self):
|
||||
task_vars = {"applications": {}, "application_id": "web-app-bluesky"}
|
||||
templar = _FakeTemplar(task_vars)
|
||||
lookup = _FakeLookup({"key": ["roles", []], "applications": {}}, templar)
|
||||
action = _make_action(_FakeTask(), templar)
|
||||
with (
|
||||
patch(
|
||||
"plugins.action.applications_carrier.ActionBase.run",
|
||||
autospec=True,
|
||||
return_value={},
|
||||
),
|
||||
patch(
|
||||
"plugins.action.applications_carrier.lookup_loader.get",
|
||||
return_value=lookup,
|
||||
),
|
||||
patch("plugins.action.applications_carrier.revalidate_tokens_file"),
|
||||
):
|
||||
action.run(task_vars=task_vars)
|
||||
|
||||
_, variables, _ = lookup.calls[0]
|
||||
self.assertEqual(variables, {"applications": {}})
|
||||
self.assertEqual(lookup.templar_variables, [{"applications": {}}])
|
||||
self.assertIs(templar.available_variables, task_vars)
|
||||
self.assertEqual(task_vars["application_id"], "web-app-bluesky")
|
||||
|
||||
def test_revalidates_the_tokens_file_before_rendering(self):
|
||||
order = []
|
||||
lookup = _FakeLookup({"key": ["roles", []], "applications": {}})
|
||||
|
||||
Reference in new issue
Block a user