Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get next version instead of bumping it #100

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ generate_upgrade_notes() {
output " ${R}Error running npm ci. Details:${N} $(<"${tmpfile}")"
output " - Generating upgrade notes"

local release=`php ${mydir}/bumpversions.php -b "$branch" -t "$type" -p "$pwd" -r "$rc" -d "$date" -i "$isdevbranch"`
local release=`php ${mydir}/get_next_version_number.php -b "$branch" -t "$type" -p "$pwd" -r "$rc" -d "$date" -i "$isdevbranch"`

if [ $type == "major" ] || [ $type == "minor" ]; then
.grunt/upgradenotes.mjs release -d "${release}" > "${tmpfile}" 2>&1 || \
Expand Down
57 changes: 57 additions & 0 deletions tests/unit/VersionInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class VersionInfoTest extends TestCase
#[DataProvider('nextVersionFromWeeklyProvider')]
#[DataProvider('nextVersionFromDevelopmentProvider')]
#[DataProvider('nextVersionFromBetaProvider')]
#[DataProvider('nextVersionFromRCProvider')]
public function testGetNextVersion(
array $currentVersionArgs,
array $nextVersionArgs,
Expand Down Expand Up @@ -545,6 +546,62 @@ public static function nextVersionFromBetaProvider(): array
];
}

public static function nextVersionFromRCProvider(): array
{
$version = [
'integerversion' => 2024092301,
'decimalversion' => 0,
'comment' => '// 20240923 = branching date YYYYMMDD - do not modify!',
'release' => '5.0rc1',
'build' => '20240921',
'branch' => '500',
'maturity' => 'MATURITY_RC',
'branchquote' => "'",
'releasequote' => "'",
];

return [
'RC version from RC' => [
$version,
[
'branch' => 'MOODLE_500_STABLE',
'type' => 'rc',
'rc' => '2',
'date' => '20240923',
'isdevbranch' => true,
],
[
'integerversion' => date('Ymd') * 100,
'decimalversion' => '00',
'release' => '5.0rc2',
'build' => '20240923',
'branchquote' => "'",
'releasequote' => "'",
'maturity' => 'MATURITY_RC',
],
],
'Major version from RC' => [
$version,
[
'branch' => 'MOODLE_500_STABLE',
'type' => 'major',
'rc' => '',
'date' => '20240923',
'isdevbranch' => true,
],
[
'integerversion' => 2024092300,
'decimalversion' => '00',
'release' => '5.0',
'build' => '20240923',
'branchquote' => "'",
'releasequote' => "'",
'maturity' => 'MATURITY_STABLE',
],
],
];
}

#[DataProvider('invalidNextVersionMigrationsProvider')]
public function testGetNextVersionInvalidTransition(
array $currentVersionArgs,
Expand Down