fermyon / spin

Spin is the open source developer tool for building and running serverless applications powered by WebAssembly.
https://developer.fermyon.com/spin
Apache License 2.0
5.54k stars 258 forks source link

Plugin version number calculation seems off #2946

Open hiteshjasani opened 15 hours ago

hiteshjasani commented 15 hours ago

Describe the bug Doesn't appear to be calculating plugin version number correctly. Believes that 0.10.0 is a downgrade from version 0.9.1.

Frequency of the bug Please check one:

Set-up information

To Reproduce Steps to reproduce the behavior:

  1. Go to directory with previous version of spin in it
  2. curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
  3. Watch messages about installing default templates
  4. See error

Expected behavior I expected spin 3.0 to get installed without errors. I did not expect it to tell me that version 0.9.1 of a plugin is a higher version than 0.10.0 of that same plugin. Seems backward.

Screenshots

Step 1: Downloading: https://github.com/fermyon/spin/releases/d18:44:55 [30/145]
in-v3.0.0-macos-amd64.tar.gz                                                    
Done...                                                                         

Step 2: Decompressing: spin-v3.0.0-macos-amd64.tar.gz                           
x crt.pem                                                                       
x spin.sig                                                                      
x README.md                                                                     
x LICENSE                                                                       
x spin                                                                          
spin 3.0.0 (737778e 2024-11-07)                                                 
Done...                                                                         

Step 3: Removing the downloaded tarball                                         
Done...                                                                         

Step 4: Installing default templates                                            
Copying remote template source                                                  
Installing template redis-rust...                                               
Installing template static-fileserver... 
Installing template http-grain...
Installing template http-php...
Installing template http-c...
Installing template redirect...
Installing template http-rust...
Installing template http-go...
Installing template http-zig...
Installing template http-empty...
Installing template redis-go...
Installed 11 template(s)

+------------------------------------------------------------------------+
| Name                Description                                        |
+========================================================================+
| http-c              HTTP request handler using C and the Zig toolchain |
| http-empty          HTTP application with no components                |
| http-go             HTTP request handler using (Tiny)Go                |
| http-grain          HTTP request handler using Grain                   |
| http-php            HTTP request handler using PHP                     |
| http-rust           HTTP request handler using Rust                    |
| http-zig            HTTP request handler using Zig                     |
| redirect            Redirects a HTTP route                             |
| redis-go            Redis message handler using (Tiny)Go               |
| redis-rust          Redis message handler using Rust                   |
| static-fileserver   Serves static files from an asset directory        |
+------------------------------------------------------------------------+
Copying remote template source
Installing template http-py...
Installed 1 template(s)

+---------------------------------------------+
| Name      Description                       |
+=============================================+
| http-py   HTTP request handler using Python |
+---------------------------------------------+
Copying remote template source
Installing template http-ts...
Installing template redis-ts...
Installing template redis-js...
Installing template http-js...
Installed 4 template(s)

+---------------------------------------------------+
| Name       Description                            |
+===================================================+
| http-js    HTTP request handler using JavaScript  |
| http-ts    HTTP request handler using TypeScript  |
| redis-js   Redis message handler using JavaScript |
| redis-ts   Redis message handler using TypeScript |
+---------------------------------------------------+
Step 5: Installing default plugins
Plugin information updated successfully
Error: Newer version 0.9.1 of plugin 'cloud' is already installed. To downgrade to version 0.10.0, run `spin plugins upgrade` with the `--downgrade` flag.

Additional context

After following the suggestion to 'downgrade' from 0.9.1 to 0.10.0, it did work. But the version calculation seems off.

./spin plugins upgrade --downgrade cloud             
You are trying to install the `cloud` plugin with Apache-2.0 license from https:
//github.com/fermyon/cloud-plugin/releases/download/v0.10.0/cloud-v0.10.0-macos-
amd64.tar.gz                                                                    
Are you sure you want to continue? yes                                          
Plugin 'cloud' was installed successfully!                                      

Description:                                                                    
        Commands for publishing applications to the Fermyon Cloud.              

Homepage:                                                                       
        https://github.com/fermyon/cloud-plugin
itowlson commented 14 hours ago

Yikes, thanks for flagging this. I'll move the issue to the Spin repo and take a look!