juergbi commented on code in PR #98:
URL: 
https://github.com/apache/buildstream-plugins/pull/98#discussion_r2804791783


##########
src/buildstream_plugins/sources/cargo.py:
##########
@@ -368,16 +378,27 @@ class CargoSource(Source):
     # We need the Cargo.lock file to construct our ref at track time
     BST_REQUIRES_PREVIOUS_SOURCES_TRACK = True
 
+    BST_CUSTOM_SOURCE_PROVENANCE = True
+
     ########################################################
     #       Plugin/Source API method implementations       #
     ########################################################
     def configure(self, node):
-
         # The url before any aliasing
         #
         self.original_url = node.get_str("url", 
"https://static.crates.io/crates";)
         self.cargo_lock = node.get_str("cargo-lock", "Cargo.lock")
         self.vendor_dir = node.get_str("vendor-dir", "crates")
+        self.provenance = {}
+
+        # Because source provenance info lives in the ref it would be
+        # removed upon source track, create a backup here so it is
+        # available to be added back in when setting the ref
+        for crate in node.get_sequence("ref"):

Review Comment:
   ```suggestion
           for crate in node.get_sequence("ref", None):
   ```



-- 
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]

Reply via email to