-
Notifications
You must be signed in to change notification settings - Fork 0
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
Issue/79 #14
Conversation
This commit allows beer-garden to safely migrate from JSON config files to YAML config files. There is one error case, when moving the files around could cause application startup to fail. I believe this is mostly mitigated because we perform the scary operation last which should throw an error before catastrophic failure occurrs. We also guarantee that the file will be yaml. Since yaml is a superset of JSON, the yaml parser can load JSON just fine in the event that migrating/moving the YAML file does not complete successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like tests are failing on Python 2 😢
It may be good to throw a logging statement in _safe_migrate
just so there's an explanation for why their config file magically switched from json to yaml.
Yeah, I didn't realize python2 was broken. I'll fix the tests later. |
The python 2.7 tests are failing because of loganasherjones/yapconf#82 I will fix that and release tonight. |
This required an update of yapconf which was not correctly dumping unicode key value pairs.
Codecov Report
@@ Coverage Diff @@
## develop #14 +/- ##
===========================================
+ Coverage 92.34% 92.66% +0.31%
===========================================
Files 9 9
Lines 601 627 +26
===========================================
+ Hits 555 581 +26
Misses 46 46
Continue to review full report at Codecov.
|
Note
You should accept #13 first.
This commit allows beer-garden to safely migrate from JSON config
files to YAML config files. There is one error case, when moving
the files around could cause application startup to fail. I believe
this is mostly mitigated because we perform the scary operation
last which should throw an error before catastrophic failure
occurrs.
We also guarantee that the file will be yaml. Since yaml is a
superset of JSON, the yaml parser can load JSON just fine in
the event that migrating/moving the YAML file does not complete
successfully.