Replies: 1 comment 3 replies
-
After some discussion internally about this, we decided to keep package dependencies transitive. This is because it is immediately obvious what a package depends on, and there is no guesswork when moving / extracting / isolating packages from one another. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have three packages (based on the ones in the Packwerk intro video):
Based on the common understanding of "dependency", you would expect that referencing
Parts::TruckEngine
from insideBuilding::House
would be allowed sincebuilding
depends onvehicle
, which depends onparts
, which containsParts::TruckEngine
. But this would in fact fail since Packwerk does not consider dependencies transitively, so you would have to change theapp/models/building
package like so:# app/models/building/package.yml enforce_depencencies: true dependencies: - app/models/vehicle +- app/models/parts
This is fine for three packages like this, but the problem scales badly with number of packages. We now have nearly 100 packages in our core monolith and the number of times dependencies are duplicated in
package.yml
files is getting out of hand.I'd like to propose that Packwerk consider dependencies transitively, such that the change to
app/models/building/package.yml
would not be necessary. This seems like it shouldn't be hard to do.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions