Rename the CLI arg for deprecation outputs/variables (#2774)

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
This commit is contained in:
Andrei Ciobanu
2025-05-09 14:01:32 +03:00
committed by GitHub
parent 47875921a1
commit 8305bfb2ef
11 changed files with 45 additions and 20 deletions

View File

@@ -95,8 +95,12 @@ Silencing deprecation warnings could be presented in two different ways: globall
basis. This setting shouldn't be a part of a module call block since there could be multiple calls for the same module and each such
call should either produce or silence the warnings.
In this RFC I suggest to allow users to control module deprecation warnings via a CLI flag: `deprecation-warns`, which may
have the following values: `all` (default) or `local` (raise deprecation warnings only from module calls inside the local modules).
In this RFC I suggest to allow users to control module deprecation warnings via a CLI flag: `deprecation`, which may
have the following values:
* `module:all` (default) - shows all the deprecation warnings from local and remote module calls.
* `module:local` - raise deprecation warnings only from module calls inside the local modules.
* `module:none` - is silencing all the warnings regarding deprecated outputs/variables.
This could be extended later to include other options such as `none` to disable the deprecation warnings altogether.
### Technical Approach
@@ -123,7 +127,7 @@ presence.
We would need to extend module output nodes to also mark values as deprecated if the user specified so. Then, the mark should
be checked where `tofu.EvalContext` is used to evaluate expressions and blocks (i.e. `EvalContext.EvaluateBlock` and
`EvalContext.EvaluateExpr`). The deprecation mark check must take into account the value of `deprecation-warns` flag
`EvalContext.EvaluateExpr`). The deprecation mark check must take into account the value of `deprecation` flag
and also it shouldn't fire if the value is used inside the module, which marked this value as deprecated.
This approach would also allow us to reuse the implementation, if we want to mark more values as deprecated from different