juergbi commented on code in PR #2099:
URL: https://github.com/apache/buildstream/pull/2099#discussion_r2697920076
##########
src/buildstream/element.py:
##########
@@ -2635,19 +2635,33 @@ def __load_sources(self, load_element):
del source[Symbol.DIRECTORY]
# Provenance is optional
- provenance_node = source.get_mapping(Symbol.PROVENANCE,
default=None)
- provenance = None
+ provenance_node: MappingNode =
source.get_mapping(Symbol.PROVENANCE, default=None)
if provenance_node:
del source[Symbol.PROVENANCE]
- provenance =
_SourceProvenance.new_from_node(provenance_node)
+ defined_attrs = (
+
project._project_conf.get_mapping("source-provenance-fields", None)
+ or project.source_provenance_fields
Review Comment:
Is this the logic to handle the default on a project level? I'm not sure
whether this works correctly, however, this logic should in any case be in the
`Project` class such that `Element` and `Source` can simply use
`project.source_provenance_fields` (`_project.conf` is considered private and
should not be accessed from other classes). Or am I missing a reason why this
can't be done in the `Project` class?
--
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]