turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.84k stars 264 forks source link

`steampipe mod update` updates a mod even when dependencies aren't met #3041

Closed johnsmyth closed 1 year ago

johnsmyth commented 1 year ago

Describe the bug steampipe mod update updates a mod even when dependencies aren't met. The command will print an error that the dependency failed to udpate, but the new version is dowloaded and written in the ./.steampipe/mods directory and the previous version is deleted from there.

Steampipe version (steampipe -v) I tested this with steampipe version 0.17.0, but i assume that this behavior exists in other versions as well.

To reproduce

  1. Install a mod
  2. update the mod with a new version that has a dependency on a plugin or steampipe (a dependency that is not met in your test env)
  3. run steampipe mod update
MacBook-Pro:test_depends jsmyth$ steampipe mod list

local
└── github.com/johnsmyth/test_mod_version@v0.1

MacBook-Pro:test_depends jsmyth$ steampipe mod update
Error: 1 dependency failed to update - steampipe version 0.17.0 does not satisfy mod.test_mod_version which requires version 0.18.0

MacBook-Pro:test_depends jsmyth$ steampipe mod list

local

MacBook-Pro:test_depends jsmyth$ cat mod.sp 
mod "local" {
  title = "test_depends"
  require {
    mod "github.com/johnsmyth/test_mod_version" {
      version = "latest"
    }
  }
}

MacBook-Pro:test_depends jsmyth$ ls .steampipe/mods/github.com/johnsmyth/
test_mod_version@v0.2

MacBook-Pro:test_depends jsmyth$ steampipe dashboard
[ Wait    ] Loading Workspace
Error: failed to load workspace: not all dependencies are installed - run 'steampipe mod install'

Expected behavior I would expect that i would receive the error message, but the mod would NOT be updated, and the isntalled version would not be removed

github-actions[bot] commented 1 year ago

'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

kaidaguerre commented 1 year ago

same for install