As part of #2688479: Update update status XML for Drupal 9 and contrib semantic versioning, I’d like to see if we can remove the <version_major>, <version_minor>, <version_patch>, and <version_extra> tags from update status XML. These version number components are redundant with <version>.
packages.drupal.org treats 8.x-1.2 as major = 1, minor = 2. Update status XML omits version_minor and version_patch = 2. To support semantic versioning for contrib, #2681459: Support contrib semver releases, we might want to migrate version_patch → version_minor, so this lines up all the way down.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3085717-11.patch | 83.11 KB | tedbow |
| #11 | interdiff-9-11.txt | 1.91 KB | tedbow |
| #9 | 3085717-9.patch | 83.04 KB | tedbow |
| #9 | interdiff-2-9.txt | 10.62 KB | tedbow |
| #8 | 3085717-8.patch | 83.02 KB | tedbow |
Comments
Comment #2
drummThis simply removes the tags from the test fixtures. Looking at the code, I fully expect this to fail. Let’s see how badly.
Comment #5
dwwIt's been *ages* since I looked at update.module code, but when I first wrote it, it was heavily tied to these separate tags. The fact we only see 6 failures suggests we don't have very thorough test coverage of update.module, not that this isn't that big of a breaking change. ;)
Comment #6
drummAs far as I could tell:
version_major, it is used.version_minoris not used.version_patchandversion_extraare used, but not tested.I think the most productive direction for this issue would be adding testing for the
version_patchandversion_extrabits, and replace using them.For example,
empty($release['version_extra'])could use https://github.com/composer/semver/blob/master/src/VersionParser.php#L51:VersionParser::parseStability($version) === 'stable'(
version_majoris tied up in supported/recommended major versions, so that’s a whole other project for #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates or another related issue.)Comment #7
drummI don’t think I am actively working on this.
Comment #8
tedbowHere is patch that replaces checks for
version_major,version_patch, andversion_extrawith calls to methods on a new value object class\Drupal\update\ProjectInfoIt looks like
version_extrais tested in\Drupal\Tests\update\Functional\UpdateCoreTest::testNormalUpdateAvailable()but we should test also inUpdateContribTestWe should have failing tests for the changes first
Comment #9
tedbowforgot
@groupfor the new testComment #11
tedbowI originally had
getVersionExtra()returning a empty string if none available but changed it to use NULL. I didn't update the tests or the@returntype.Fixing
Comment #12
tedbowI have created #3085717: [PP-1] Do not rely on version_* tags so that we can first create the test coverage that we are missing
I think we should not add the test coverage for existing functionality and change how it is implement in the same issue.
This is similar to where we broke out the missing tests from #2804155: If the next minor version of core has a security release, status still says "Security update required!" even if the site is on an equivalent, secure release already and first did them in their own issue #2990511: Add comprehensive test coverage for update status for security releases
Comment #13
tedbowWe did this in #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates. It now needs a backport to 8.8.x