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: handle non-existing cargo packages #1460

Merged
merged 5 commits into from
Aug 10, 2023
Merged

fix: handle non-existing cargo packages #1460

merged 5 commits into from
Aug 10, 2023

Conversation

loispostula
Copy link
Contributor

@loispostula loispostula commented Aug 10, 2023

Fix #1459

Make sure we can handle the cases when a package does not exists

Test

To test this pull request, you can run check the following pipeline file

name: Retrieve the latest Cargo Package Version

scms:
  private-registry:
    kind: git
    spec:
      url: "https://github.com/updatecli-test/fake-cargo-registry.git"
      branch: "main"

conditions:
  existing-package-private-reg:
    name: Test if test-crate-2 0.1.0 exists on private registry
    kind: cargopackage
    scmid: private-registry
    spec:
      package: test-crate-2
      version: 0.1.0
  existing-package-not-existing-version-private-reg:
    name: Test if test-crate-2 0.6.0 does not exists on private registry
    kind: cargopackage
    scmid: private-registry
    failwhen: true
    spec:
      package: test-crate-2
      version: 0.6.0
  non-existing-package-private-reg:
    name: Test if non-existing-test-crate 0.1.0 does not exists on private registry
    kind: cargopackage
    scmid: private-registry
    failwhen: true
    spec:
      package: non-existing-test-crate
      version: 0.1.0
  existing-package-public-reg:
    name: Test if rand version exists on public reg
    kind: cargopackage
    spec:
      package: rand
      version: 0.7.2
  existing-package-p-not-existing-version-public-reg:
    name: Test if rand version 99.99.99 does not exists on public reg
    kind: cargopackage
    failwhen: true
    spec:
      package: rand
      version: 99.99.99
  non-existing-package-public-reg:
    name: Test if non-existing-package-to-be-sure-123456 does exists on public reg
    kind: cargopackage
    failwhen: true
    spec:
      package: non-existing-package-to-be-sure-123456
      version: 0.7.2

@olblak olblak added bug Something isn't working resource-cargo Related to Rust crate labels Aug 10, 2023
olblak
olblak previously approved these changes Aug 10, 2023
Copy link
Member

@olblak olblak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I faced the same condition problem for other plugin.
I don't reminder if it is unified but I think it is the right approach

@olblak olblak merged commit 9a24ee6 into updatecli:main Aug 10, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resource-cargo Related to Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargopackage: Conditions error on non existing package
4 participants