Skip to content

fix(upgrade): skip version comparison when upgrading #29112

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Apr 30, 2025

In Deno 2.3.0, the version was accidentally released as 2.4.0. This was fixed in 2.3.1. Now anyone who upgraded to 2.3.0 can't run deno upgrade to upgrade to 2.3.1 because of this upgrade behaviour. It would be better to just always go to the latest remote specified version when someone runs deno upgrade.

This also fixes a bug outlined in #29016

Closes #29016

@dsherret dsherret requested a review from Copilot April 30, 2025 14:07
Copy link

@Copilot 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 PR fixes the version upgrade logic by skipping semantic version comparisons and instead relying on simple string equality and a release channel check.

  • Removed semver parsing and comparison for non-Canary channels
  • Simplified the upgrade condition logic using a boolean flag (should_upgrade)
Comments suppressed due to low confidence (1)

cli/tools/upgrade.rs:760

  • The removal of semantic version parsing and comparison for Stable, Lts, and Rc channels now relies solely on string equality and a release channel check, which may lead to upgrades even when the current version is semantically newer if formatting differs. Please verify that this behavior is intended for all upgrade scenarios.
version::DENO_VERSION_INFO.deno

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, let's do it

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

+1 on doing this

Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

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

LGTM

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.

deno upgrade from rc to canary doesn't work when both versions the same
4 participants