- πΊπΈUnited States tedbow Ithaca, NY, USA
create π Update Package Manager event documentation in package_manager.api.php Fixed as a child issue so we can tackle a small part of this
- Issue was unassigned.
- Status changed to Postponed
almost 2 years ago 1:38pm 27 January 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Let's avoid conflicting with that issue! π
- Status changed to Active
almost 2 years ago 5:03pm 13 February 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Update Package Manager event documentation in package_manager.api.php Fixed landed, this is now unblocked π
- Assigned to wim leers
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Given #3341469-2: Improve StatusCheckEvent subscriber DX for determining if there is a staged update β , I'll take this on.
- Status changed to Postponed
almost 2 years ago 4:56pm 16 February 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Waiting for π Mark FailureMarker @internal and document ComposerUtility, PathLocator and ValidationResult Fixed to land firstβ¦
- Status changed to Active
almost 2 years ago 4:36am 18 February 2023 - πΊπΈUnited States phenaproxima Massachusetts
Trying to adjust credit given that the patch in #4 makes no actual changes to the documentation.
- Issue was unassigned.
- Status changed to RTBC
almost 2 years ago 2:08pm 20 February 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Mirrored the structure of
core/modules/ckeditor5/ckeditor5.api.php
, the corresponding output of which can be seen at https://api.drupal.org/api/drupal/core%21modules%21ckeditor5%21ckeditor5.... - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Self-review for context
+++ b/package_manager/package_manager.api.php @@ -152,13 +167,16 @@ + * @section sec_validators_excluders API: excluders vs validators & status checks @@ -185,23 +203,32 @@ - * \Drupal\package_manager\Event\StatusCheckEvent - * Dispatched to check the status of the Drupal site and whether Package Manager - * can function properly. These checks can be performed anytime, so this event - * may be dispatched multiple times. ... + * + * Virtually every validator should react not only to + * \Drupal\package_manager\Event\PreCreateEvent and/or + * \Drupal\package_manager\Event\PreApplyEvent but also + * \Drupal\package_manager\Event\StatusCheckEvent. This event is dispatched to + * check the status of the Drupal site and whether Package Manager can function + * properly. + * + * The Package Manager module does not trigger this event because it does not + * have a UI. Modules building on top of Package Manager are likely to dispatch + * this event to prevent the user from starting an operation that would fail. + *
These are arguably the most contentious bits.
See #3341469-7: Improve StatusCheckEvent subscriber DX for determining if there is a staged update β and preceding discussion.
I tried to clarify here what I thought in #3341469-2: Improve StatusCheckEvent subscriber DX for determining if there is a staged update β to be wrong, which @phenaproxima said at #3341469-4: Improve StatusCheckEvent subscriber DX for determining if there is a staged update β to be correct, but then my detailed investigation at #3341469-7: Improve StatusCheckEvent subscriber DX for determining if there is a staged update β showed that it was actually wrong, just in a pretty subtle way.
I tried to make this clear once and for all by documenting it like this β hope y'all like it π
- πΊπΈUnited States phenaproxima Massachusetts
This looks pretty good to me, but I'm not sure I should give the final sign-off. For the simple reason that I'm too close to this code. I've been living and breathing Package Manager for over a year. Almost any explanation of its internals will make sense to me, because my mind will automatically fill in the gaps.
I think I want this to be reviewed by someone with much less familiarity with the internals before I commit it.
- Assigned to tedbow
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Almost any explanation of its internals will make sense to me, because my mind will automatically fill in the gaps.
Looks like I missed my opportunity to get
lorem ipsum
committed as official docs π€£π€£π€£I'm glad that at least you found nothing wrong! π₯³
But if you can't commit it, then only @tedbow can IMHO. Given his role on this project, I think that probably makes sense anyway π
- πΊπΈUnited States phenaproxima Massachusetts
Don't get me wrong: I'm happy to commit it. I did read the diff and the changes made sense.
I merely want a second pair of eyes to review it first, a set of eyes that hasn't had my level of exposure to Package Manager.
- πΊπΈUnited States chrisfromredfin Portland, Maine
Hi all, just chiming in here. I downloaded 3.0.x, applied the patch, and just read package_manager.api.php from top to bottom.
Overall, this absolutely gives me an understanding of how Package Manager works. I had only three things come to mind as I read it:
- Near line 35: The piece about "only using the same class..." seems like an oddity to me, so might need some explanation why (although that documentation may not need to be in .api.php, but rather in a handbook page or something).
- Near line 120: I understand event propagation in the JS world, so stopping propagation in that sense makes sense to me. I don't know how to stop propagation, though (is there a Drupal API call EventSubscriber::stopPropagation() or something?), so pointing more specifically to a code example would be good. Also, if you are expecting a consumer/user of Package Manager to have to do the stopping, this is even more important.
- ...and for the stupid part... lines 160, 170, and 231 go past 80 characters. :)
- Status changed to Needs work
almost 2 years ago 6:51pm 21 February 2023 - πΊπΈUnited States phenaproxima Massachusetts
This is great feedback.
Near line 35: The piece about "only using the same class..." seems like an oddity to me, so might need some explanation why (although that documentation may not need to be in .api.php, but rather in a handbook page or something).
I believe you're referring to:
Only the owner can perform * operations on the stage directory, and only using the same class (i.e., * \Drupal\package_manager\Stage or a subclass) they used to create it.
I can see why this would seem odd, and maybe we can clarify it. What it comes down to is that, for Package Manager, "ownership" consists of two things -- a random token, and the fully qualified name of the Stage that you called create() on. You need both of these things in order to reclaim the stage in subsequent requests and do things to it.
Near line 120: I understand event propagation in the JS world, so stopping propagation in that sense makes sense to me. I don't know how to stop propagation, though (is there a Drupal API call EventSubscriber::stopPropagation() or something?), so pointing more specifically to a code example would be good. Also, if you are expecting a consumer/user of Package Manager to have to do the stopping, this is even more important.
subclass
Yeah, we would expect code that integrates with Package Manager (a custom validator or event subscriber) to stop propagation if they encounter some catastrophic condition that's going to break any further subscribers. Symfony Event objects have a stopPropagation() method we would expect them to call, so let's add a reference to that.
And while we're at it, let's fix the longer-than-80-characters lines. :)
- Assigned to wim leers
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Addressing the feedback, and adding the docs that π Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed should've added.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Also removing the docs that #3344039 should have removed (see #3344039-20: Add a validate() method to ComposerInspector to ensure that Composer is usable β ).
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Now waiting for π Create an API for base requirement validators which run before other validators and stop event propagation if they fail Fixed to land, because that is changing this file too.
- Assigned to phenaproxima
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Adam said he'd take this on! π₯³
- @phenaproxima opened merge request.
- Status changed to Needs review
over 1 year ago 4:14pm 10 March 2023 - πΊπΈUnited States phenaproxima Massachusetts
Went over this from top to bottom and I reorganized and pushed and pulled until I think it's both accurate and comprehensive.
I'd like review from Wim, since he's great at clarity and accuracy...and I'd also like a review from a consumer of Package Manager (that means @bnjmnm or @chrisfromredfin) before we commit.
- Assigned to wim leers
- Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 4:07pm 13 March 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Review posted.
I don't think we need +1s from Package Manager consumers because this clearly is a massive leap forward. Any further improvements can happen at a later time β this is actively blocking the core alpha-experimental MR!
- Assigned to wim leers
- Status changed to Needs review
over 1 year ago 5:58pm 13 March 2023 - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 12:29pm 14 March 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
A huge leap forward, go for launch! π
-
phenaproxima β
committed 07dce485 on 3.0.x
Issue #3318306 by phenaproxima, Wim Leers: Define the Package Manager...
-
phenaproxima β
committed 07dce485 on 3.0.x
- Status changed to Fixed
over 1 year ago 12:38pm 14 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.