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

cli: set non-zero return code for canceled status #15678

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

mhassan1
Copy link
Contributor

@mhassan1 mhassan1 commented Dec 2, 2024

SUMMARY

This PR adds canceled to the list of statuses that cause launch commands (with --monitor or --wait) to exit non-zero.

If a job is canceled, I expect the caller to get a non-zero return code; otherwise, the caller will think that the job completed successful, even though it did not.

This is a follow-up to #6081.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • CLI
AWX VERSION
awx: 0.1.dev34249+g91bb012
ADDITIONAL INFORMATION

N/A

Copy link

sonarqubecloud bot commented Dec 2, 2024

@mhassan1
Copy link
Contributor Author

mhassan1 commented Jan 7, 2025

@ryanpetrello @AlanCoding I'm tagging you because you participated in the original implementation (#6081). What do you think of this enhancement?

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Jan 20, 2025

Hey @mhassan1,

@AlanCoding can probably answer best - I'm no longer an active contributor to AWX.

@djyasin
Copy link
Member

djyasin commented Feb 4, 2025

Hello @mhassan1, thank you for your contribution! We like the idea of your PR, but would prefer that cancelled return a different code than that of failed or error. Would you be open to modifying that in this PR?

Copy link

sonarqubecloud bot commented Feb 4, 2025

@mhassan1
Copy link
Contributor Author

mhassan1 commented Feb 4, 2025

@djyasin I've updated the PR to set exit code 2 for the canceled status.

@djyasin
Copy link
Member

djyasin commented Feb 4, 2025

Thank you so much! We will review these changes and get back to you soon!

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.28%. Comparing base (15932e3) to head (4230a67).
Report is 19 commits behind head on devel.

✅ All tests successful. No failed tests found.

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

@thedoubl3j
Copy link
Member

hey @mhassan1 thanks for the contribution and updating the error code. everything looks good!

@thedoubl3j thedoubl3j merged commit de4a971 into ansible:devel Feb 25, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants