wash icon indicating copy to clipboard operation
wash copied to clipboard

add artifact not found error

Open Mo-Fatah opened this issue 2 years ago • 8 comments

relates to #273

I think this can be a temporary fix to indicate that the artifact couldn't be found locally or from a registry.

Mo-Fatah avatar Sep 01 '22 09:09 Mo-Fatah

Hi @Mo-Fatah, thanks for contributing! From reading the code I think your changes would fix #273, although I haven't tested it yet. Not sure why you closed the PR, but if you need any help with this feel free to reach out. We often discuss changes and ask for advice on the wasmCloud Slack, here is the link.

mattwilkinsonn avatar Sep 01 '22 14:09 mattwilkinsonn

Thanks @mattwilkinsonn !! I thought that my fix solves the issue. But after I filed the PR , I ran the tests and I had a failed test case

test integration_claims_inspect ... FAILED

This why I closed my PR thinking that my fix is causing the test failure.

But I noticed something now, this test case also fails on main upstream. Is this issue known for you or I am missing something here ? I am using Ubuntu 20.04.4 LTS

I have reopened the PR

Mo-Fatah avatar Sep 01 '22 16:09 Mo-Fatah

@Mo-Fatah I didn't see any failing tests in main (we had a failed build of a docker image, but nothing from tests). Let's see how the PR tests do because perhaps it could be local.

Also, you'll need to sign off your commit! Details instructions can be found by clicking the "Details` link on the failed DCO check

thomastaylor312 avatar Sep 01 '22 17:09 thomastaylor312

@Mo-Fatah I didn't see any failing tests in main (we had a failed build of a docker image, but nothing from tests). Let's see how the PR tests do because perhaps it could be local.

Also, you'll need to sign off your commit! Details instructions can be found by clicking the "Details` link on the failed DCO check

Yeah, all the checks here have passed, apparently this is a local failure.

I have singed off my commit, Thank you!

Mo-Fatah avatar Sep 02 '22 06:09 Mo-Fatah

This also seems to still reproduce the same issue, likely because the image tag doesn't exist so it's unwrapping to latest as a fallback

> wash claims inspect echo_s.wasm

Pulling artifacts with tag 'latest' is prohibited. This can be overriden with the flag --allow-latest

brooksmtownsend avatar Sep 02 '22 14:09 brooksmtownsend

Yes you are right. I thought of it as: when the user enter a not-found artifact, they will be prompted to try the --allow-latest flag. When they try again with the flag, they will get a not-found error. A kind of: try everything before getting a final not-found error.

Not very accurate. Do you have suggestions ? besides a more detailed message.

Mo-Fatah avatar Sep 03 '22 07:09 Mo-Fatah

Do you have suggestions ? besides a more detailed message.

So what we're really trying to do here is provide a useful error message for people when they try to inspect a local file but they type in the name wrong. Here's what I think would be a good solution:

  • If the user types in an OCI reference we require a tag (e.g. you can't just do wasmcloud.azurecr.io/echo, you have to type out wasmcloud.azurecr.io/echo:latest to use the latest tag)
    • I know this isn't what Docker does, but we have explicit latest checks so I think it would be better to explicitly require that tag.
  • If the user doesn't include a tag, then assume it's a file, and if it's not found then we return an error message about the file not being found
  • If the user includes the latest tag, then we can do any checks for the --allow-latest flag

Thoughts @mattwilkinsonn / @thomastaylor312 ?

brooksmtownsend avatar Sep 06 '22 13:09 brooksmtownsend

If the user doesn't include a tag, then assume it's a file, and if it's not found then we return an error message about the file not being found

This error should probably say something about file not found and then

(Were you specifying an image? Image tags are required for wasmCloud)

thomastaylor312 avatar Sep 19 '22 16:09 thomastaylor312

@Mo-Fatah I'm going to close this as it seems to have gotten a little stale, please feel free to re-open once you've added a few changes or want to re-approach this PR

brooksmtownsend avatar Nov 10 '22 14:11 brooksmtownsend