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

Evaluate local paths relative to the config file #71

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

Callum027
Copy link
Member

Reimplement configuration parsing so that intermediate configuration files are validated by Pydantic once, before being turned back into dictionaries, merged into one structure, and validated again by Pydantic to get the final configuration object.

This has some implications for how multiple configuration files are handled, and the documentation has been updated to reflect this. Realistically, however, the side effects from this are expected to be minimal.

This allows a new LocalPath attribute type to be added, which is evaluated when these intermediate configuration files are loaded, and parsed to be absolute paths relative to the directory containing the actual configuration file the attribute was loaded from.

If a LocalPath type attribute has a default value and was not defined in the configuration, the directory that contains the originally parsed configuration is used to turn it into an absolute path (instead of the current working directory for the Buildarr process.)

The following attributes have been changed to type LocalPath:

  • buildarr.secrets_file_path

@Callum027 Callum027 added enhancement New feature or request refactor Code refactoring-related issue or pull request plugins Vendored plugin or plugin API-related issue or pull request config Issue or pull request related to Buildarr or plugin configuration labels Mar 25, 2023
@Callum027 Callum027 added this to the v0.4.0 milestone Mar 25, 2023
@Callum027 Callum027 self-assigned this Mar 25, 2023
@Callum027 Callum027 merged commit 9c0487a into main Mar 25, 2023
@Callum027 Callum027 deleted the 61-local-relative-paths branch March 25, 2023 08:07
@Callum027 Callum027 added bug Something isn't working and removed enhancement New feature or request labels Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config Issue or pull request related to Buildarr or plugin configuration plugins Vendored plugin or plugin API-related issue or pull request refactor Code refactoring-related issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get absolute paths for local path attributes relative to the read config file
1 participant