Skip to content
Snippets Groups Projects

Issue #3254616: Update Composer Stager to 0.3.0

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ted Bowman
  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    • 620b3a2b - Rewrite ExcludedPathsSubscriber

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    • 5306b1d8 - Rewrite ExcludedPathsSubscriber

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit
  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H resolved all threads

    resolved all threads

  • Ted Bowman
  • Ted Bowman
    Ted Bowman @tedbow started a thread on the diff
  • 77 79 *
    78 * @param \Drupal\package_manager\Event\PreApplyEvent $event
    80 * This should only be used for paths that, if they exist at all, are
    81 * *guaranteed* to exist within the web root.
    82 *
    83 * @param \Drupal\package_manager\Event\PreCreateEvent|\Drupal\package_manager\Event\PreApplyEvent $event
    79 84 * The event object.
    85 * @param string[] $paths
    86 * The paths to exclude. These should be relative to the web root, and will
    87 * be made relative to the project root.
    80 88 */
    81 public function preApply(PreApplyEvent $event): void {
    82 // Don't copy anything from the staging area's sites/default.
    83 // @todo Make this a lot smarter in https://www.drupal.org/i/3228955.
    84 $event->excludePath('sites/default');
    89 protected function excludeInWebRoot(StageEvent $event, array $paths): void {
    • Would this method be better in ExcludedPathsTrait so every subscriber didn't have to figure this out?

      Oh I guess then we would need the path locator service available. so maybe better where it is ?

    • Author Maintainer

      Yeah, that's what I thought. If we moved it to ExcludedPathsTrait, we'd need to at least pass the web root and project root to the event classes, which would make constructing them more complicated. IMHO, we can refactor in a follow-up if we want to.

    • I wonder if it would make sense to add Stage::getPathLocator()

      I think this would make a lot of the subscribers simpler because they could do $event->getStage()->getPathLocator()->getWebRoot() and the these methods could be moved to ExcludedPathsTrait

      also this would eliminate the potential problem(though edge case) of some custom module altering a service of a class that extends Stage, like automatic_updates.updater, and providing a different service, say my_module.custom_path_locator that extends PathLocator instead of package_manager.path_locator. Currently if any module did that all of our subscribers would be still be using package_manager.path_locator not my_module.custom_path_locator. So subscribers and stage would using different path locators which could be very bad.

      If we added Stage::getPathLocator() all validators could be guaranteed to get the same path locator as the stage itself is using.

    • Please register or sign in to reply
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading