Allow cats_config.yml and cats_config.yaml#146
Merged
andreww merged 3 commits intoGreenScheduler:mainfrom Jun 24, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
==========================================
+ Coverage 81.80% 82.72% +0.91%
==========================================
Files 14 14
Lines 687 712 +25
==========================================
+ Hits 562 589 +27
+ Misses 125 123 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
abhidg
reviewed
Jun 6, 2025
This change allows us to read configuration data from local files cats_config.yml, cats_config.yaml or config.yml. The first file found (in that order) is read and any others are ignored. I've also updated the tests to check that this works which involved fun with fixtures. Having thought about it a bit more this could probably be cleaned up with a parameterisation but I'm not sure about extracting the parameter for the test in the fixture ... something for another day.
We now log (at warning level) the fact that config.yml (and config.yaml, which is now accepted) are deprecated in favour of cats_config.yml/yaml. Add a new test to check things for for config.yaml. To do this in a sensible way, I removed the early returns from within config_from_file() which resulted in us skipping some existing logging messages. We now only return at the end of the function and logging is performed as appeared to be intended in the code. We could (I think) simplify the logic further by collapsing all the possible paths into a single loop so we just accept the first. But that's for later refactoring.
Collaborator
Author
|
@sadielbartholomew, @abhidg - thanks for the comments. I think this is now ready to review and merge. |
Member
|
Otherwise happy for a merge @andreww but I have one question as raised above. |
Contributor
|
@andreww looks good to me! |
sadielbartholomew
approved these changes
Jun 24, 2025
Member
sadielbartholomew
left a comment
There was a problem hiding this comment.
I am happy and so is Abhishek so please merge when ready.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 change allows us to read configuration data from local files cats_config.yml, cats_config.yaml or config.yml. The first file found (in that order) is read and any others are ignored.
I've also updated the tests to check that this works which involved fun with fixtures. Having thought about it a bit more this could probably be cleaned up with a parameterisation but I'm not sure about extracting the parameter for the test in the fixture ... something for another day.
Still need to update the documentation to match and as well as cleanup in the tests, I'm pretty sure that config_from_file function could be simplified.
Fixes #145