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

Support resulting an error code when using --fail-no-op=true and spec file #577

Open
arrow0108 opened this issue Jan 24, 2020 · 12 comments
Open
Labels
stale An outdated issue lacking engagement

Comments

@arrow0108
Copy link

Dear Jfrogs,

When I use --fail-no-op=true with file download everything works fine but when using a spec file I think the behavior should change.
If a path specified in a spec file is not fulfilled (no file was downloaded) - the operation should return an error code.

I hope this sounds reasonable.

@liron-shalom
Copy link
Contributor

Thanks for reporting this issue @arrow0108 !
fail-no-op flag is supported when using source & target path arguments and when using a spec-file.
As explained in the documentation, if fail-no-op set to true, the command will return exit code 2 in case of no files are affected.
In case of spec-file with multiple file entries, in case no files were downloaded at all (for all file groups), error code 2 will be returned.
If this is your case, and you wand to get an acknowledgement for a specific group in your spec-file I think running it separately in a dedicated spec-file might be a proper solution.

Can you please share with us your use case and file-spec and let us know what the desired result you wish to get?

@arrow0108
Copy link
Author

Hi Liron,

In our case - indeed we have one spec file to download a set of artifacts.
As part of our build process we gather all files (dependencies) from Artifactory and compose a delivery artifact.
So if one of the files mentioned in the spec is missing we will not get a CLI error.

I understand the workaround suggested, separate to several files but I think the CLI got a spec file and didn't fulfill it should return an error.

Thanks

@liron-shalom
Copy link
Contributor

@arrow0108 , thanks for your reply!

I think that for this kind of use case we'll need to add some kind of "fail-no-op" property to the file-spec schema that will act differently from the "global" flag provided to the command.
With that kind of property inside, we will be able to stop executing and fail the operation once a "file" entry with that property set to true will affect no files.
The outer flag behaviour will stay as today, and fail the operation based on the entire command.

Please let us know what do you think of that solution.

@arrow0108
Copy link
Author

Sounds ok I guess or a new --fail-part-op (for partial operations :-) )

@avojak
Copy link

avojak commented Jun 15, 2021

The current behavior seems counter-intuitive. Given the list of elements in the JSON spec file, I would've expected that the --fail-no-op would apply to each element rather than just the whole, similar to how --limit=1 is applied to each element in the spec file rather than only downloading one element from the whole file.

A fail-no-op property sounds like a viable solution as well.

@ntrainor1
Copy link

Agreed. Given the developer's expectations going from jfrog command to the file specs, I would have expected that given a single failure among multiple artifacts in a file spec would trigger an error code 2.

@thecrabrangoon
Copy link

I agree that fail-no-op should either:

  • apply to each pattern in a spec file
  • each pattern in a spec file should have a separate fail-no-op property

I am currently experiencing an issue where if certain patterns fail to download any files, this "error" is silent. The only way to confirm if the download really succeeded is to dig through a long log file.

@pll
Copy link

pll commented Dec 6, 2022

+1 for this. I've got a similar situation where I have a spec-file to download a collection of artifacts. If any of them are NOT downloaded, I want to immediately fail my pipeline.

Currently, I'm not getting a failure code if a single artifact is not downloaded and no way to know which one isn't.

@pstsef-blackberry
Copy link

Same situation here, and it seems like a very common scenario. There must be a way to validate that ALL the entries in the spec file are successful

Copy link
Contributor

This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days

@github-actions github-actions bot added the stale An outdated issue lacking engagement label Mar 11, 2025
@pstsef-blackberry
Copy link

Are there any updates to this issue?

@eishaq
Copy link

eishaq commented Mar 11, 2025

Tested with JFrog Platform Enterprise Plus 7.98.14

We are facing the same issue with our automation processes. Its all but intuitive to fail for cases where any of the item within the spec file fails to get uploaded/downloaded/copied etc.

An update on this topic will be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale An outdated issue lacking engagement
Projects
None yet
Development

No branches or pull requests

8 participants