Skip to content

feat(ort-config): Extract a generic GitPackageCurationProvider#11941

Merged
mnonnenmacher merged 2 commits into
mainfrom
git-curation-provider
Jun 4, 2026
Merged

feat(ort-config): Extract a generic GitPackageCurationProvider#11941
mnonnenmacher merged 2 commits into
mainfrom
git-curation-provider

Conversation

@mnonnenmacher
Copy link
Copy Markdown
Member

Extract a generic GitPackageCurationProvider from the OrtConfigPackageCurationProvider and make the latter inherit from the new one. The new provider allows to use any Git repository as a source for package curation files.

For now, the provider requires the same file layout as the OrtConfigPackageCurationProvider, this could be made configurable if required later on.

@mnonnenmacher mnonnenmacher force-pushed the git-curation-provider branch 2 times, most recently from 931a564 to ba9faac Compare June 3, 2026 15:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.43%. Comparing base (b1b82c2) to head (4d54d8c).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #11941   +/-   ##
=========================================
  Coverage     58.43%   58.43%           
  Complexity     1809     1809           
=========================================
  Files           361      361           
  Lines         13499    13499           
  Branches       1383     1383           
=========================================
  Hits           7888     7888           
  Misses         5115     5115           
  Partials        496      496           
Flag Coverage Δ
funTest-external-tools 14.64% <ø> (ø)
funTest-no-external-tools 30.37% <ø> (-0.03%) ⬇️
test-ubuntu-24.04 41.78% <ø> (ø)
test-windows-2025 41.76% <ø> (ø)

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 val repositoryDir by lazy {
// Use a stable cache path to clone the repository to speed up subsequent runs.
(ortDataDirectory / "cache" / "git-package-curation-provider" / config.repositoryUrl.fileSystemEncode()).also {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure about "cache" here. Should we put Git working directories into a more specifically named directory? Which BTW makes me wonder why DefaultWorkingTreeCache uses val dir = createOrtTempDir() instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I just want some stable directory because it's a nice optimization when running ORT locally. "cache" made sense to me to signal that this can be deleted without causing problems (even though there is no automatic cleanup). Do you have any specific proposals for alternatives? It can also easily be changed later, if needed.

Which BTW makes me wonder why DefaultWorkingTreeCache uses val dir = createOrtTempDir() instead.

IIRC this is because the cache was made specifically for the requirements of the scanner and you would not want to permanently archive the source code of all scanned packages when running ORT locally.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you have any specific proposals for alternatives?

Well, maybe any of "git", "worktree", "clone", "plugin"... but you can also keep it at "cache".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I kind of like "plugin" because it clarifies the scope, should I change it? Or maybe we can revisit this when doing the same change for the package configuration provider.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or maybe we can revisit this when doing the same change for the package configuration provider.

Yes, let's do that.

val revision: String?,

/** The path that contains the package curations. */
@OrtPluginOption(defaultValue = "curations")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure if this should really be the default, or just something that OrtConfigPackageCurationProvider sets.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I chose it because it seems people generally use the ort-config repo as template, so why not make their lives a bit easier.

@mnonnenmacher mnonnenmacher force-pushed the git-curation-provider branch from ba9faac to 58aa459 Compare June 3, 2026 19:45
Extract a generic `GitPackageCurationProvider` from the
`OrtConfigPackageCurationProvider` and make the latter inherit from the
new one. The new provider allows to use any Git repository as a source
for package curation files.

For now, the provider requires the same file layout as the
`OrtConfigPackageCurationProvider`, this could be made configurable if
required later on.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.io>
Rename the module that contains the `GitPackageCurationProvider` and the
`OrtConfigPackageCurationProvider` from `ort-config` to `git` to align
with the more generic provider.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.io>
@mnonnenmacher mnonnenmacher force-pushed the git-curation-provider branch from 58aa459 to 4d54d8c Compare June 3, 2026 20:51
@mnonnenmacher mnonnenmacher marked this pull request as ready for review June 3, 2026 20:51
@mnonnenmacher mnonnenmacher requested a review from a team as a code owner June 3, 2026 20:51
@mnonnenmacher mnonnenmacher requested a review from sschuberth June 3, 2026 20:53
import io.kotest.core.annotation.Tags
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.should
@mnonnenmacher mnonnenmacher merged commit 44bf368 into main Jun 4, 2026
31 of 32 checks passed
@mnonnenmacher mnonnenmacher deleted the git-curation-provider branch June 4, 2026 05:28
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.

3 participants