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

Mod installed version is not reported correctly in `.mod.cache.json` file #2429

Closed vhadianto closed 1 year ago

vhadianto commented 2 years ago

Describe the bug Mod installed version is not reported correctly in .mod.cache.json file.

For example: installed version 0.1.6 and .mod.cache.json file reports version 0.1.0. I suspect it's only reporting the minor without the patches.

Steampipe version (steampipe -v) Example: v0.16.1

To reproduce Steps to reproduce the behavior (please include relevant code and/or commands).

  1. steampipe mod install github.com/judell/github-activity@v0.1.5
  2. inspect .mod.cache.json
     cat .mod.cache.json 
       "github.com/judell/github-activity": {
      "name": "github.com/judell/github-activity",
      "alias": "github_activity",
      "version": "0.1.0",
      "constraint": "v0.1.5",
      "struct_version": 20220411
    },
  3. However if we check the mod installed, it's pulling the correct tag.
    cd .steampipe/mods/github.com/judell/github-activity\@v0.1/.git/
    cat config 
    [core]
         bare = false
    [remote "origin"]
         url = https://github.com/judell/github-activity
         fetch = +refs/tags/v0.1.5:refs/tags/v0.1.5

    Expected behavior

.mod.cache.json is showing the correct version.

Additional context

Why does it matter? SPC uses .mod.cache.json to report version installed. This leads to user confusion which mod is actually installed in their workspace.

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.

pskrbasu commented 1 year ago

Fixed in 0.20.0. (https://github.com/turbot/steampipe/pull/3381)