Skip to content

Conversation

@prafull01
Copy link
Contributor

@prafull01 prafull01 commented Mar 25, 2025

Fixes: #1088

  1. Allow Innovative upgrades to be skipped during upgrade process.
  2. Added e2e tests to for the same.

@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch 2 times, most recently from f8bc57e to 1eb558e Compare March 25, 2025 07:31
@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch 2 times, most recently from 25af9a3 to 0e69032 Compare March 25, 2025 19:55
@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch from 0e69032 to 3cd3910 Compare March 26, 2025 08:41
@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch from e9f8c7c to ca1c124 Compare March 26, 2025 09:32
@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch from ca1c124 to 7764040 Compare March 26, 2025 09:41
@pritesh-lahoti pritesh-lahoti requested a review from Copilot March 26, 2025 12:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enables users to skip innovative upgrades during the upgrade process and adds new end‑to‑end tests along with supporting functions and test cases to validate the behavior.

  • Adds a new e2e test to verify that innovative upgrades can be skipped.
  • Introduces helper functions (getReleaseType, generateReleases, getNextReleases, getPreviousReleases) in the update package for upgrade/rollback logic.
  • Updates both the production code and corresponding tests and internal helper definitions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
e2e/upgrades/upgrades_test.go Adds a new test for skipping innovative upgrades during major version upgrades.
pkg/update/update_cockroach_version_common.go Introduces new functions and modifies upgrade/rollback logic to support skipping innovative releases.
pkg/update/update_cockroach_version_common_test.go Updates and renames tests to match new function names and adds tests for new release functions.
pkg/update/internal.go Adds a new ReleaseType type and related constant definitions.
pkg/update/update_cockroach_version.go Refactors calls to use the new upgrade/rollback functions.
Comments suppressed due to low confidence (2)

pkg/update/update_cockroach_version_common.go:278

  • [nitpick] Consider caching the formatted current version (e.g. using a variable) to avoid recomputing the same string in the loop, which could improve clarity and minor performance.
nextPossibleRelease := getNextReleases(fmt.Sprintf("%d.%d", currentVersion.Major(), currentVersion.Minor()))

pkg/update/update_cockroach_version_common_test.go:115

  • [nitpick] Consider using require.Equal(test.result, isMajorUpgradeAllowed(test.wantVersion, test.currentVersion)) for clearer assertions and more descriptive error messages in tests.
require.True(t, isMajorUpgradeAllowed(test.wantVersion, test.currentVersion) == test.result, "isMajorUpgradeAllowed test failed")

@prafull01 prafull01 force-pushed the allow-skip-innovative-upgrade branch from 7764040 to c677694 Compare March 26, 2025 12:35
@prafull01 prafull01 merged commit 76a4bdb into cockroachdb:master Mar 26, 2025
8 checks passed
@prafull01 prafull01 deleted the allow-skip-innovative-upgrade branch June 18, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Major upgrades do not take Innovative releases into account

2 participants