Skip to content

refactor(Repository): Add RepositoryProvenance attribute #10575

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pepper-jk
Copy link
Contributor

@pepper-jk pepper-jk commented Jul 9, 2025

This draft includes the first changes for my personal POC for the LocalProvenance Input discussed in #8803.
As it's scope is so small, it might be good first contribution towards that goal.
If not, feel free to let me know. All feedback is welcome.

The Repository data structure seems the easiest place to allow Provenances as Analyzer and Scanner input.
This avoids refactoring the attributes of higher level data structures, such as OrtResult.
At the moment the implementation limits it to RepositoryProvence though, in order to keep its previous behavior. To that end, it also continues to expose the raw VcsInfo of the provenance as its vcs attribute.

Signed-off-by: Jens Keim [email protected]

The `Repository` data structure seems the easiest place to allow
`Provenance`s as `Analyzer` and `Scanner` input.
This avoids refactoring the attributes of higher level data structures,
such as `OrtResult`.
At the momemnt the implementation limits it to `RepositoryProvence`
though, in order to keep its previous behavior. To that end, it also
continues to expose the raw `VcsInfo` of the `provenance` as its `vcs`
attribute.

Signed-off-by: Jens Keim <[email protected]>
/**
* Original VCS-related information from the working tree containing the analyzer root.
*/
val vcs: VcsInfo,
val vcs: VcsInfo = provenance.vcsInfo,
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand what value the val provenance: RepositoryProvenance as it always contains a VcsInfo. So, we have same information as before.

Also, what's the reason for keeping the vcs attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be only the first step towards allowing more than just VcsInfo as the provenance of a Repository.

Right now it is limited to RepositoryProvenance in order to not break previous behavior. Same goes for keeping the vcs attribute.

If this scope is too small, I can always add to this draft first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added some more context to PR description.

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.

2 participants