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

PackageConfiguration: Support matching any revision #5233

Merged
merged 2 commits into from
Apr 7, 2022

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

In exchange for the speaking function name, add a code comment.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@sschuberth sschuberth requested a review from a team as a code owner April 6, 2022 17:40
@sschuberth
Copy link
Member Author

@fviernau, after another discussion with @mnonnenmacher we decided to propose this change without hiding it behind a feature toggle. The reason mostly is that any such conventions like requiring a fixed revision could (and probably should) be implemented via CI checks on package configuration changes. That way, we avoid an increasing number of feature toggles being introduced, esp. before have a proper mechanism to share global configuration throughout all of ORT without passing config options everywhere.

So, what do you think @fviernau?

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #5233 (1ebfc8b) into main (e4d39c3) will decrease coverage by 0.00%.
The diff coverage is 20.00%.

@@             Coverage Diff              @@
##               main    #5233      +/-   ##
============================================
- Coverage     72.30%   72.30%   -0.01%     
  Complexity     1945     1945              
============================================
  Files           259      259              
  Lines         13826    13836      +10     
  Branches       1950     1950              
============================================
+ Hits           9997    10004       +7     
- Misses         2796     2798       +2     
- Partials       1033     1034       +1     
Impacted Files Coverage Δ
...del/src/main/kotlin/config/PackageConfiguration.kt 66.66% <20.00%> (-8.34%) ⬇️
downloader/src/main/kotlin/vcs/Cvs.kt 17.72% <0.00%> (ø)
...n/kotlin/scanners/scancode/ScanCodeResultParser.kt 92.99% <0.00%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4d39c3...1ebfc8b. Read the comment docs.

*/
val revision: String
@JsonInclude(JsonInclude.Include.NON_NULL)
val revision: String? = null
Copy link
Member

Choose a reason for hiding this comment

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

Please also update docs/config-file-package-configuration-yml.md, maybe just add "(optional)" before the one mention of the revision property.

Allow to omit a `VcsMatcher`'s `revision` to match any `resolvedRevision`
from a `RepositoryProvenance`. This is especially useful when working
with `SpdxDocumentFile`s that define packages in subdirectories of the
project's repository, as it avoids the `revision` to be updated whenever
commits to the project (not the package) are being made.

Resolves #4196.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@sschuberth sschuberth merged commit 0386ca5 into main Apr 7, 2022
@sschuberth sschuberth deleted the pkg-conf-rev-matching branch April 7, 2022 10:03
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