-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement dependency set feature in lein-monolith #93
Conversation
example/project.clj
Outdated
@@ -1,19 +1,22 @@ | |||
(defproject lein-monolith.example/all "MONOLITH" | |||
:description "Overarching example project." | |||
|
|||
:pedantic? :ranges |
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.
Unit tests seemed to throw a :abort and ranges have a type mismatch merging profiles
error before this. From what I could tell :ranges
should already be default here but I could just be misunderstanding the real problem here 🤔
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.
Huh... this definitely shouldn't be required.
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.
Seeing the same thing, it should be defaulting to :ranges 🤷
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.
LGTM!
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.
Great, I'm glad this turned out pretty simple to implement. A handful of comments.
example/project.clj
Outdated
@@ -1,19 +1,22 @@ | |||
(defproject lein-monolith.example/all "MONOLITH" | |||
:description "Overarching example project." | |||
|
|||
:pedantic? :ranges |
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.
Huh... this definitely shouldn't be required.
(update subproject :profiles merge | ||
(plugin/build-inherited-profiles | ||
monolith subproject))])) | ||
(into {} | ||
(plugin/build-profiles | ||
monolith subproject)))])) | ||
subprojects)] |
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.
Open question: should we care about profile ordering for fingerprinting? I'm biasing toward keeping the existing behavior of not guaranteeing the order is deterministic for now but I'm open to addressing this here while I'm at it
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.
Seems like it's probably okay to not have ordering matter here, we're just adding the information so the fingerprinting code can see all of the relevant information by including profiles.
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.
Looking good! A few more small optimizations, then will be ready to go.
(update subproject :profiles merge | ||
(plugin/build-inherited-profiles | ||
monolith subproject))])) | ||
(into {} | ||
(plugin/build-profiles | ||
monolith subproject)))])) | ||
subprojects)] |
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.
Seems like it's probably okay to not have ordering matter here, we're just adding the information so the fingerprinting code can see all of the relevant information by including profiles.
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.
Nice, looks good! 🙆♂️
We'd like to implement support for dependency sets in lein-monolith to help us cleanly cutover projects to newer versions of our managed dependencies.
To this end, this PR implements support for the following:
:monolith/dependency-set
:managed-dependencies
populated from the dependency set:monolith/dependency-set
can be used independently of:monolith/inherit
I added some unit tests to ensure the managed dependencies (and their order) are set correctly when a dependency set is used. I also did some local testing with projects to check that dependencies from a dependency set are passed onto the generated pom file.