Skip to content

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth requested a review from a team as a code owner September 24, 2025 19:51
@sschuberth sschuberth enabled auto-merge (rebase) September 24, 2025 19:51
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.57%. Comparing base (783c6d5) to head (c3a0438).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10890   +/-   ##
=========================================
  Coverage     57.57%   57.57%           
  Complexity     1702     1702           
=========================================
  Files           346      346           
  Lines         12829    12829           
  Branches       1212     1212           
=========================================
  Hits           7386     7386           
  Misses         4978     4978           
  Partials        465      465           
Flag Coverage Δ
test-ubuntu-24.04 42.30% <ø> (ø)
test-windows-2025 42.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


private fun Carthage.resolveDependencies(definitionFile: File) =
resolveDependencies(USER_DIR, definitionFile, Excludes.EMPTY, AnalyzerConfiguration(), emptyMap())
resolveDependencies(definitionFile.parentFile, definitionFile, Excludes.EMPTY, AnalyzerConfiguration(), emptyMap())
Copy link
Member

Choose a reason for hiding this comment

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

This functions seems a bit redundant with resolveSingleProject(). Would it make sense to drop it in favor of resolveSingleProject() maybe in a preceeding commit?


val result = GradleInspectorFactory.create(javaVersion = "17")
.resolveDependencies(USER_DIR, listOf(definitionFile), Excludes.EMPTY, AnalyzerConfiguration(), emptyMap())
val result = GradleInspectorFactory.create(javaVersion = "17").resolveDependencies(
Copy link
Member

@fviernau fviernau Sep 25, 2025

Choose a reason for hiding this comment

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

Also here resolveSingleProject() ? ..and below.

edit: I just noticed the limitation of resolveSingleProject() to return just a single ProjectAnalyzerResult. However, we could have a similar helper function which does not assume single result, but which helps removing code redundancy in an analog way? Something like resolveSingleDefinitionFile()

Copy link
Member Author

Choose a reason for hiding this comment

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

I just noticed the limitation of resolveSingleProject() to return just a single ProjectAnalyzerResult.

That's exactly the reason why I didn't do a migration here yet. I agree it's probably meaningful to do, but I'd like to consider this out of scope for this PR.

@sschuberth sschuberth requested review from fviernau and a team September 25, 2025 07:11
@sschuberth sschuberth force-pushed the no-user-dir branch 7 times, most recently from 775d91f to f40df96 Compare September 25, 2025 18:11
@sschuberth sschuberth marked this pull request as draft September 25, 2025 18:11
auto-merge was automatically disabled September 25, 2025 18:11

Pull request was converted to draft

`USER_DIR` is the current user / working directory which does not
necessarily have anything in common with the definition files. Use a
more realistic analyzer root that is a parent of the definition files
instead.

For `CargoSubcrateFunTest` this actually fixes the `PackageLinkage` as
it is determined based in the `analyzerRoot`. This corrects
"Crate::lib:0.1.0" to appear in the list of packages.

For various other tests, this simplifies the project ID / paths of
expected results as the project root now equals the `analyzerRoot`.

Signed-off-by: Sebastian Schuberth <[email protected]>
Reuse this function to align with other tests.

Signed-off-by: Sebastian Schuberth <[email protected]>
import org.ossreviewtoolkit.model.config.ScopeExcludeReason
import org.ossreviewtoolkit.plugins.api.PluginConfig
import org.ossreviewtoolkit.utils.test.USER_DIR
import org.ossreviewtoolkit.utils.common.getCommonParentFile
Copy link
Member

Choose a reason for hiding this comment

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

commit-msg: Is there another reason for no more using USER_DIR which is not mentioned?

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.

2 participants