Add the buildarr test-config
command
#60
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the
buildarr test-config
command for testing configuration files.The main differentiation from
buildarr run --dry-run
is that this checks the configuration as thoroughly as possible without communicating with remote instances (except when checking TRaSH-Guides metadata, in which case the latest metadata is downloaded from GitHub).This allows local running outside of the *Arr stack network, ensuring a file is at least very likely to successfully load within Buildarr before deploying it.
This PR performs a refactor of the CLI command code to allow
buildarr run
andbuildarr test-config
to share as much code as possible, and changes a number of functions to operate on global state instead of using local variables, allowing multiple places to use the most up-to-date instance configurations (with TRaSH-Guides metadata rendered).Information and debug logging has also been refactored and improved, moving all info logging out of functions (since those are likely to differ between types of commands), and adding additional debug logging output to make it easier to see the actual state Buildarr was in before an error occurs.
Related changes: