Files
computer-playbook/roles/sys-front-inj-javascript/tasks/main.yml
T
kevinveenbirkenbachandClaude Opus 4.7 c52e4269bf chore(tooling): integrate mbake (Makefile linter/formatter) + working-tree drift sync
Makefile lint integration:
* scripts/install/lint.sh: replace the prior checkmake binary install with
  ensure_mbake (mbake is pip-installable, parses our Makefile correctly
  whereas checkmake bailed on .ONESHELL: / .SHELLFLAGS: / ifneq).
* scripts/lint/makefile.sh: new runner — `mbake format --check Makefile`
  reports formatting drift and missing .PHONY declarations.
* scripts/lint/autoformat.sh: add a two-pass `mbake format Makefile`
  (mbake's formatter is not strictly idempotent on the first pass).
* Makefile: split the multi-line `.PHONY:` block into 18 single-line
  `.PHONY:` declarations so mbake's parser can validate it; add the
  previously-missing `install-python-dev` and `build-dependency` PHONY
  targets; add `lint-makefile` aggregate-and-direct target.
* .pre-commit-config.yaml: new make-lint-makefile hook scoped to
  `^Makefile$`.
* .github/workflows/lint-makefile.yml: new CI workflow (pip-install mbake
  + make lint-makefile).
* .github/workflows/ci-orchestrator.yml: wire lint-makefile into
  lint-gate.needs.

Misc:
* .gitignore: add roles/importer_result.json (tooling artefact written by
  galaxy-importer when it runs in roles/).

Plus working-tree drift across roles/, group_vars/, inventories/, and
tasks/ that accumulated from the make-test setup phase regenerating
generated artefacts during recent test runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 00:32:44 +02:00

30 lines
1.1 KiB
YAML

---
# nocheck: run-once
- name: "Select JavaScript file path for '{{ application_id }}'"
set_fact:
javascript_file_custom: >-
{{ (application_id | abs_role_path_by_application_id ~ '/templates/javascript.js.j2')
if lookup('fileglob', application_id | abs_role_path_by_application_id ~ '/templates/javascript.js.j2')
else application_id | abs_role_path_by_application_id ~ '/files/javascript.js' }}
- name: "Load JavaScript code for '{{ application_id }}'"
set_fact:
javascript_code: >-
{{ lookup(
javascript_file_custom.endswith('.j2') | ternary('template', 'file'),
javascript_file_custom
) }}
- name: "Collapse Javascript code into one-liner for '{{ application_id }}'"
set_fact:
javascript_code_one_liner: "{{ javascript_code | to_one_liner }}"
- name: "Append Javascript CSP hash for '{{ application_id }}'"
set_fact:
webserver_csp_hashes_extra_by_app: >-
{{ webserver_csp_hashes_extra_by_app | default({})
| add_csp_hash(application_id, 'script-src-elem', javascript_code_one_liner) }}
changed_when: false
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"