juergbi commented on code in PR #2098:
URL: https://github.com/apache/buildstream/pull/2098#discussion_r2720387509
##########
src/buildstream/source.py:
##########
@@ -1387,14 +1396,32 @@ def create_source_info(
version: A string which represents a unique version of this source
input
version_guess: An optional string representing the guessed human
readable version
extra_data: Additional plugin defined key/values
+ provenance_node: The optional :class:`Node <buildstream.node.Node>`
with source provenance attributes,
+ defaults to the provenance specified at the top
level of the source.
*Since: 2.5*
"""
homepage = None
issue_tracker = None
- if self.__provenance is not None:
- homepage = self.__provenance.homepage
- issue_tracker = self.__provenance.issue_tracker
+
+ provenance = None
+ if provenance_node is not None:
+ provenance: Optional[_SourceProvenance] =
_SourceProvenance.new_from_node(provenance_node)
+ # if the source uses multiple sources but the individual source_info
has
+ # no specified provenance data, skip it. We don't want to use top level
+ # data as a fallback because it'll just be wrong
+ elif self.BST_MULTI_SOURCE_PROVENANCE:
+ if self.__provenance is not None:
+ # This warning is printed for each occurrence of missing
provenance
+ # for each sub-source, maybe it should be done just the once
per
+ # multi-source?
+ self.warn("Multi source plugin: Not using top level source
provenance")
Review Comment:
I think we should indeed make this an error and move it to the `Source`
constructor. I don't see a backward compatibility concern as there are no
`BST_CUSTOM_SOURCE_PROVENANCE` source plugins yet. If needed, we could
potentially be less strict in the future, while the other way round would be
impossible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]