-
Notifications
You must be signed in to change notification settings - Fork 309
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
refactor(vcs): VCS configuration to support common and custom attributes #9271
base: main
Are you sure you want to change the base?
refactor(vcs): VCS configuration to support common and custom attributes #9271
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9271 +/- ##
=========================================
Coverage 67.49% 67.49%
Complexity 1198 1198
=========================================
Files 241 241
Lines 8495 8495
Branches 900 900
=========================================
Hits 5734 5734
Misses 2399 2399
Partials 362 362
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
60b8d10
to
ae31656
Compare
1cf9421
to
ce5d30c
Compare
I believe the options for configuring submodule recursion could be injected via package curations. Have you considered this? |
@fviernau Hello, can you explain a little bit more please? |
I believe it makes sense to have the ability to configure this separate per dependency.
|
@@ -387,7 +388,8 @@ abstract class VersionControlSystem( | |||
workingTree: WorkingTree, | |||
revision: String, | |||
path: String = "", | |||
recursive: Boolean = false | |||
recursive: Boolean = false, | |||
options: Options = emptyMap() // VCS-specific options only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding an unused option to the function signature does not fix anything, so you should not say so in the commit message. Most importantly, these options are not read from the configuration file and passed on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope I have improved the commit message now, also emphasising that this options are only available if the VCS plugin is consumed using the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options are only available if the VCS plugin is consumed using the API.
I fear that's not enough. For the PR to be acceptable, VCS plugins should be configurable via config.yml
entries, just like package managers like GradleInspector, independently of any programmatic use / ORT Server context.
While VCS implementations are already plugins, they are not yet configurable. VCS implementations require common configurations (e.g., `revision`, `recursive`) and should support also VCS-specific configurations if they are consumed via their API. This allows to add functionality to individual VCS implementations without the need to implement them for all of them. This refactoring keeps the common configurations attributes as they are, while VCS-specific configurations are stored generically in an `options` attribute. Fixes oss-review-toolkit#8556. Signed-off-by: Wolfgang Klenk <[email protected]>
For large repositories with many layers of nested Git submodules, the download process can be very time-consuming and often results in duplicate projects in the tree of nested submodules. This feature introduces configuration options to limit the recursive checkout of nested Git submodules to the first layer, optimizing performance and reducing redundancy. Additionally, it also allows to limit the depth of commit history to fetch when downloading the projects. Signed-off-by: Wolfgang Klenk <[email protected]>
ce5d30c
to
d9ef04f
Compare
While VCS implementations are already plugins, they are not yet configurable. VCS implementations require common configurations (e.g.,
revision
,recursive
) and should support also VCS-specific configurations if they are consumed via their API.This allows to add functionality to individual VCS implementations without the need to implement them for all of them.
This refactoring keeps the common configuration attributes as they are, while VCS-specific configurations are stored generically in an
options
attribute.The change also adds VCS-specific configuration options for Git: The strategy for checking out repositories with submodules now allows to only check out the first layer of submodules.
For more details, please have a look at the respective commits.
Fixes #8556.