Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the buildarr test-config command #60

Merged
merged 7 commits into from
Mar 18, 2023
Merged

Conversation

Callum027
Copy link
Member

@Callum027 Callum027 commented Mar 18, 2023

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 and buildarr 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:

  • Change the absolute path resolving function to not follow symbolic links (since targets can change between Buildarr runs in daemon mode)
  • Remove temporary directories after TRaSH-Guides metadata rendering has completed

@Callum027 Callum027 added enhancement New feature or request refactor Code refactoring-related issue or pull request cli Issue or pull request related to the Buildarr CLI config Issue or pull request related to Buildarr or plugin configuration labels Mar 18, 2023
@Callum027 Callum027 added this to the v0.4.0 milestone Mar 18, 2023
@Callum027 Callum027 self-assigned this Mar 18, 2023
@Callum027 Callum027 linked an issue Mar 18, 2023 that may be closed by this pull request
@Callum027 Callum027 changed the title Add the buildar test-config command Add the buildarr test-config command Mar 18, 2023
@Callum027 Callum027 merged commit 0f7a5e4 into main Mar 18, 2023
@Callum027 Callum027 deleted the 55-test-config-command branch March 18, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issue or pull request related to the Buildarr CLI config Issue or pull request related to Buildarr or plugin configuration enhancement New feature or request refactor Code refactoring-related issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a test-config command for testing configuration validity
1 participant