Skip to content

Commit

Permalink
Merge pull request #1183 from Quetzacoalt91/channel-xml-is-source-of-…
Browse files Browse the repository at this point in the history
…truth

Make sure to not update to patch versions if they are not in channel.xml file
  • Loading branch information
Quetzacoalt91 authored Feb 20, 2025
2 parents 229614f + 0d0f9cb commit 3e74597
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Services/PhpVersionResolverService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getPrestashopDestinationRelease(int $currentPhpVersionId): ?Pres
if ($currentPhpVersion >= $versionMinWithoutPatch && $currentPhpVersion <= $versionMaxWithoutPatch) {
// verify channel.xml matching
$branch = VersionUtils::splitPrestaShopVersion($release->getVersion())['minor'];
if (isset($releasesFromChannelFile[$branch])) {
if (isset($releasesFromChannelFile[$branch]) && version_compare($releasesFromChannelFile[$branch]->getVersion(), $release->getVersion(), '>=')) {
$releaseNote = $releasesFromChannelFile[$branch]->getReleaseNoteUrl();
$release->setReleaseNoteUrl($releaseNote);
$validReleases[] = $release;
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/Services/PhpVersionResolverServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ public function testGetPrestashopDestinationReleaseWithNoMatchingChannelXml()
'8.1',
'7.2.5'
),
new PrestashopRelease(
'8.1.9',
'stable',
'8.1',
'7.2.5'
),
new PrestashopRelease(
'8.2.1',
'stable',
'8.1',
'7.2.5'
),
new PrestashopRelease(
'9.0.0',
'stable',
Expand Down

0 comments on commit 3e74597

Please sign in to comment.