summaryrefslogtreecommitdiff
path: root/src/buildstream/_pluginfactory/pluginorigin.py
diff options
context:
space:
mode:
authorTristan van Berkom <tristan.vanberkom@codethink.co.uk>2020-08-13 19:01:00 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-10-01 13:27:30 +0900
commit751c80d4938b7c3a798d056134f58844242939b3 (patch)
treea31bd535be946b3032d22b6296a49b735ba5e2b1 /src/buildstream/_pluginfactory/pluginorigin.py
parent348108d933be748727ee8aec861ecd5c168db72e (diff)
downloadbuildstream-tristan/lazy-provenance.tar.gz
Refactor: Lazily instantiate ProvenanceInformation objectstristan/lazy-provenance
As a rule, throughout the codebase we should not be using internal ProvenanceInformation objects in our APIs, but rather Node objects. This is because ProvenanceInformation is generated on the fly from a Node object, and it is needlessly expensive to instantiate one before it is absolutely needed. This patch unilaterally fixes the codebase to pass `provenance_node` Node objects around as arguments rather than `provenance` ProvenanceInformation objects.
Diffstat (limited to 'src/buildstream/_pluginfactory/pluginorigin.py')
-rw-r--r--src/buildstream/_pluginfactory/pluginorigin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/_pluginfactory/pluginorigin.py b/src/buildstream/_pluginfactory/pluginorigin.py
index e75b8cb58..f464b22ea 100644
--- a/src/buildstream/_pluginfactory/pluginorigin.py
+++ b/src/buildstream/_pluginfactory/pluginorigin.py
@@ -79,7 +79,7 @@ class PluginOrigin:
self.origin_type = origin_type # The PluginOriginType
self.elements = {} # A dictionary of PluginConfiguration
self.sources = {} # A dictionary of PluginConfiguration objects
- self.provenance = None
+ self.provenance_node = None
self.project = None
# Private
@@ -102,7 +102,7 @@ class PluginOrigin:
#
def initialize(self, project, origin_node):
- self.provenance = origin_node.get_provenance()
+ self.provenance_node = origin_node
self.project = project
self.load_config(origin_node)