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

Allow specifying config file with cli option (#170) #234

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

adamblake
Copy link
Contributor

@adamblake adamblake commented Mar 26, 2024

This adds a config option --config which accepts a file path to an alternative configuration file (e.g. chartpress.dev.yaml). The PR passes all existing tests and adds a few new assertions to test the new code.

The use-case I am supporting is alternative chartpress files for different deployment contexts. For example, I have a local development context for a JupyterHub that has a couple extra convenience services, and those need different build arguments for the Hub Docker image. The way that I manage this currently is to temporarily rewrite chartpress.yaml with the updated values before calling it, but I would instead like to just load a different configuration file.

(The ideal implementation would be something more akin to how you can layer different configs on like you can with Helm values, but that's something I don't really have time to develop.)

After checking the issue lists, I believe this would also close #170

Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks like a nice addition

chartpress.py Outdated Show resolved Hide resolved
tests/test_repo_interactions.py Outdated Show resolved Hide resolved
tests/test_repo_interactions.py Outdated Show resolved Hide resolved
- Rename remove_config_arg to _remove_config_arg to indicate private usage
- Modify _remove_config_arg to return the modified argument list
- Parameterize test_chartpress_run with alternatively named configuration files
- Remove now unused temporary_copy context manager function
@adamblake adamblake force-pushed the configurable-config branch from 7f3fa31 to 2403ec0 Compare April 20, 2024 18:35
@adamblake
Copy link
Contributor Author

@manics this is now refactored per your requests -- thanks!

Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sorry for the delay

@manics manics merged commit d0319dd into jupyterhub:main Jun 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a --file flag to use a different chartpress.yaml
3 participants