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

  1. 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...
  2. #3252190: Store all installable releases in update_calculate_project_update_status()Open a core issue to change update_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
  3. #3264849: Show next minor or current minor updates in Update form

User interface changes

API changes

Data model changes

Command icon 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

tedbow created an issue. See original summary.

tedbow’s picture

Title: Deal with Core UPdate module using the latest release in the major version not the latest in the Minor version » Deal with Core UPdate module recommending the latest release in the major version not the latest in the Minor version
tedbow’s picture

Issue summary: View changes
tedbow’s picture

kunal.sachdev made their first commit to this issue’s fork.

tedbow’s picture

Changes 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

tedbow’s picture

phenaproxima’s picture

Title: Deal with Core UPdate module recommending the latest release in the major version not the latest in the Minor version » Deal with core Update module recommending the latest release in the major version not the latest in the Minor version

Fixing capitalization in the issue title.

tedbow’s picture

Issue tags: +beta blocker
tedbow’s picture

Title: Deal with core Update module recommending the latest release in the major version not the latest in the Minor version » [Meta] Deal with core Update module recommending the latest release in the major version not the latest in the Minor version
Category: Bug report » Plan
Issue summary: View changes
Issue tags: -beta blocker
Related issues: +#3264849: Show next minor or current minor updates in Update form

#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 blocker tag here

tedbow’s picture

Issue tags: +stable blocker
tedbow’s picture

Status: Active » Fixed

Now that #3264849: Show next minor or current minor updates in Update form is fixed we can close out this issue

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.