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

Add setting versionPolicyModuleVersionExtractor #140

Conversation

jgogstad
Copy link
Contributor

Add setting that lets users inject parsing logic for module revision to version numbers. This will work as an escape hatch for situations where dependencies have non-standard version schemes. See linked issue for discussion.

This PR is reviewable on its own, so not making any attempts to fix the dynver custom separator issue now. Reviewers should have in mind whether this new setting could be a good fit for that issue too though. I don't think it makes sense to consider this setting for versionPolicyPreviousArtifacts or versionPolicyIgnored, but please give feedback on this as well.

fixes #139

Copy link
Collaborator

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Thank you @jgogstad for opening the PR!

The changes look good to me. I have one comment about the choice of using a total function vs a partial function.

Also, could you please add documentation (in the README) about the new key, and its specification?

Copy link
Collaborator

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Thank you @jgogstad for addressing my comments. After thinking more about it I found some issues with the current implementation, please read my new comments below.

@jgogstad
Copy link
Contributor Author

I was bit unsure where you want the default value for versionPolicyModuleVersionExtractor to be bound, please see previous commit.

Thanks for the thorough review and sorry about forgetting to update the test case

Copy link
Collaborator

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Thank you @jgogstad, this looks great to me!

@julienrf
Copy link
Collaborator

Just a couple of things before we merge the PR. Could you please:

  • Add a section about this setting in the README? (at the end, before the acknowledgements section)
  • Squash all the commits into a single one?

… version number schemes

This setting allow users to control how version numbers are parsed before they are checked for compatibility
@jgogstad jgogstad force-pushed the add-module-to-version-custom-extractor-setting branch from 37b5e6f to 16000ab Compare October 18, 2022 08:27
@jgogstad
Copy link
Contributor Author

Thanks, done. I kept the original description for the settingKey, it defaults to _.revision through applyOrElse now, not by a default binding. I think it's more informative to keep it as-is.

@julienrf julienrf merged commit 8fb1d3b into scalacenter:main Oct 18, 2022
@julienrf
Copy link
Collaborator

Thank you!

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

Successfully merging this pull request may close these issues.

feedback wanted: establish a way to let clients explain how to parse version numbers
2 participants