Follow-up from "Artifact 'abstraction' class"

  • 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.

See !1175 (comment 148557092)