ArchUnit icon indicating copy to clipboard operation
ArchUnit copied to clipboard

Fix some issues with JavaPackage methods considering subpackages

Open grimsa opened this issue 3 years ago • 3 comments

Breaking change.

Changes:

  • Added getClassDependenciesFrom/ToThisPackage
  • Renamed getClassDependenciesFrom/ToSelf to getClassDependenciesFrom/ToThisPackageAndSubpackages
  • Added getPackageDependenciesFrom/ToThisPackage
  • Renamed getPackageDependenciesFrom/ToSelf to getPackageDependenciesFrom/ToThisPackageAndSubpackages

Resolves: #919

grimsa avatar Jul 20 '22 08:07 grimsa

Also, maybe you could make the commit message a little more elaborate :slightly_smiling_face: Because "some issues" is quite fuzzy. What about "explicitly distinguish between direct and subpackage dependencies" or sth. like that as the header? (to keep it below the 70 chars) And then put some details in the body into which issue you ran and why you were confused and how we're solving it now? Just so when I see just this commit I have all the context from the message to understand what was the exact problem and how we decided to fix it (and why not any other way :grin:)

codecholeric avatar Jul 24 '22 16:07 codecholeric

👍 I'll update the PR sometime over the next few days.

@codecholeric In the meantime - have you seen this https://github.com/TNG/ArchUnit/issues/919#issuecomment-1189998749? Maybe a larger-scale change would be desired.

grimsa avatar Jul 25 '22 16:07 grimsa

Hey, sorry, I was knocked out a little the recent weeks :grimacing: I answered at your comment. Given what you said, do you think it would make more sense to call the methods get...ThisPackageTree with a good Javadoc, instead of get...ThisPackageAndSubpackages? Since I agree that "subpackages" again could be understood as only the "direct" subpackages (it would be a little bit weird API to only consider one level of packages for such an API, but still not nice)

codecholeric avatar Aug 09 '22 04:08 codecholeric

Since you seem a little overloaded to push this forward at the moment I created some fixups with some review suggestions (including the renaming from ThisPackageAndAllSubpackages to ThisPackageTree, since you have me convinced, that "subpackage" by definition would only be a direct child :wink:) I also rebased onto the current main branch and added some preparatory refactorings, so maybe back up your local branch before you pull in this stuff :wink: If you don't find the time at all to look into this, let me know! (and no worries, I know how it is with additional time for OSS :wink:) I can also try to find some additional support to review :slightly_smiling_face: Otherwise, let me know what you think about these suggestions, if you think they make sense! I'm just trying to push this, because I want to include it into 1.0.0, and I feel slowly the window for review remarks of 1.0.0-rc1 can be closed :slightly_smiling_face:

codecholeric avatar Aug 28 '22 16:08 codecholeric

Hey, thanks a lot for moving on this, and sorry for dropping the ball :) I will check this today.

grimsa avatar Aug 29 '22 15:08 grimsa

No worries, as I said, I know how it is with this extra time for OSS :wink:

codecholeric avatar Aug 29 '22 15:08 codecholeric

Thanks a lot for your thorough review!! :smiley: And for finding all the places in test code where I overlooked replacing "package and subpackages" by "package tree" :see_no_evil:

codecholeric avatar Sep 04 '22 10:09 codecholeric