-
Notifications
You must be signed in to change notification settings - Fork 39
Add more source provenance attribtues #2095
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -553,8 +553,16 @@ def __init__( | |
| self, | ||
| kind: str, | ||
| url: str, | ||
| concluded_license: Optional[str], | ||
| copyright_text: Optional[str], | ||
| declared_license: Optional[str], | ||
| description: Optional[str], | ||
| external_reference: Optional[str], | ||
| homepage: Optional[str], | ||
| issue_tracker: Optional[str], | ||
| name: Optional[str], | ||
| originator: Optional[str], | ||
| supplier: Optional[str], | ||
| medium: Union[SourceInfoMedium, str], | ||
| version_type: Union[SourceVersionType, str], | ||
| version: str, | ||
|
|
@@ -572,14 +580,54 @@ def __init__( | |
| The url of the source input | ||
| """ | ||
|
|
||
| self.concluded_license: Optional[str] = concluded_license | ||
| """ | ||
| The license of the source project as declared by the authors | ||
| """ | ||
|
|
||
| self.copyright_text: Optional[str] = copyright_text | ||
| """ | ||
| Copyright notice of the source | ||
| """ | ||
|
|
||
| self.declared_license: Optional[str] = declared_license | ||
| """ | ||
| Licences that have been officially declared for the source | ||
| """ | ||
|
|
||
| self.description: Optional[str] = description | ||
| """ | ||
| Description of the source | ||
| """ | ||
|
|
||
| self.external_reference: Optional[str] = external_reference | ||
| """ | ||
| Reference to an external source of information or assets relevant to the source | ||
| """ | ||
|
|
||
| self.homepage: Optional[str] = homepage | ||
| """ | ||
| The project homepage URL | ||
| The source's homepage URL | ||
| """ | ||
|
|
||
| self.issue_tracker: Optional[str] = issue_tracker | ||
| """ | ||
| The project issue tracking URL | ||
| The source's issue tracking URL | ||
| """ | ||
|
|
||
| self.name: Optional[str] = name | ||
| """ | ||
| Name of the source | ||
| """ | ||
|
Comment on lines
+618
to
+621
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be a more general comment, but the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discard the above, I had missed the fact that the The fact that the provenance fields are all user-configurable mostly covers my concerns. I still think we should aim to populate the I think it's worth to have this documented properly, however. I'll add a separate comment about it. |
||
|
|
||
| self.originator: Optional[str] = originator | ||
| """ | ||
| The name of the source's originators/owners | ||
| """ | ||
|
|
||
| self.supplier: Optional[str] = supplier | ||
| """ | ||
| The name of the source's distributor | ||
| """ | ||
|
|
||
| self.medium: Union[SourceInfoMedium, str] = medium | ||
|
|
@@ -642,10 +690,22 @@ def serialize(self) -> Dict[str, Union[str, Dict[str, str]]]: | |
| "url": self.url, | ||
| } | ||
|
|
||
| if self.homepage is not None: | ||
| version_info["homepage"] = self.homepage | ||
| if self.issue_tracker is not None: | ||
| version_info["issue-tracker"] = self.issue_tracker | ||
| source_info_extra_fields = [ | ||
| "concluded-license", | ||
| "copyright-text", | ||
| "declared-license", | ||
| "description", | ||
| "external-reference", | ||
| "homepage", | ||
| "issue-tracker", | ||
| "name", | ||
| "originator", | ||
| "supplier", | ||
| ] | ||
|
Comment on lines
+693
to
+704
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get the user-configurable
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is all going to be implemented in a different way now that removes the requirement for the buildstream core to have to know about all this SBOM stuff that is irrelevant to it. Instead buildstream-sbom will be used for storing this as a source of truth and allowing for the buildstream core to not get cluttered up with this. I am currently working on a new set of patches to implement this :) |
||
|
|
||
| for field in source_info_extra_fields: | ||
| if (value := getattr(self, field.replace("-", "_"))) is not None: | ||
| version_info[field] = value | ||
|
|
||
| version_info["medium"] = medium_str | ||
| version_info["version-type"] = version_type_str | ||
|
|
@@ -1390,17 +1450,41 @@ def create_source_info( | |
|
|
||
| *Since: 2.5* | ||
| """ | ||
| concluded_license = None | ||
| copyright_text = None | ||
| declared_license = None | ||
| description = None | ||
| external_reference = None | ||
| homepage = None | ||
| issue_tracker = None | ||
| name = None | ||
| originator = None | ||
| supplier = None | ||
| if self.__provenance is not None: | ||
| concluded_license = self.__provenance.concluded_license | ||
| copyright_text = self.__provenance.copyright_text | ||
| declared_license = self.__provenance.declared_license | ||
| description = self.__provenance.description | ||
| external_reference = self.__provenance.external_reference | ||
| homepage = self.__provenance.homepage | ||
| issue_tracker = self.__provenance.issue_tracker | ||
| name = self.__provenance.name | ||
| originator = self.__provenance.originator | ||
| supplier = self.__provenance.supplier | ||
|
|
||
| return SourceInfo( | ||
| self.get_kind(), | ||
| url, | ||
| concluded_license, | ||
| copyright_text, | ||
| declared_license, | ||
| description, | ||
| external_reference, | ||
| homepage, | ||
| issue_tracker, | ||
| name, | ||
| originator, | ||
| supplier, | ||
| medium, | ||
| version_type, | ||
| version, | ||
|
|
||
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.
Another thing that I feel would be useful to have is the external reference: https://spdx.github.io/spdx-spec/v2.3/package-information/#721-external-reference-field