-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: Validate strict in
verdi config set caching.disabled_for
(#6197)
Values provided for `verdi config set caching.disabled_for` and `verdi config set caching.enabled_for` were validated, but without setting `strict=True` for the `_validate_identifier_pattern` validator. This keyword was recently added and when set to `True` would actually attempt to load the entry point or import path. Without this strict validation, a user could accidentally set an incorrect value to enable or disable caching for. Most common example is where a correct entry point was provided but without the entry point group, e.g., `core.arithmetic.add`. The validator would interpret this as an import path and not as an entry point, and since strict validation was turned off, it didn't attempt to actually import it. The `strict` validation is now turned on causing the example above to return a validation error. The downside of this approach is that it is no longer possible to disable or enable caching for an entry point or import path that cannot be loaded in the current environment. But then again, the question is what the use would be of such a use-case.
- Loading branch information
Showing
5 changed files
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters