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

The following code, that "fakes" a VCS, does not fix the issue. Ort probably can not handle remotes that are a local path? #4433

Closed
sschuberth opened this issue Sep 6, 2021 · 4 comments

Comments

@sschuberth
Copy link
Member

The following code, that "fakes" a VCS, does not fix the issue. Ort probably can not handle remotes that are a local path?

rm -rf .git .hg # ...
git init
git add .
git config user.email "[email protected]"
git config user.name "fakeVCS.sh"
git commit -am"fakeVCS.sh"
git remote add origin "$(pwd)"

It still fails with

07:59:13.335 [main] ERROR org.ossreviewtoolkit.cli.commands.ReporterCommand - Could not create 'EvaluatedModel' report in 0s: IllegalArgumentException: The VcsInfo(type=Git, url=file:///outputs/src/, revision=ed8a0900c56408efe8cbdcf1bcdfdee69d81f600, path=my-app) of project 'Maven:com.mycompany.app:my-app:1.0-SNAPSHOT' cannot be found in Repository(vcs=VcsInfo(type=Git, url=/outputs/src, revision=ed8a0900c56408efe8cbdcf1bcdfdee69d81f600, path=), vcsProcessed=VcsInfo(type=Git, url=file:///outputs/src/, revision=ed8a0900c56408efe8cbdcf1bcdfdee69d81f600, path=),
nestedRepositories={}, config=RepositoryConfiguration(excludes=Excludes(paths=[], scopes=[]), resolutions=Resolutions(issues=[], ruleViolations=[], vulnerabilities=[]), curations=Curations(packages=[], licenseFindings=[]), packageConfigurations=[], licenseChoices=LicenseChoices(repositoryLicenseChoices=[], packageLicenseChoices=[]))).

Originally posted by @maxhbr in #2579 (comment)

@sschuberth
Copy link
Member Author

Note the we also have issue #2900 which is about Git remotes that point to local (Windows) paths.

@maxhbr
Copy link
Contributor

maxhbr commented Sep 27, 2021

my next try to fake a vcs, so that ORT is "happy":

#!/usr/bin/env bash
set -euo pipefail

target="$1"

if [[ -d "$target/.git" || -d "$target/.hg" ]]; then
    echo "already under version control"
    exit 0
fi

tmpdir="$(mktemp -d)"
git clone https://github.com/maxhbr/empty-fake-repo-for-ort "$tmpdir"
mv "$tmpdir/.git" "$target/.git"
rm -rf "$tmpdir"

@maxhbr
Copy link
Contributor

maxhbr commented Dec 22, 2021

@sschuberth I still see that issue frequently pooping up and creating a lot of friction in the adoption of ORT.

@sschuberth
Copy link
Member Author

Analyzing / scanning local directories that are not a working copy from a VCS still isn't a use-case that we endorse / officially support. But in order to properly track the demand I'll close this in favor of #2896 to consolidate there.

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

No branches or pull requests

2 participants