Confusing configuration sources might lead to (more) development errors #1242
Labels
A-architecture
Area: Related to `rustic`s architecture
A-config
Area: Related to the config file functionality and format
C-refactor
Category: Refactoring of already existing code
Context and description
rustic
has three complementary ways of being prompted a configuration.the current design of rustic makes it that the implementation of command (such as
forget
orwebdav
) has access to two different configurations:RUSTIC_APP.config()
where all the sources were merged&self
reference to the CLI (clap parsed) instance that only has the CLIExample
issue: #1163
fix PR: #1241
code before the fix (https://github.com/rustic-rs/rustic/blob/abf1835cbdf5804806a1106cfb88b4cd3b20e0d9/src/commands/webdav.rs#L68C1-L104C1):
To correct this, the #1241 PR came with changes similar to:
More complex problem
The
forget
command has CLI-only options that are only accessible from itsinner_run
&self
reference.But the same issue exists with this command, the other options are merged from the TOML and the ENV.
See
rustic/src/commands/forget.rs
Lines 100 to 111 in abf1835
Why an issue, if this is fixed
This bug is purely a developers' problem. By the current design, the type system is not able to verify that we don't use
self
when we shouldn't. And sometimes we should (forget
command for instance).For this reason, we need to reflect on design updates and refactors that would solve this issue.
The design reflection will include (but not only) the role of the
abscissa
framework, our usage of it, and how it fits to our needs.This issue will track the related design change.
Do not hesitate if you have any prompt, question, advice and all.
The text was updated successfully, but these errors were encountered: