- Issue created by @wim leers
- Assigned to phenaproxima
- ðšðļUnited States phenaproxima Massachusetts
Wim Leers â credited phenaproxima â .
- ðšðļUnited States tedbow Ithaca, NY, USA
Wim Leers â credited tedbow â .
- Issue was unassigned.
- ðšðļUnited States tedbow Ithaca, NY, USA
A new subscriber that listens to PreRequireEvent to log which package changes were requested
I don't there should be any logging until PostApply. Update until point we don't know if these change will be actually be applied to the site. The operations may be canceled or not validate on Pre-Apply. We can subscribe to PreRequire and keep a record of what was request to compare against what the final packages that are changed..
I think it would confusing to have the PreRequireEvent logging package changes that never actually get applied to the site.
Create a follow-up for a Drush command that makes it easy to inspect the audit log, based on what we learn here along the way
I think this follow-up should the priority of "minor" because this won't be part of the core module. So anything we can do for the core module should be be a higher priority. We could file core issue to provide a
drupal log
command. Could have a channel option so we could dodrupal log -channel=package_manager_audit_log
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
We can subscribe to PreRequire and keep a record of what was request to compare against what the final packages that are changed..
ð
I think it would confusing to have the PreRequireEvent logging package changes that never actually get applied to the site.
ðŊ
I think this follow-up should the priority of "minor"
Sure. But âĶ it will be critical for adoption/support by hosting companies, because this would make their job of supporting customers actually manageable.
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
This would also really help with debugging/writing the Build test over at ð [PP-1] Implement experimental cron updates for contrib in automatic_updates_extensions Postponed .
- Assigned to kunal.sachdev
- Open on Drupal.org âCore: 10.1.x + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Not currently mergeable. - @kunalsachdev opened merge request.
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 767 pass - last update
over 1 year ago 786 pass - last update
over 1 year ago 348 pass, 105 fail - last update
over 1 year ago 486 pass, 61 fail - Assigned to wim leers
- Status changed to Needs review
over 1 year ago 8:17am 11 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 9:41am 11 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
This is on the right track!
High-level next steps:
- I think the current MR is interpreting the issue summary a bit too literally, which is why it currently only works for
UpdateStage
instances and not allStageBase
instances. Explained on the MR how that can be supported ð
$this->auditLogger = new TestLogger(); $this->container->get('logger.channel.package_manager_audit_log') ->addLogger($this->auditLogger);
- Nope, that can't work, because none of the
Kernel
tests execute a whole stage life cycle ð - Attempt #2! As for how to adopt this and start using it in tests:
\Drupal\Tests\package_manager\Build\TemplateProjectTestBase::assertExpectedStageEventsFired()
provides an example! That is using the test-onlypackage_manager_test_event_logger
(which is still valuable on its own). This MR needs to add aTemplateProjectTestBase::assertPackageManagerAuditLog()
method with logic modeled after::assertExpectedStageEventsFired()
. - 100% of build tests should be updated to use it â that means 5 classes should gain a
::assertPackageManagerAuditLog()
all the way at the end.
- I think the current MR is interpreting the issue summary a bit too literally, which is why it currently only works for
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
#16 helped me discover the need for ð Document that validators comparing state between stage life cycle operations must store that state out-of-band, not on the object Closed: outdated ðð
- last update
over 1 year ago 486 pass, 61 fail - last update
over 1 year ago 348 pass, 105 fail - ðŪðģIndia kunal.sachdev
Some of the failures are because of the exception
Typed property Drupal\package_manager\EventSubscriber\ChangeLogSubscriber::$installedPackagesBeforeApply must not be accessed before initialization
during post-apply as I am accessing it in\Drupal\package_manager\EventSubscriber\logAppliedChanges
. But it is getting set in\Drupal\package_manager\EventSubscriber\recordInstalledPackagesBeforeApply
which runs on pre-create which definitely runs before post-apply and we shouldnât get this error. But I think the error is because the post-apply is running on different request and it can't access that property. And actually this property is also accessed in\Drupal\package_manager\EventSubscriber\logRequestedChanges
which runs on post-require and it works fine. - last update
over 1 year ago 358 pass, 99 fail - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 1:59pm 15 May 2023 - Assigned to omkar.podey
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 9:56am 16 May 2023 - ðŪðģIndia omkar.podey
Two nits, otherwise looks good, nice workâïļ
- last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - Status changed to Needs review
over 1 year ago 10:59am 16 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 12:09pm 16 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
Looking great! ð ð
I requested some changes (pun intended ð) to help improve test code clarity. But this is definitely close to being done!
Credited @omkar.podey for the review.
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:13am 17 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 9:10am 17 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
I found more room for simplification!
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:42pm 17 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 8:52am 19 May 2023 - last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:13pm 19 May 2023 - last update
over 1 year ago 788 pass - Status changed to RTBC
over 1 year ago 9:31am 22 May 2023 - Status changed to Needs work
over 1 year ago 8:33pm 22 May 2023 - ðšðļUnited States phenaproxima Massachusetts
I really like the idea here, but I think some clean-up is warranted.
- last update
over 1 year ago 778 pass, 4 fail - Assigned to kunal.sachdev
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
Nice catches from @phenaproxima. Found a few new inconsistencies now â see the MR.
- last update
over 1 year ago 778 pass, 4 fail - last update
over 1 year ago 778 pass, 4 fail - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:59pm 23 May 2023 - ðŪðģIndia kunal.sachdev
The build tests are failing because of ð Since #3361983 was committed to Drupal core, psr/http-message needed to be explicitly required for build tests Needs work
- Status changed to RTBC
over 1 year ago 3:07pm 23 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
Once tests are passing again (after ð Since #3361983 was committed to Drupal core, psr/http-message needed to be explicitly required for build tests Needs work lands), this can be committed ð
54:02 40:17 Running- Assigned to tedbow
- ðšðļUnited States tedbow Ithaca, NY, USA
I would like to review and commit this. Will be great to get this in!
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 5:36pm 23 May 2023 - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 5:54pm 23 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
ð See MR comment: https://git.drupalcode.org/project/automatic_updates/-/merge_requests/86...
- Issue was unassigned.
- ðšðļUnited States tedbow Ithaca, NY, USA
Unassigning from myself since I responded to @Wim Leers' points.
I don't think we should expand this issue any further and don't think the current log messages give enough context to the user reading the logs to understand that the "required" changes may or may not actually related to changes that made to the active site(see my MR comments). I think we would need to expand this issue a lot to make including the messages from updates that did not succeed or were canceled to be understandable by people were not involved in developing this module.
for that reason I think in this issue we should only every add a long message in PostApply. We can use information we gathered from subscribe to the other events but we should not log anything in those other events.
That will fulfill the primary purpose of the of the issue which is let the admin know what projects have been changed by Package Manager.
I updated the title to match this
- Status changed to Needs work
over 1 year ago 3:23am 24 May 2023 - Assigned to kunal.sachdev
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 792 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:29pm 24 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 12:33pm 24 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
think we would need to expand this issue a lot to make including the messages from updates that did not succeed or were canceled to be understandable by people were not involved in developing this module.
Fair!
That will fulfill the primary purpose of the of the issue which is let the admin know what projects have been changed by Package Manager.
WFM
Found some problems during re-reviewing.
- last update
over 1 year ago 792 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 2:31pm 24 May 2023 - Status changed to Needs work
over 1 year ago 3:01pm 24 May 2023 - ðšðļUnited States phenaproxima Massachusetts
I think we still have some clarifying to do here, and I'm wondering if we can't make the whole thing slightly simpler.
- Assigned to kunal.sachdev
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
For @phenaproxima's feedback.
- last update
over 1 year ago 792 pass - last update
over 1 year ago 792 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:40am 25 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 1:24pm 25 May 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
One last piece of feedback.
P.S.: Those new commit messages are WAY better! ð
- last update
over 1 year ago 792 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 2:48pm 25 May 2023 - Assigned to phenaproxima
- Status changed to RTBC
over 1 year ago 2:51pm 25 May 2023 - Assigned to kunal.sachdev
- Status changed to Needs work
over 1 year ago 7:25am 26 May 2023 - last update
over 1 year ago 174 pass, 176 fail - last update
over 1 year ago 348 pass, 107 fail - last update
over 1 year ago 792 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:58am 26 May 2023 - Assigned to phenaproxima
- ðšðļUnited States tedbow Ithaca, NY, USA
I wondering if this would be easier to test in a kernel.
We can use our fixture manipulators to fake which versions get updated.
The reason I was wondering is because right now we don't test that nothing gets logged if the process is stopped in preapply or before. maybe we don't need to test this but it would be pretty easy in kernel test but very hard in a build test. Maybe we could that in follow-up
@phenaproxima had mentioned in wanted to review before I committed so assigning him.
- last update
over 1 year ago 794 pass - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
The reason I was wondering is because right now we don't test that nothing gets logged if the process is stopped in preapply or before
If this were critical logic, I'd get it. But it's just logging.
maybe we don't need to test this but [âĶ]
I don't think we need to test this.
The complexity of testing would far outweigh the complexity of the logging. Plus, a bug in the logging cannot even break the functionality itself. Hence no tests for edge cases necessary, only for The Happy Path.
- last update
over 1 year ago 800 pass - ðšðļUnited States phenaproxima Massachusetts
Crediting @wendyZ for ð [DrupalCon] Automatic Updates alpha test result Fixed .
- ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
To clarify #55: @wendyZ specifically requested this behavior; they were surprised it did not already happen, thus confirming the need for this functionality â here's what they wrote:
But the whole update process was not logged at all. By looking at the log report, it only shows the 2 auto_updates modules are installed. It should also log the core was upgraded from which version to version.
- last update
over 1 year ago 797 pass, 4 fail - last update
over 1 year ago 797 pass, 4 fail - Status changed to Needs work
over 1 year ago 1:37pm 13 June 2023 - ðšðļUnited States phenaproxima Massachusetts
There are some core things here that I don't think I'm understanding.
- last update
over 1 year ago 798 pass, 2 fail - last update
over 1 year ago 800 pass - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 800 pass - last update
over 1 year ago 791 pass, 6 fail - last update
over 1 year ago 791 pass, 6 fail - last update
over 1 year ago 800 pass - last update
over 1 year ago 790 pass, 8 fail - last update
over 1 year ago 800 pass - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 8:39pm 13 June 2023 - last update
over 1 year ago 800 pass - last update
over 1 year ago 800 pass - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 800 pass - Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 2:22pm 14 June 2023 - ðšðļUnited States tedbow Ithaca, NY, USA
Looking good!
A few points in the MR
- last update
over 1 year ago 801 pass - last update
over 1 year ago 802 pass - last update
over 1 year ago 802 pass - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 5:41pm 14 June 2023 - last update
over 1 year ago 802 pass - Assigned to phenaproxima
- Status changed to RTBC
over 1 year ago 6:03pm 14 June 2023 - last update
over 1 year ago 802 pass - ðšðļUnited States tedbow Ithaca, NY, USA
ðĪĢI didn't mean to RTBC it before but now it looks done!
thanks everyone!
- last update
over 1 year ago 802 pass -
phenaproxima â
committed 4ced6730 on 3.0.x authored by
kunal.sachdev â
Issue #3355628 by kunal.sachdev, phenaproxima, Wim Leers, tedbow, omkar....
-
phenaproxima â
committed 4ced6730 on 3.0.x authored by
kunal.sachdev â
- Status changed to Fixed
over 1 year ago 6:41pm 14 June 2023 - Status changed to Needs work
over 1 year ago 7:10pm 14 June 2023 - ðšðļUnited States tedbow Ithaca, NY, USA
uggh. we have phpstan error only in 10.0.x for some reason https://www.drupal.org/pift-ci-job/2692141 â
The error is real not sure why phpstan didn't catch it
- Open on Drupal.org âCore: 10.1.x + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Not currently mergeable. - @tedbow opened merge request.
- last update
over 1 year ago 802 pass - last update
over 1 year ago 802 pass -
phenaproxima â
committed cb221304 on 3.0.x
Issue #3355628 follow-up by tedbow, phenaproxima: Fix incorrect type...
-
phenaproxima â
committed cb221304 on 3.0.x
- Status changed to Fixed
over 1 year ago 1:56am 15 June 2023 - ð§ðŠBelgium wim leers Ghent ð§ðŠðŠðš
// The first record should be of the requested changes. $expected_message = <<<END Requested changes: - Update drupal/core-recommended from 9.8.0 to ^9.8.1 - Install drupal/semver_test * (any version) END; $this->assertSame($expected_message, (string) $records[0]['message']); // The second record should be of the actual changes. $expected_message = <<<END Applied changes: - Updated drupal/core from 9.8.0 to 9.8.1 - Updated drupal/core-dev from 9.8.0 to 9.8.1 - Updated drupal/core-recommended from 9.8.0 to 9.8.1 - Installed drupal/semver_test 8.1.1 - Uninstalled package/removed END; $this->assertSame($expected_message, (string) $records[1]['message']);
ðĪĐ
Automatically closed - issue fixed for 2 weeks with no activity.