Problem/Motivation

As of #3278411: Always use FileSystemInterface::getTempDirectory() to get the temporary directory, it doesn't make a whole lot of sense for this method to be protected. We don't want other code overriding it, since that breaks a bunch of our logic in terms of keeping things clean. Quoth @tedbow in Slack:

I think our logic around deleting assumes they are all in the same place. This is why we picked unique sub-directories based on the stage id also.
Because in the case where you break a stage lock but the update is the middle of the call to $this->beginner->begin() the old stage may still be copy files into its sub-directory because we can’t actually kill the composer-stager process. But that is not problem because no other Stage operations will be able to act on it because of checkOwnership() and we will delete the staging root in destroy() so a left over directory will be deleted on the next destroy even if it’s lock was broken during `$this->beginner->begin() . But if any Stage can use a different staging root none of that works

Proposed resolution

Make this method private and find another way to override it in tests.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phenaproxima created an issue. See original summary.

tedbow’s picture

Status: Active » Reviewed & tested by the community

  • phenaproxima committed 3151961 on 8.x-2.x
    Issue #3278435 by phenaproxima: Make Stage::getStagingRoot() private
    
phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 8.x-2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.