"borgmatic config validate" reports valid even when config is invalid #804

Closed
opened 2023-12-28 23:27:44 +00:00 by nfp0 Β· 5 comments

What I'm trying to do and why

Writing an invalid value on the skip_actions section is considered valid by the borgmatic config validate command.

For example, running that command on a config file with the following section:

skip_actions:
    - sdfkjfjieojf

Still reports as valid:

summary:
All configuration files are valid

And execution even runs as normal. It seems to ignore the value.

### What I'm trying to do and why Writing an invalid value on the skip_actions section is considered valid by the `borgmatic config validate` command. For example, running that command on a config file with the following section: ``` skip_actions: - sdfkjfjieojf ``` Still reports as valid: ``` summary: All configuration files are valid ``` And execution even runs as normal. It seems to ignore the value.
Owner

Thanks for filing this one as well! I think the fix here is probably to update the configuration schema to explicitly declare the allowed actions. Then borgmatic config validate will likely complain if an unsupported action is used.

Implementation note: One risk is that this hard-coded action list could drift from the actual implemented actions over time. So it might be a good idea to add an automated test to detect this case and error if it occurs.

Thanks for filing this one as well! I think the fix here is probably to update the configuration schema to explicitly declare the allowed actions. Then `borgmatic config validate` will likely complain if an unsupported action is used. Implementation note: One risk is that this hard-coded action list could drift from the actual implemented actions over time. So it might be a good idea to add an automated test to detect this case and error if it occurs.
witten added the
good first issue
label 2023-12-28 23:58:42 +00:00
Author

Sounds like a solid plan!

Sounds like a solid plan!
Owner

This has been implemented in main and will be part of the next release!

This has been implemented in main and will be part of the next release!
Author

Sweet! Thank you for the quick fix! πŸ™‚

Sweet! Thank you for the quick fix! πŸ™‚
Owner

Released in borgmatic 1.8.6!

Released in borgmatic 1.8.6!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#804
No description provided.