- Issue was unassigned.
- Status changed to Active
over 1 year ago 12:43pm 6 April 2023 - πΊπΈUnited States tedbow Ithaca, NY, USA
I noticed that 10.0.8 to 10.0.9 actually has a change to hook_requirements that would flag has a DB update when it is not
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- πΊπΈUnited States fizcs3 Omaha, Nebraska; USA
tedbow β credited FizCS3 β .
- πΊπΈUnited States tedbow Ithaca, NY, USA
crediting @FizCS3 for finding in testing
- πΊπΈUnited States phenaproxima Massachusetts
I dug into this a bit and I think it actually wouldn't be too tricky.
It would require us to create a node visitor (as documented) that detects functions in certain files, matching certain naming patterns, and simply compares the lists of found functions. Obviously this would only be done if nikic/php-parser were installed; otherwise, we'd fall back to hashing.
But generally I think this would be relatively simple.
- Open on Drupal.org βCore: 10.1.x + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Not currently mergeable. - @phenaproxima opened merge request.
- last update
over 1 year ago 790 pass, 7 fail - last update
over 1 year ago 798 pass, 2 fail - Status changed to Needs work
over 1 year ago 8:08pm 21 June 2023 - last update
over 1 year ago 813 pass - last update
over 1 year ago 813 pass - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 8:24pm 21 June 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@phenaproxima mentioned
token_get_all()
. It looks REALLY promising: https://3v4l.org/SX0rTAny sequence like this:
T_FUNCTION T_WHITESPACE T_STRING
we'd need the value of
T_STRING
for, and β¦ we'd have a complete list! π₯³ - last update
over 1 year ago 790 pass, 6 fail - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 799 pass, 5 fail - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 807 pass, 1 fail - last update
over 1 year ago 808 pass - last update
over 1 year ago 808 pass - 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 808 pass - last update
over 1 year ago 808 pass - Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 6:41pm 22 June 2023 - last update
over 1 year ago 790 pass, 7 fail - last update
over 1 year ago 808 pass - last update
over 1 year ago CI aborted - last update
over 1 year ago 790 pass, 6 fail - last update
over 1 year ago CI aborted - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 8:24pm 22 June 2023 - last update
over 1 year ago 808 pass - last update
over 1 year ago 808 pass - Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 2:53pm 23 June 2023 - last update
over 1 year ago 808 pass - last update
over 1 year ago CI aborted - last update
over 1 year ago 808 pass - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 3:21pm 23 June 2023 - last update
over 1 year ago 808 pass - Assigned to phenaproxima
- Status changed to Needs work
over 1 year ago 3:41pm 23 June 2023 - last update
over 1 year ago 808 pass - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 4:40pm 23 June 2023 - last update
over 1 year ago 808 pass - last update
over 1 year ago 808 pass - last update
over 1 year ago 808 pass - πΊπΈUnited States phenaproxima Massachusetts
For manual testing:
Drupal 10.0.1 changed some code in system.install, compared to 10.0.0. (The code in question is part of hook_requirements.) No update functions were added that I can see. So this is a perfect pairing of versions to prove that this static analysis is smarter than what we previously had.
- πΊπΈUnited States phenaproxima Massachusetts
To manually test the status quo, I did the following:
composer create-project drupal/recommended-project:10.0.0 au cd au composer config minimum-stability alpha composer require drush/drush:^11 composer require drupal/automatic_updates:^3 ./vendor/bin/drush si -y ./vendor/bin/drush en -y automatic_updates ./vendor/bin/drush cset -y automatic_updates.settings unattended.level patch ./vendor/bin/drush auto-update
As expected, this died with the error:
[error] The update cannot proceed because possible database updates have been detected in the following extensions. System User
- πΊπΈUnited States phenaproxima Massachusetts
composer create-project drupal/recommended-project:10.0.0 au cd au composer config minimum-stability alpha composer require drush/drush:^11 composer config repo.au vcs https://git.drupalcode.org/issue/automatic_updates-3253828.git composer require drupal/automatic_updates:dev-3253828-use-static-analysis ./vendor/bin/drush si -y ./vendor/bin/drush -y en automatic_updates ./vendor/bin/drush cset -y automatic_updates.settings unattended.level patch ./vendor/bin/drush auto-update
This time, it died with the following:
[error] The update cannot proceed because possible database updates have been detected in the following extensions. User
However, this makes perfect sense: running
git diff 10.0.0:core/modules/user/user.post_update.php 10.0.9:core/modules/user/user.post_update.php
shows me that post-update functions were added to the User module!This is already a lot more promising.
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 5:49pm 23 June 2023 - last update
over 1 year ago 803 pass, 2 fail - last update
over 1 year ago 803 pass, 2 fail - last update
over 1 year ago 803 pass, 2 fail - last update
over 1 year ago 805 pass, 1 fail - last update
over 1 year ago 805 pass, 1 fail - last update
over 1 year ago 808 pass - last update
over 1 year ago 808 pass -
phenaproxima β
committed 8db8ae3a on 3.0.x
Issue #3253828 by phenaproxima, tedbow, Wim Leers, FizCS3, effulgentsia...
-
phenaproxima β
committed 8db8ae3a on 3.0.x
- Status changed to Fixed
over 1 year ago 9:48pm 23 June 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
That looks amazing! π€©
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I am a bit curious if this is sufficiently fast for large codebases, but considering how little code is typically in
*.install
and*.post_update.php
files, I'm not very concerned. Still, this might come back to haunt us at some point in the future in some extreme cases⦠Automatically closed - issue fixed for 2 weeks with no activity.