Skip to content
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

Improve the behavior when packages' latest versions can't be gotten #2374

Open
suzuki-shunsuke opened this issue Oct 20, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented Oct 20, 2023

Feature Overview

Improve the behavior when packages' latest versions can't be gotten.

Why is the feature needed?

Currently, aqua g -i sets the string [SET PACKAGE VERSION] when aqua can't get packages' latest versions.
And aqua doesn't treat the version [SET PACKAGE VERSION] as special,
so it fails to install packages.

This behavior confused users.
aqua sets the string [SET PACKAGE VERSION] instead of keeping the version empty in order to realize users that they need to fix versions. So this is not so wrong.

But I think aqua should output the warning and ignore packages whose versions are [SET PACKAGE VERSION].

We decided aqua didn't treat [SET PACKAGE VERSION] as special because maybe [SET PACKAGE VERSION] was correct.
But I rethink it isn't realistic that [SET PACKAGE VERSION] may be correct.

How to reproduce the issue

⚠️ aqua info requires aqua >= v2.10.0.

$ aqua info
{
  "version": "2.15.0",
  "commit_hash": "3fd0124deb506011ed0681185ac3c4c0da7b5e09",
  "os": "darwin",
  "arch": "arm64",
  "pwd": "/Users/(USER)/Documents/test/aqua/registry-16498",
  "root_dir": "/Users/(USER)/.local/share/aquaproj-aqua",
  "env": {
    "AQUA_GLOBAL_CONFIG": "/Users/(USER)/repos/src/github.com/aquaproj/aqua-registry/aqua-all.yaml",
    "AQUA_PROGRESS_BAR": "true"
  },
  "config_files": [
    {
      "path": "/Users/(USER)/Documents/test/aqua/registry-16498/aqua.yaml"
    },
    {
      "path": "/Users/(USER)/Documents/test/aqua/aqua.yaml"
    },
    {
      "path": "/Users/(USER)/Documents/test/aqua/aqua.yaml"
    }
  ]
}

aqua.yaml

registries:
- type: standard
  ref: v4.71.0
packages:
- name: michidk/vscli@[SET PACKAGE VERSION]
- name: cli/cli@v2.37.0

Command and output.

$ aqua i
INFO[0000] download and unarchive the package            aqua_version=2.15.0 env=darwin/arm64 package_name=cli/cli package_version=v2.37.0 program=aqua registry=standard
INFO[0000] download and unarchive the package            aqua_version=2.15.0 env=darwin/arm64 package_name=michidk/vscli package_version="[SET PACKAGE VERSION]" program=aqua registry=standard
ERRO[0000] install the package                           aqua_version=2.15.0 env=darwin/arm64 error="get the GitHub Release by Tag: GET https://api.github.com/repos/michidk/vscli/releases/tags/%5BSET%20PACKAGE%20VERSION%5D: 404 Not Found []" package_name=michidk/vscli package_version="[SET PACKAGE VERSION]" program=aqua registry=standard
Downloading cli/cli v2.37.0 100% |██████████████████████████████████████████████████████████████████| (10/10 MB, 28 MB/s)        
FATA[0001] aqua failed                                   aqua_version=2.15.0 env=darwin/arm64 error="it failed to install some packages" program=aqua

Workaround

No response

Example Code

No response

Reference

No response

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Oct 20, 2023
@suzuki-shunsuke
Copy link
Member Author

suzuki-shunsuke commented Oct 20, 2023

Which is better? Error or Ignore?

We should consider the behavior if a package with [SET PACKAGE VERSION] is included in aqua.yaml.

aqua i

  1. Output the warning, ignore the package, and install other packages. Exit with zero
  2. Install other packages and output the error. Exit with non zero

I think 2 is better.

aqua exec

  1. output the warning and ignore the package
  2. output error and exit with non zero

I think 2 is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant