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

feat: adding logging to validation #16527

Merged
merged 2 commits into from
Sep 13, 2021

Conversation

AAfghahi
Copy link
Member

SUMMARY

Logs the engine to the validation_parameters for better logging.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@@ -908,14 +908,14 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
/>
);
}

const message: Array<string> = Object.values(dbErrors);
const message: Array<string> | null =
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes a database connection errror when test connection has failed.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

It's not related to your changes, but I think we really should show all the messages, not just the first one. Left some suggestions on how to do that.

return (
<Alert
type="error"
css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
message="Database Creation Error"
description={message[0]}
description={message?.[0] || dbErrors}
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why we're showing just the first message here?

It would be better (and easy) to show all of them:

Suggested change
description={message?.[0] || dbErrors}
description={message.join('\n') || dbErrors}

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Actually, can you run a test and see if the error messages get logged successfully?

I think @hughhhh has some experience checking that logs are produced correctly when testing locally.

…ndex.tsx

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #16527 (5054fc9) into master (62d8ab7) will decrease coverage by 0.04%.
The diff coverage is 78.72%.

❗ Current head 5054fc9 differs from pull request most recent head 9f59b4f. Consider uploading reports for the commit 9f59b4f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16527      +/-   ##
==========================================
- Coverage   76.63%   76.59%   -0.05%     
==========================================
  Files        1002     1002              
  Lines       53680    53802     +122     
  Branches     6852     6861       +9     
==========================================
+ Hits        41138    41208      +70     
- Misses      12305    12357      +52     
  Partials      237      237              
Flag Coverage Δ
hive ?
javascript 70.99% <7.14%> (-0.03%) ⬇️
mysql 81.50% <86.61%> (+0.02%) ⬆️
postgres 81.57% <86.61%> (+0.02%) ⬆️
presto 81.41% <86.61%> (?)
python 81.83% <86.61%> (-0.08%) ⬇️
sqlite 81.22% <86.61%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/reducers/sqlLab.js 33.99% <0.00%> (-0.83%) ⬇️
...dashboard/components/SliceHeaderControls/index.tsx 75.00% <ø> (ø)
...c/views/CRUD/data/database/DatabaseModal/index.tsx 44.13% <0.00%> (-0.12%) ⬇️
superset-frontend/src/chart/Chart.jsx 43.33% <20.00%> (-1.31%) ⬇️
superset/views/datasource/views.py 90.10% <50.00%> (-1.85%) ⬇️
superset/views/database/forms.py 87.09% <81.81%> (-1.80%) ⬇️
superset/views/database/views.py 88.46% <85.93%> (-1.02%) ⬇️
superset/views/core.py 75.54% <96.29%> (+0.30%) ⬆️
superset/config.py 91.36% <100.00%> (+0.02%) ⬆️
superset/databases/commands/test_connection.py 100.00% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62d8ab7...9f59b4f. Read the comment docs.

@AAfghahi
Copy link
Member Author

AAfghahi commented Sep 8, 2021

Screen Shot 2021-09-08 at 4 18 18 PM

@betodealmeida this is from my local logging.

@betodealmeida betodealmeida merged commit 376c685 into apache:master Sep 13, 2021
stevenuray pushed a commit to preset-io/superset that referenced this pull request Sep 16, 2021
* adding logging to validation

* Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
(cherry picked from commit 376c685)
@stevenuray stevenuray deleted the ch23886_additionalLogging branch September 16, 2021 02:31
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* adding logging to validation

* Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* adding logging to validation

* Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants