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

Add postflight to handle click exc and exit codes #7212

Merged
merged 3 commits into from
Mar 27, 2023
Merged

Conversation

stu-k
Copy link
Contributor

@stu-k stu-k commented Mar 22, 2023

resolves #7010

Description

  • Added a postflight decorator to house any actions necessary after an invocation has been completed
  • Moved existing firing of the CommandComplete event to postflight
  • Added exception wrapping in postflight to allow click to surface the correct error codes
  • Added additional exception handling in dbtRunner to handle exceptions thrown by postflight

Checklist

@cla-bot cla-bot bot added the cla:yes label Mar 22, 2023
@stu-k stu-k marked this pull request as ready for review March 22, 2023 18:44
@stu-k stu-k requested a review from a team as a code owner March 22, 2023 18:44
@stu-k stu-k requested review from gshank, emmyoop, QMalcolm, a team and ChenyuLInx March 22, 2023 18:44
@stu-k stu-k force-pushed the CT-2142/cli-exit-codes branch from c63d2ea to 2019385 Compare March 24, 2023 17:45
Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for finding this solution! I was able to validate the cli exit code 0,1,2 when running in a terminal(using echo $?). I am wondering is it possible to add the test to validate that code(not the exception thrown). Not a blocker if not!

tests/functional/cli/test_cli_exit_codes.py Show resolved Hide resolved
@stu-k stu-k merged commit 6992151 into main Mar 27, 2023
@stu-k stu-k deleted the CT-2142/cli-exit-codes branch March 27, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2142] [Regression] dbt 1.5.0 return invalid exit codes.
2 participants