Problem/Motivation
Though we improved the core Update module to deal with both core and contrib using semantic versioning and understanding the concept of "supported_branch" in the update XML we never changed behavior of always using the last release in a major version that is supported and secure as the "Recommended version".
This going to be problem for this module because it use the Update "Recommended version" as the version to update to.
For example if:
- the site is on Drupal core 9.5.1
- 9.5.x and 9.6.x are the 2 supported branches of core
- The latest release in each branch is 9.5.2 and 9.6.2
- Then the UPdate module will use 9.6.2 as the "Recommended version"
- This will not be supported by the MVP for this module because this would updating to different minor. We will only support patch updates
Steps to reproduce
currently based on https://updates.drupal.org/release-history/drupal/current
If a site where on 9.1.13 our module would not recommend 9.1.14. It would recommend 9.2.10 but not allow you to update because it is a different minor. You can test by faking the drupal version Drupal.php
Proposed resolution
Ultimately we should fix this in Drupal core. It should have a concept of recommending a version in your current minor and newer minor.
but for now we could change \Drupal\automatic_updates\UpdateRecommender::getRecommendedRelease()
Right now we always use $project['recommended']
but we should check if this is in the same minor version $project['existing_version'] if it isn't the only other thing we can check is $project['security updates'] for a release in the same minor which in the current case would have 9.1.14.
We will need test cases to prove will work in the situation I described.
We can use \Drupal\Core\Extension\ExtensionVersion to determine minor version.
there is $project['releases'] but unfortunately this will only have the recommend and "also available" versions.
Remaining tasks
- Determine if there is already a core issue to recommend released based on supported branches or minor versions instead of major versions. Searching through this core Update issues I follow might be good way to start because I pretty there is an issue and I might have created it. https://www.drupal.org/project/issues/search/drupal?project_issue_follow...
- #3252190: Store all installable releases in update_calculate_project_update_status()
Open a core issue to changeupdate_calculate_project_update_status()to store all releases that are published, secure, supported and in a supported branch into$project_data['releases']. This would at least let other modules like Auto Updates choose the most recent installable release in their minor the current minor - #3264849: Show next minor or current minor updates in Update form
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3252187
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 #2
tedbowComment #3
tedbowComment #4
tedbowcreated the core issue #3252190: Store all installable releases in update_calculate_project_update_status()
Comment #7
tedbowChanges in #3254755: Add a seperate Update recommender and update version validator for cron updates would allow at least getting security updates in the installed minor even if it is not in the latest minor
Comment #8
tedbowComment #9
phenaproximaFixing capitalization in the issue title.
Comment #10
tedbowComment #11
tedbow#3252190: Store all installable releases in update_calculate_project_update_status() which is the beta blocker here is about to be committed 🤞🏽
Added #3264849: Show next minor or current minor updates in Update form as related.
Then this would be fixed.
Removing the
beta blockertag hereComment #12
tedbowComment #13
tedbowNow that #3264849: Show next minor or current minor updates in Update form is fixed we can close out this issue