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

chore: add event logger to reports/alerts CRUD #20249

Conversation

AAfghahi
Copy link
Member

@AAfghahi AAfghahi commented Jun 2, 2022

SUMMARY

Previously we did not have any tracking for Report CRUD actions, this adds that.

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

@codecov
Copy link

codecov bot commented Jun 2, 2022

Codecov Report

Merging #20249 (80e5ee8) into master (a813528) will decrease coverage by 11.90%.
The diff coverage is 55.82%.

❗ Current head 80e5ee8 differs from pull request most recent head 9b5baeb. Consider uploading reports for the commit 9b5baeb to get more accurate results

@@             Coverage Diff             @@
##           master   #20249       +/-   ##
===========================================
- Coverage   66.50%   54.60%   -11.91%     
===========================================
  Files        1726     1726               
  Lines       64789    64892      +103     
  Branches     6829     6832        +3     
===========================================
- Hits        43090    35432     -7658     
- Misses      19967    27728     +7761     
  Partials     1732     1732               
Flag Coverage Δ
hive 53.66% <43.30%> (-0.02%) ⬇️
mysql ?
postgres ?
presto 53.52% <43.30%> (-0.02%) ⬇️
python 58.07% <57.03%> (-24.63%) ⬇️
sqlite ?
unit 50.13% <56.25%> (+0.13%) ⬆️

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

Impacted Files Coverage Δ
.../shared-controls/components/RadioButtonControl.tsx 0.00% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...gins/legacy-plugin-chart-world-map/src/WorldMap.js 0.00% <0.00%> (ø)
.../legacy-plugin-chart-world-map/src/controlPanel.ts 33.33% <0.00%> (-66.67%) ⬇️
...egacy-plugin-chart-world-map/src/transformProps.js 0.00% <0.00%> (ø)
superset-frontend/src/SqlLab/reducers/sqlLab.js 32.62% <0.00%> (-0.54%) ⬇️
...tend/src/components/Datasource/DatasourceModal.tsx 69.04% <ø> (ø)
.../src/dashboard/components/gridComponents/Chart.jsx 60.60% <ø> (ø)
...set-frontend/src/explore/actions/exploreActions.ts 50.00% <ø> (ø)
...mponents/DataTablesPane/components/ResultsPane.tsx 58.18% <ø> (-0.75%) ⬇️
... and 339 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 a813528...9b5baeb. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/S labels Jun 2, 2022
@AAfghahi AAfghahi changed the title chore: add event logger to report CRUD chore: add event logger to reports CRUD Jun 2, 2022
@AAfghahi AAfghahi changed the title chore: add event logger to reports CRUD chore: add event logger to reports/alerts CRUD Jun 2, 2022
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch 2 times, most recently from d26e290 to 7aac7aa Compare June 2, 2022 21:21
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from 7aac7aa to b68513c Compare June 2, 2022 21:31
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jun 2, 2022
@permission_name("delete")
@statsd_metrics
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.data",
Copy link
Member

Choose a reason for hiding this comment

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

action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.data",

@@ -416,6 +429,10 @@ def put(self, pk: int) -> Response:
@safe
@statsd_metrics
@rison(get_delete_ids_schema)
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
Copy link
Member

Choose a reason for hiding this comment

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

.delete_bulk

@@ -281,6 +286,10 @@ def delete(self, pk: int) -> Response:
@statsd_metrics
@permission_name("post")
@requires_json
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.create",
Copy link
Member

Choose a reason for hiding this comment

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

post

@@ -344,6 +353,10 @@ def post(self) -> Response:
@statsd_metrics
@permission_name("put")
@requires_json
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.modify",
Copy link
Member

Choose a reason for hiding this comment

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

post

Copy link
Member Author

Choose a reason for hiding this comment

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

put?

@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from ee0d81f to d088a21 Compare June 3, 2022 15:42
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from d088a21 to 7d8312d Compare June 3, 2022 16:16
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from 7d8312d to 397f52c Compare June 3, 2022 17:32
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 3, 2022
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch 3 times, most recently from 82c0b28 to 9fedaaa Compare June 3, 2022 21:55
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from 9fedaaa to 0ff1eaf Compare June 3, 2022 22:19
@AAfghahi AAfghahi force-pushed the arash.afghahi/sc-48895/add-tracking-in-superset-for-report-alert branch from 0ff1eaf to 9b5baeb Compare June 3, 2022 22:26
@hughhhh hughhhh merged commit c131f02 into apache:master Jun 6, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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 preset-io size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants