The ProjectSourceRule can download a remote project repository in order to perform checks on the project's source code. It leverages a SourceTreeResolver for that which downloads the source code to a temporary directory:
|
fun forRemoteRepository(vcsInfo: VcsInfo) = |
|
SourceTreeResolver { |
|
val downloadDir = createOrtTempDir() |
|
val downloaderConfiguration = DownloaderConfiguration(sourceCodeOrigins = listOf(SourceCodeOrigin.VCS)) |
|
val downloader = Downloader(downloaderConfiguration) |
|
val pkg = Package.EMPTY.copy(vcsProcessed = vcsInfo) |
|
|
|
downloader.download(pkg, downloadDir) |
|
|
|
downloadDir |
|
} |
However, this temporary directory seems to never get deleted. This could be problematic if different users share a CI node that runs the evaluator. Then user A could access the (proprietary) project source code of user B.
So we probably should delete the temporary directory after use, but this seems to be tricky with the current design of the ProjectSourceRule rule.
@fviernau would you have any idea how to properly delete the temporary directory after its use? Ideally automatically, without the need for the user to call a special function.
The
ProjectSourceRulecan download a remote project repository in order to perform checks on the project's source code. It leverages aSourceTreeResolverfor that which downloads the source code to a temporary directory:ort/evaluator/src/main/kotlin/SourceTreeResolver.kt
Lines 35 to 45 in 660946f
However, this temporary directory seems to never get deleted. This could be problematic if different users share a CI node that runs the evaluator. Then user A could access the (proprietary) project source code of user B.
So we probably should delete the temporary directory after use, but this seems to be tricky with the current design of the
ProjectSourceRulerule.@fviernau would you have any idea how to properly delete the temporary directory after its use? Ideally automatically, without the need for the user to call a special function.