Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

v2.1.0 -- swapped out yaml package #39

Merged
merged 1 commit into from
May 4, 2022

Conversation

hankatlas
Copy link
Contributor

yaml-light's dependency HsSyck would compile for me because of the underlying C code not being C99 compliant. HsSyck hasn't been maintained for 8 years so instead I propose to swap out dbmigrations YAML parsing to yaml.

@jtdaugherty
Copy link
Owner

Thanks for the patch! Have you run the test suite with this patch?

CHANGELOG.md Outdated
@@ -1,3 +1,8 @@
2.1.0
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove any changes to the package version. That only gets decided at release time, when all the changes in the release need to be examined together to determine the next version.

@@ -104,8 +106,8 @@ migrationFromPath path = do
readMigrationFile = do
ymlExists <- doesFileExist (addNewMigrationExtension path)
if ymlExists
then parseYamlFile (addNewMigrationExtension path) `catch` (\(e::IOException) -> throwFS $ show e)
else parseYamlFile (addMigrationExtension path filenameExtensionTxt) `catch` (\(e::IOException) -> throwFS $ show e)
then decodeFileThrow (addNewMigrationExtension path) `catch` (\(e::IOException) -> throwFS $ show e)
Copy link
Owner

Choose a reason for hiding this comment

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

The old code caught IOException. Is that how the new Yaml parser behaves as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On invalid YAML it throws ParseException. I don't know what the old parser did on invalid YAML as I never got it to work. Assuming it threw IOException on invalid YAML and this needs to be caught and rethrown using throwFS I'm adding a catch for ParseException. As for actual IO errors, e.g. file permissions problems, the new parser seems to throw ParseException too so catching IOException is probably not needed at all.

@hankatlas hankatlas force-pushed the feature/yaml_update branch 2 times, most recently from f83bc05 to a41456c Compare May 4, 2022 01:50
@hankatlas hankatlas force-pushed the feature/yaml_update branch from a41456c to 2fa9442 Compare May 4, 2022 01:56
@hankatlas
Copy link
Contributor Author

Thanks for the patch! Have you run the test suite with this patch?

I have and I amended the wording of an error message in one test to make it pass. Thanks

@jtdaugherty
Copy link
Owner

Okay, thanks for addressing my comments! This looks good to me and the tests pass, so I'll merge it. Thanks for your work on this!

I also want to mention that it would be helpful (in the future) if you can push incremental changes to your PR rather than force-pushing. Force-pushing makes it more difficult for me to evaluate the changes as they come in, and it can lead to problems if I've pulled your branch in the mean time to do testing (which is likely).

@jtdaugherty jtdaugherty merged commit 573cd25 into jtdaugherty:master May 4, 2022
@jtdaugherty
Copy link
Owner

This patch is now released in 2.1.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants