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

Fix the error handling when it fails to evaluate the version constraint #1860

Closed
suzuki-shunsuke opened this issue Apr 11, 2023 · 0 comments · Fixed by #1864
Closed

Fix the error handling when it fails to evaluate the version constraint #1860

suzuki-shunsuke opened this issue Apr 11, 2023 · 0 comments · Fixed by #1864
Labels
bug Something isn't working
Milestone

Comments

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented Apr 11, 2023

aqua version

Please use the latest version.

$ aqua -v
aqua version 2.3.1 (1b9f90c9ab675d37b4f67579faf569417edb72e3)

Environment

  • OS (Windows, Linux, macOS, etc): darwin
  • CPU Architecture (amd64, arm64, etc): arm64

Overview

How to reproduce

  • aqua.yaml
  • executed command and output

aqua.yaml should be not partial but complete configuration.
Please remove unneeded configuration to reproduce the issue.

aqua.yaml

registries:
- name: local
  type: local
  path: registry.yaml
packages:
- name: mvisonneau/vac
  version: edge
  registry: local

registry.yaml

packages:
  - type: github_release
    repo_owner: mvisonneau
    repo_name: vac
    description: AWS credentials management leveraging Vault
    asset: vac_{{.Version}}_{{.OS}}_{{.Arch}}.{{.Format}}
    format: tar.gz
    overrides:
      - goos: windows
        format: zip
    supported_envs:
      - darwin
      - linux
      - amd64
    checksum:
      type: github_release
      asset: vac_{{.Version}}_sha512sums.txt
      file_format: regexp
      algorithm: sha512
      pattern:
        checksum: "^(\\b[A-Fa-f0-9]{128}\\b)"
        file: "^\\b[A-Fa-f0-9]{128}\\b\\s+(\\S+)$"
    version_constraint: semver(">= 0.0.6")
    version_overrides:
      - version_constraint: semver(">= 0.0.5")
        rosetta2: true
      - version_constraint: semver(">= 0.0.4")
        rosetta2: true
        checksum:
          type: github_release
          asset: vac_{{.Version}}_SHA256SUMS
          file_format: regexp
          algorithm: sha256
          pattern:
            checksum: "^(\\b[A-Fa-f0-9]{64}\\b)"
            file: "^\\b[A-Fa-f0-9]{64}\\b\\s+(\\S+)$"
      - version_constraint: semver("< 0.0.4")
        rosetta2: true
        checksum:
          type: github_release
          asset: checksums.txt
          file_format: regexp
          algorithm: sha256
          pattern:
            checksum: "^(\\b[A-Fa-f0-9]{64}\\b)"
            file: "^\\b[A-Fa-f0-9]{64}\\b\\s+(\\S+)$"
WARN[0000] version constraint is invalid                 aqua_version=2.3.1 env=darwin/arm64 error="evaluate the expression: Malformed version: edge (1:1)\n | semver(\">= 0.0.6\")\n | ^" exe_name=starship package_name=mvisonneau/vac program=aqua registry_name=local

pkgInfo, err := pkgInfo.Override(pkg.Version, ctrl.runtime)
if err != nil {
logerr.WithError(logE, err).Warn("version constraint is invalid")
return nil
}

Debug Output

Please set the environment variable AQUA_LOG_LEVEL=debug and run aqua and tell us the debug output.

$ 

Expected Behaviour

No error is outputted. If it fails to evaluate the version constraint, the version constraint should be ignored.

Actual Behaviour

Important Factoids

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant