Skip to content

Tell the installer API whether this is a fresh install or an upgrade - #15259

Open
schacon wants to merge 1 commit into
masterfrom
installer-fresh-vs-upgrade
Open

Tell the installer API whether this is a fresh install or an upgrade#15259
schacon wants to merge 1 commit into
masterfrom
installer-fresh-vs-upgrade

Conversation

@schacon

@schacon schacon commented Aug 10, 2026

Copy link
Copy Markdown
Member

The installer already discovers an existing install, but only after the binary
has been downloaded -- by which point the API has answered, so the server can
never distinguish the two. Every request to /installers/info looks identical
whether someone is installing for the first time or re-running the script to
update.

Detecting it before the request makes it countable: ?from=none for a fresh
install, ?from= for an upgrade, ?from=unknown when a binary is present
but its version cannot be parsed.

Only a version number is sent -- no path, hostname, or anything about the
machine -- and it is parsed down to digits and dots, so whatever the local
binary prints cannot inject into the URL. The match is anchored at the start of
the string because a leading .* matches greedily and would leave only the final
digit behind.

The installer already discovers an existing install, but only after the binary
has been downloaded -- by which point the API has answered, so the server can
never distinguish the two. Every request to /installers/info looks identical
whether someone is installing for the first time or re-running the script to
update.

Detecting it before the request makes it countable: ?from=none for a fresh
install, ?from=<version> for an upgrade, ?from=unknown when a binary is present
but its version cannot be parsed.

Only a version number is sent -- no path, hostname, or anything about the
machine -- and it is parsed down to digits and dots, so whatever the local
binary prints cannot inject into the URL. The match is anchored at the start of
the string because a leading .* matches greedily and would leave only the final
digit behind.
Copilot AI lite review requested due to automatic review settings August 10, 2026 11:59
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the scripts/install.sh bootstrapper to report whether it’s running as a first-time install or as an upgrade, enabling the installer API endpoint to distinguish and count these cases before the binary download occurs.

Changes:

  • Detects an existing but installation and derives a safe from value (none, <version>, or unknown).
  • Appends ?from=$EXISTING_VERSION to the /installers/info/... API request to pass that context to the server.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants