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 Artifact object for last_successful as that is really a different artifact.
  • Move the optional key parameter from the Artifact methods to the Artifact constructor, storing it in a member variable. Makes much more sense, in my opinion, as this prevents accessing different artifacts with the same Artifact object.
  • Create the Artifact object only when the relevant cache key is determined. Replace the Artifact object in the infrequent case when the relevant cache key changes (workspace build, pull in non-strict mode). I.e., create Artifact object in _update_state().
  • Move simplified metadata cache to the Artifact class. The above changes should guarantee that the same Artifact object 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

Merge request reports

Loading