Skip to content
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

Analyzer with SVN #5232

Open
fb33 opened this issue Apr 6, 2022 · 4 comments
Open

Analyzer with SVN #5232

fb33 opened this issue Apr 6, 2022 · 4 comments
Labels
analyzer About the analyzer tool bug Issues that are considered to be bugs downloader About the downloader tool

Comments

@fb33
Copy link
Contributor

fb33 commented Apr 6, 2022

Hi,

I've got an issue with a project under SVN.
I've got a project with this repo url : svn+ssh://svn.company.com/svnroot/Products/my-project/trunk
where there is a DotNet project : Prj/Src/module/module.vcxproj (ie => Products/my-project/trunk/Prj/Src/module/module.vcxproj)
The analyzer seems to compute a wrong vcs_processed url :

    projects:
    - id: "DotNet::Prj/Src/module/module.vcxproj:"
      definition_file_path: "Prj/Src/module/module.vcxproj"
      declared_licenses: []
      declared_licenses_processed: {}
      vcs:
        type: ""
        url: ""
        revision: ""
        path: ""
      vcs_processed:
        type: "Subversion"
        url: "svn+ssh://svn.company.com/svnroot/Products/my-project/trunk/Prj/Src/module"
        revision: "110884"
        path: "Prj/Src/module"
      homepage_url: ""
      scopes: []

the obtained vcs_processed url contains the path concatenated with.
So that makes the scanner failed :

Using scanner 'ScanCode' version 30.1.0.
Exception in thread "main" java.lang.IllegalArgumentException: The VcsInfo(type=Subversion, url=svn+ssh://svn.company.com/svnroot/Products/my-project/trunk/Prj/Src/module, revision=110884, path=Prj/Src/module) of project 'DotNet::Prj/Src/module/module.vcxproj:' cannot be found in Repository(vcs=VcsInfo(type=Subversion, url=svn+ssh://svn.company.com/svnroot/Products/my-project/trunk, revision=110884, path=), vcsProcessed=VcsInfo(type=Subversion, url=svn+ssh://svn.company.com/svnroot/Products/my-project/trunk, revision=110884, path=), nestedRepositories={}, config=RepositoryConfiguration( <SKIP too long config> ))).
	at org.ossreviewtoolkit.model.OrtResult.getFilePathRelativeToAnalyzerRoot(OrtResult.kt:279)
	at org.ossreviewtoolkit.model.OrtResult.getDefinitionFilePathRelativeToAnalyzerRoot(OrtResult.kt:265)
	at org.ossreviewtoolkit.model.config.Excludes.findPathExcludes(Excludes.kt:52)
	at org.ossreviewtoolkit.model.OrtResult$projects$2.invoke(OrtResult.kt:116)
	at org.ossreviewtoolkit.model.OrtResult$projects$2.invoke(OrtResult.kt:109)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at org.ossreviewtoolkit.model.OrtResult.getProjects(OrtResult.kt:109)
	at org.ossreviewtoolkit.model.OrtResult.getProject(OrtResult.kt:355)
	at org.ossreviewtoolkit.model.OrtResult.isProject(OrtResult.kt:493)
	at org.ossreviewtoolkit.model.OrtResult.isExcluded(OrtResult.kt:303)
	at org.ossreviewtoolkit.model.OrtResult.getProjects(OrtResult.kt:374)
	at org.ossreviewtoolkit.scanner.ScannerKt.scanOrtResult(Scanner.kt:97)
	at org.ossreviewtoolkit.cli.commands.ScannerCommand.run(ScannerCommand.kt:273)
	at org.ossreviewtoolkit.cli.commands.ScannerCommand.run(ScannerCommand.kt:207)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:395)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:392)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:410)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:435)
	at org.ossreviewtoolkit.cli.OrtMainKt.main(OrtMain.kt:82)

If I store the project files on git ( my-project/trunk becomes my-project.git )
the analyser computes an other project definition, with a good vcs_processed url:

    projects:
    - id: "DotNet::Prj/Src/module/module.vcxproj:"
      definition_file_path: "Prj/Src/module/module.vcxproj"
      declared_licenses: []
      declared_licenses_processed: {}
      vcs:
        type: ""
        url: ""
        revision: ""
        path: ""
      vcs_processed:
        type: "Git"
        url: "ssh://gitlab/my-project.git"
        revision: "538d55b05fa178daa2ebfb5f10761d9e3aafacc2"
        path: "Prj/Src/module"
      homepage_url: ""
      scopes: []

And the scanner can work fine.

@sschuberth sschuberth added bug Issues that are considered to be bugs analyzer About the analyzer tool labels Apr 6, 2022
@fb33
Copy link
Contributor Author

fb33 commented May 2, 2022

The PR #5303 seems to cause some regression in functional test, may be it's not the right way to fix this issue.

An other idea could be to change the way to fill the map the of relativePath (https://github.com/oss-review-toolkit/ort/blob/main/model/src/main/kotlin/OrtResult.kt#L259) by having a specific svn implementation of https://github.com/oss-review-toolkit/ort/blob/main/model/src/main/kotlin/Repository.kt#L71.
But I don't feel comfortable with that.

@sschuberth what do you think about ?

sschuberth added a commit that referenced this issue Sep 23, 2022
This is a fixup for 103a3c1 and fixes #5232.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@Etsija

This comment was marked as off-topic.

@sschuberth
Copy link
Member

@Etsija, I believe your issue is a different one as you say

No analyzer-result.yml gets written.

whereas in @fb33's case the file does get written.

@sschuberth
Copy link
Member

The PR #5303 seems to cause some regression in functional test, may be it's not the right way to fix this issue.

@fb33, it happened so that I'm looking at old Subversion stuff again... would you have / be able to create a test / reproducing repository for this issue?

@sschuberth sschuberth added the downloader About the downloader tool label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool bug Issues that are considered to be bugs downloader About the downloader tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants