cmds.secrets.FilesContext: Fix attrs precedence and macro scanning #155
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20261024-cmds-secrets-filescontext-fix-attrs-precedence-and-macro-scanning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes two defects in the secrets template compiler: the attribute precedence the operator set in the
.jw-secretis restored, and commented-out macros no longer fail the compile:cmds.secrets.FilesContext: Re-shuffle attrs precedence
_compile_one_template_file()re-parses the template's own conf line and, when present, discards the attrs thatcompile_template_file()merged from the command-line defaults, the template, the.jw-secret-file, and the.jw-secret. The merge already orders the sources so that later non-empty fields override earlier ones; discarding it inverts the order and lets the template's line override the one the operator placed in the.jw-secret.Strip the template's conf line from the content and apply the merged attrs instead, so the
.jw-secretconf line takes the last word again, as the compiler did before the rewrite. The integration test gains a target whose template and secret both carry a conf line.cmds.secrets.FilesContext: Ignore commented-out macros
The unresolved-macro check scans the substituted content for
__MACRO__names, and a commented-out reference fails the compile like a live one. A disabled config section keeps its macros in the comments as documentation, and the matching store keys are retired along with it, so compiling the template fails on lines that no longer take effect.Skip comment lines when scanning for unresolved macros. The integration test gains a target whose template carries a commented-out macro without a store entry.