-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat(node): Keep created node_modules
directories until after resolution
#9781
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9781 +/- ##
============================================
+ Coverage 68.08% 68.11% +0.02%
- Complexity 1286 1287 +1
============================================
Files 249 249
Lines 8829 8837 +8
Branches 918 918
============================================
+ Hits 6011 6019 +8
Misses 2432 2432
Partials 386 386
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
e1a026a
to
dbad6a6
Compare
d96ca20
to
5882fb9
Compare
{before,after}Resolution()
are called{before,after}Resolution()
are called to make these hooks more useful
plugins/package-managers/maven/src/funTest/kotlin/MavenFunTest.kt
Outdated
Show resolved
Hide resolved
fba4e24
to
a2afa30
Compare
a2afa30
to
33ab11e
Compare
33ab11e
to
8c82740
Compare
@@ -38,10 +38,10 @@ import org.ossreviewtoolkit.plugins.packagemanagers.node.NodePackageManagerType | |||
import org.ossreviewtoolkit.plugins.packagemanagers.node.PackageJson | |||
import org.ossreviewtoolkit.plugins.packagemanagers.node.parsePackageJson | |||
import org.ossreviewtoolkit.utils.common.CommandLineTool | |||
import org.ossreviewtoolkit.utils.common.DirectoryStash |
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.
I still have to think about this commit a bit, haven't finished the review.
The previous commits LGTM now. Do you want to split out this commit so you can merge the rest ?
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.
Do you want to split out this commit so you can merge the rest ?
I'm not sure... since this is (to me) the most important commit that concludes the series and allows for the React-Native NPM / Gradle use-case to be analyzed, there is not much value in merging the other commits without this.
I still have to think about this commit a bit
Maybe it helps if you look at the current implementation of stashDirectories()
: It's basically just a shortcut for creating a DirectoryStash
instance, that is then closed via use {}
. All that the last commit intends to do is to split the creation of the DirectoryStash
instance and the closing across beforeResolution()
/ afterResolution()
by calling close()
explicitly instead of leveraging use {}
.
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.
Maybe it helps if you look at the current implementation of
stashDirectories()
I got that bit, but I need to first better understand some details of the analyzer, e.g. how this fits with mapDefinitionFiles, but also in general.
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.
Could we also address issues, if any, as a follow-up? I'd like to include this feature into tomorrow's ORT release.
Regarding the mapping of definition files: That happens in findManagedFiles()
before analyze{InParallel}()
is called. So {before,after}Resolution()
see the mapped files, just like originally, if that was one of the questions.
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.
I'm a bit short in time before the release, and I'm not 100% confident yet about the approach of the top-most commit (I'd need do research). In general, I believe it'd be nice to also have @mnonnenmacher's view.
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.
In general, I believe it'd be nice to also have @mnonnenmacher's view.
Or also @MarcelBochtler. Whatever it takes to move this forward.
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.
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.
In general, I believe it'd be nice to also have @mnonnenmacher's view.
Looks good to me, I don't see any issues with the approach.
8c82740
to
fa5c65b
Compare
…ution This fixes the case where a Gradle analysis (that is configured to run after e.g. a Yarn analysis) needs to access Gradle projects inside the `node_modules` directory created by a React-Native build. Signed-off-by: Sebastian Schuberth <[email protected]>
fa5c65b
to
8179dfb
Compare
{before,after}Resolution()
are called to make these hooks more usefulnode_modules
directories until after resolution
@@ -38,10 +38,10 @@ import org.ossreviewtoolkit.plugins.packagemanagers.node.NodePackageManagerType | |||
import org.ossreviewtoolkit.plugins.packagemanagers.node.PackageJson | |||
import org.ossreviewtoolkit.plugins.packagemanagers.node.parsePackageJson | |||
import org.ossreviewtoolkit.utils.common.CommandLineTool | |||
import org.ossreviewtoolkit.utils.common.DirectoryStash |
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.
In general, I believe it'd be nice to also have @mnonnenmacher's view.
Looks good to me, I don't see any issues with the approach.
Actually, no actionable changes were requested. The review was just blocked out of a lack of time to think about it.
Please have a look at the individual commit messages for the details.