Problem/Motivation
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3335766
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
Comment #3
omkar.podey commentedComment #4
wim leersLooks like a solid piece of hardening!
Excellent find! 👏
Comment #6
tedbowI am not sure why this is needed. See MR comment
Comment #7
tedbowComment #8
wim leersI'd like to flip the question around: when should you use
stopPropagation()? When a validator encounters an irrecoverable, fundamental problem, right?Currently these stop propagation:
\Drupal\package_manager\Validator\StageNotInActiveValidator\Drupal\package_manager\Validator\ComposerJsonExistsValidator\Drupal\package_manager\Validator\EnvironmentSupportValidator\Drupal\Tests\automatic_updates\Kernel\StatusCheck\StagedProjectsValidatorTest::testEventConsumesExceptionResults())Isn't the lock file not being hashable in
\Drupal\package_manager\Validator\LockFileValidator::storeHash()(which runs duringPreCreateEvent) equally essential? Why should we even create a stage if the lock file cannot be hashed?Same thing for
\Drupal\package_manager\Validator\LockFileValidator::validateStagePreOperation()duringPreRequireEvent.AFAICT #5 further elevates the importance of #3318306: Define the Package Manager API (package_manager.api.php is outdated).
Comment #9
wim leersNote that AFAICT this was done because the
GitExcluderran into this at some point: it looks like this was introduced in response to https://git.drupalcode.org/project/automatic_updates/-/merge_requests/54....But I see that you created #3336243: Update Package Manager event documentation in package_manager.api.php in part to address my general question of why/when one should use
::stopPropagation()! 🤩👍Comment #10
tedbowThanks for the link in #9
I see that https://git.drupalcode.org/project/automatic_updates/-/merge_requests/54...
I don't think the assumption in that comment was never correct.
this was because of previous version of `GitExcluder`(not the version that got committed) was trying to keep state and assumed that if PreCreate was fired there would be a stage directory. That was incorrect there is always the possibility that any validator could add an error and therefore the stage directory could not exist. PreCreate being fired does not mean a stage would exist.
I think
LockFileValidatorwas used an example but it literally could have been any validator.So that original issue never need to do
protected $disableValidators = ['package_manager.git_excluder'];in the first place as far as I can tell it should have been just checking for the existing the stage directory. but it didn't the logic that needed that anyways.
Setting to needs work for either an issue summary explaining why we need this issue at all or to close the issue.
I think in general we should never create an issue with completely empty summary because we have insight into why it is needed.
Well maybe you might want to quickly create an empty issue so you don't forget something but it should not get to Needs Review or RTBC with an empty summary.
Unless it is something like "$var is never used"
Comment #11
tedbowComment #12
omkar.podey commentedI do agree that the assumption in GitExcluder was wrong and yeah the early stop propagation would not allow for better messages +1 closing issue, assigning to @wim.leers for final comment.
Comment #13
wim leersRe-read everything. Sounds good. Especially because https://git.drupalcode.org/project/automatic_updates/-/merge_requests/54... did not end up adding a
protected $disableValidators = […];at all 👍