Follow-up from "Artifact 'abstraction' class"
Description
Taken from the linked issue:
- In
Element.stage_dependency_artifacts()for the incremental workspace build:
- Create a separate, temporary
Artifactobject forlast_successfulas that is really a different artifact.- Move the optional
keyparameter from theArtifactmethods to theArtifactconstructor, storing it in a member variable. Makes much more sense, in my opinion, as this prevents accessing different artifacts with the sameArtifactobject.- Create the
Artifactobject only when the relevant cache key is determined. Replace theArtifactobject in the infrequent case when the relevant cache key changes (workspace build, pull in non-strict mode). I.e., createArtifactobject in_update_state().- Move simplified metadata cache to the
Artifactclass. The above changes should guarantee that the sameArtifactobject is never used to access different artifacts and thus, this should allow simpler metadata caching.
Proposed changes
- The above
- Use _get_subdirectory() when interacting directly with an artifact subdirectory
- Tidy up and removal of redundant accessors/private methods in element.py
This merge request, when approved, will close: #955 (closed)
Edited by Tom Pollard