Skip to content
Snippets Groups Projects

Issue #3382942: Eliminate dependencies on Composer Stager internals

Merged Issue #3382942: Eliminate dependencies on Composer Stager internals
All threads resolved!
Merged Ted Bowman requested to merge issue/automatic_updates-3382942:3382942-round-3 into 3.0.x
All threads resolved!
@@ -323,14 +323,13 @@ abstract class StageBase implements LoggerAwareInterface {
$active_dir = $this->pathFactory->create($this->pathLocator->getProjectRoot());
$stage_dir = $this->pathFactory->create($this->getStageDirectory());
$excluded_paths = $this->getPathsToExclude();
$event = new PreCreateEvent($this, $excluded_paths);
$event = new PreCreateEvent($this, $this->getPathsToExclude());
// If an error occurs and we won't be able to create the stage, mark it as
// available.
$this->dispatch($event, [$this, 'markAsAvailable']);
try {
$this->beginner->begin($active_dir, $stage_dir, $excluded_paths, NULL, $timeout);
$this->beginner->begin($active_dir, $stage_dir, $event->excludedPaths, NULL, $timeout);
}
catch (\Throwable $error) {
$this->destroy();
@@ -442,24 +441,22 @@ abstract class StageBase implements LoggerAwareInterface {
$active_dir = $this->pathFactory->create($this->pathLocator->getProjectRoot());
$stage_dir = $this->pathFactory->create($this->getStageDirectory());
$excluded_paths = $this->getPathsToExclude();
// Exclude the failure file from the commit operation.
$excluded_paths->add(
str_replace($active_dir->absolute() . DIRECTORY_SEPARATOR, '', $this->failureMarker->getPath()),
);
// If an error occurs while dispatching the events, ensure that ::destroy()
// doesn't think we're in the middle of applying the staged changes to the
// active directory.
$event = new PreApplyEvent($this, $excluded_paths);
$event = new PreApplyEvent($this, $this->getPathsToExclude());
$this->tempStore->set(self::TEMPSTORE_APPLY_TIME_KEY, $this->time->getRequestTime());
$this->dispatch($event, $this->setNotApplying(...));
// Exclude the failure file from the commit operation.
$event->excludedPaths->add(
str_replace($active_dir->absolute() . DIRECTORY_SEPARATOR, '', $this->failureMarker->getPath()),
);
// Create a marker file so that we can tell later on if the commit failed.
$this->failureMarker->write($this, $this->getFailureMarkerMessage());
try {
$this->committer->commit($stage_dir, $active_dir, $excluded_paths, NULL, $timeout);
$this->committer->commit($stage_dir, $active_dir, $event->excludedPaths, NULL, $timeout);
}
catch (InvalidArgumentException | PreconditionException $e) {
// The commit operation has not started yet, so we can clear the failure
Loading