abderrahim commented on code in PR #2098:
URL: https://github.com/apache/buildstream/pull/2098#discussion_r2711659938
##########
src/buildstream/source.py:
##########
@@ -1386,15 +1387,23 @@ def create_source_info(
choice depicting the type of version.
version: A string which represents a unique version of this source
input
version_guess: An optional string representing the guessed human
readable version
+ provenance_node: The optional YAML node with source provenance
attributes,
Review Comment:
It's probably better to refer to the Node class rather than saying a "YAML
node"
##########
src/buildstream/source.py:
##########
@@ -1386,15 +1387,23 @@ def create_source_info(
choice depicting the type of version.
version: A string which represents a unique version of this source
input
version_guess: An optional string representing the guessed human
readable version
+ provenance_node: The optional YAML node with source provenance
attributes,
+ defaults to the provenance specified at the top
level of the source.
Review Comment:
I'm not sure this silent fallback semantic is good. IIUC, if the plugin
provides a provenance for every source info, this will be silently ignored. If
the plugin provides multiple source infos, and only some of them set provenance
info (e.g. your implementation in
https://gitlab.com/BuildStream/buildstream-plugins-community/-/merge_requests/408
if the user doesn't manually modify the ref to include provenance), then
source infos that don't set it get the fallback of a global source provenance
which is the same for everything.
I'm not sure what would be the best option here, but I feel the current
implementation might not be a good idea.
##########
src/buildstream/source.py:
##########
@@ -1367,6 +1367,7 @@ def create_source_info(
version: str,
*,
version_guess: Optional[str] = None,
+ provenance_node: Optional[MappingNode] = None,
Review Comment:
nit: I would add this after extra_data.
--
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]