-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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(cli): fail CLI script on failed import/export #16976
fix(cli): fail CLI script on failed import/export #16976
Conversation
@dpgaspar here we go! It's a very naive approach, though. Plus we might need testing — but I can't make it work locally. So I'm very much looking forward to some guidance — happy to continue on Slack. |
For each CLI entry-point we will modify, we make sure that: - a failing process exits with a non-0 exit code, - an error is logged. Signed-off-by: Étienne Boisseau-Sierra <[email protected]>
dee0499
to
df8a0c8
Compare
Codecov Report
@@ Coverage Diff @@
## master #16976 +/- ##
==========================================
- Coverage 76.91% 76.79% -0.12%
==========================================
Files 1038 1038
Lines 55557 55563 +6
Branches 7567 7567
==========================================
- Hits 42729 42671 -58
- Misses 12578 12642 +64
Partials 250 250
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Bubble exception up when failing import or export During a CLI import or export of dashboards, if the process fails, the exception it caught and a simple message is sent to the logger. This makes that from a shell point of view, the script was successfull — cf. apache#16956. To prevent this, we want to ensure that the process exits with an error (i.e., a non-0 exit-code) should the export or import fail mid-flight. Signed-off-by: Étienne Boisseau-Sierra <[email protected]>
32a0e8f
to
3fde6ca
Compare
@dpgaspar shall we try merging it on time for |
* Test that failing export or import is done properly For each CLI entry-point we will modify, we make sure that: - a failing process exits with a non-0 exit code, - an error is logged. Signed-off-by: Étienne Boisseau-Sierra <[email protected]> * Exit process with error if export/import failed Bubble exception up when failing import or export During a CLI import or export of dashboards, if the process fails, the exception it caught and a simple message is sent to the logger. This makes that from a shell point of view, the script was successfull — cf. #16956. To prevent this, we want to ensure that the process exits with an error (i.e., a non-0 exit-code) should the export or import fail mid-flight. Signed-off-by: Étienne Boisseau-Sierra <[email protected]> (cherry picked from commit f0c0ef7)
* Test that failing export or import is done properly For each CLI entry-point we will modify, we make sure that: - a failing process exits with a non-0 exit code, - an error is logged. Signed-off-by: Étienne Boisseau-Sierra <[email protected]> * Exit process with error if export/import failed Bubble exception up when failing import or export During a CLI import or export of dashboards, if the process fails, the exception it caught and a simple message is sent to the logger. This makes that from a shell point of view, the script was successfull — cf. #16956. To prevent this, we want to ensure that the process exits with an error (i.e., a non-0 exit-code) should the export or import fail mid-flight. Signed-off-by: Étienne Boisseau-Sierra <[email protected]>
SUMMARY
During a CLI import or export of dashboards, if the process fails, the
exception it caught and a simple message is sent to the logger.
This makes that from a shell point of view, the script was successfull —
cf. #16956.
To prevent this, we re-raise the exception once it has been logged on
the logger.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
n/a
TESTING INSTRUCTIONS
New unit tests added to
tests/integration_tests/cli_tests.py
.ADDITIONAL INFORMATION
superset {im, ex}port
to *fail* if unsuccessful #16956