Create StageBase::stageDirectoryExists() for improved DX to see if stage directory exists.

Created on 14 February 2023, over 1 year ago
Updated 19 April 2023, about 1 year ago

Problem/Motivation

It was missed in ๐Ÿ“Œ Reliably support cweagans/composer-patches in Package Manager & Automatic Updates: validate stage Fixed that a status check could be dispatched when we already have a staged update. I also missed this ๐Ÿ“Œ Limit trusted Composer plugins to a known list, allow user to add more Fixed

Right now if subscribe to PreApplyEvent, StatusCheckEvent, PreCreateEvent which is common for our validators I think you have to do this to determine if there's a staged update or just if there's a stage directory.

if ($event instanceof StatusCheckEvent) {
      try {
        $event->getStage()->getStageDirectory();
        $has_staged_update = TRUE;
      }
      catch (\LogicException $e) {
        $has_staged_update = FALSE;
      }
    }
    else {
      $has_staged_update = $event instanceof PreApplyEvent;
    }

Proposed resolution

I couple ways we could solve this

  1. Add StageBase::stageDirectoryExists()

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024