Skip to content

Fix misleading Community Build upgrade error message#3426

Open
mishaTsukini wants to merge 1 commit intoSonarSource:masterfrom
mishaTsukini:fix/community-build-min-upgrade-version-message
Open

Fix misleading Community Build upgrade error message#3426
mishaTsukini wants to merge 1 commit intoSonarSource:masterfrom
mishaTsukini:fix/community-build-min-upgrade-version-message

Conversation

@mishaTsukini
Copy link
Copy Markdown

Summary

  • MIN_UPGRADE_VERSION is set to 2026_01_000 (the first migration of version 26.1)
  • However, MIN_UPGRADE_VERSION_COMMUNITY_BUILD_READABLE was set to "25.12"
  • This causes users upgrading from 25.12 to see: "Please upgrade to the 25.12 version first" — even though they are already on 25.12
  • The fix changes the readable constant to "26.1" to match the actual numeric requirement

Context

When upgrading SonarQube Community Build from 25.12 (last migration 2025_06_026 = 202506026) to any version >= 26.3 (which requires MIN_UPGRADE_VERSION = 2026_01_000 = 202601000), the error message tells the user to upgrade to 25.12 first. This is confusing and incorrect — the user needs to upgrade to 26.1 first so that migration 2026_01_000 gets applied.

The Server Edition message (MIN_UPGRADE_VERSION_HUMAN_READABLE = "2026.1") is already correct. Only the Community Build message was wrong.

How to reproduce

  1. Set up SonarQube Community Build 25.12 with a fully migrated database (max schema_migrations = 202506026)
  2. Attempt to start SonarQube 26.4 against the same database
  3. Observe error: "Please upgrade to the 25.12 version first"
  4. Expected: "Please upgrade to the 26.1 version first"

Test plan

  • Updated DatabaseServerCompatibilityTest.fail_if_requires_firstly_to_upgrade_to_26_1 to verify the corrected message

MIN_UPGRADE_VERSION is set to 2026_01_000 (first migration of 26.1),
but MIN_UPGRADE_VERSION_COMMUNITY_BUILD_READABLE incorrectly states
"25.12". This causes users upgrading from 25.12 to see "Please upgrade
to the 25.12 version first" — even though they are already on 25.12.

The actual requirement is 26.1 (migration 2026_01_000), so the
human-readable constant should reflect that.
@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha bot commented Apr 17, 2026

Summary

This PR corrects a constant mismatch in Community Build upgrade validation. The MIN_UPGRADE_VERSION numeric value requires version 26.1 (migration 2026_01_000), but the user-facing message constant was set to "25.12", causing users already on 25.12 to see a confusing error telling them to upgrade to 25.12 first.

The fix changes MIN_UPGRADE_VERSION_COMMUNITY_BUILD_READABLE from "25.12" to "26.1" to match the actual requirement, and updates the corresponding test to verify the corrected message.

What reviewers should know

Validation points:

  • The numeric constant MIN_UPGRADE_VERSION = 2026_01_000 (unchanged) represents the database schema version required
  • The readable constant now aligns with this requirement (26.1 is the version that applies this migration)
  • Compare this to MIN_UPGRADE_VERSION_HUMAN_READABLE = "2026.1" in the same file—it matches exactly
  • Test name and expected message both updated consistently

Where to look:

  • DatabaseVersion.java line 38: the single constant fix
  • DatabaseServerCompatibilityTest.java lines 72 and 79: the test that validates Community Build error messages

  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

Clean, minimal fix. The constant change is correct and the test verifies the full message string end-to-end.

🗣️ Give feedback

Comment on lines 36 to 37
// In reality user is required to upgrade just to 10.8 but we want to 'market' 2025.1
public static final String MIN_UPGRADE_VERSION_HUMAN_READABLE = "2026.1";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The comment on line 36 (// In reality user is required to upgrade just to 10.8 but we want to 'market' 2025.1) is stale — it refers to version numbers unrelated to the current constants (26.1 / 2026.1). This PR touches these lines, so it's a good opportunity to update or remove it.

Suggested change
// In reality user is required to upgrade just to 10.8 but we want to 'market' 2025.1
public static final String MIN_UPGRADE_VERSION_HUMAN_READABLE = "2026.1";
public static final String MIN_UPGRADE_VERSION_HUMAN_READABLE = "2026.1";
public static final String MIN_UPGRADE_VERSION_COMMUNITY_BUILD_READABLE = "26.1";
  • Mark as noise

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.

1 participant