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

fix: Improving handling for tag relationship when deleting assets v2 #29229

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

Vitor-Avila
Copy link
Contributor

SUMMARY

This is a follow up for #29117, since it was confirmed on this comment that the issue still persists.

I'm updating these relationships to viewonly=True, since there's already an after_delete hook in place to delete tag association after an asset is deleted - reference. With that in mind, handling the cascade deletion in the relationship is redundant.

Long-term, we could delete this hook and fix the relationships for a proper cascading deletion -- I'll look into that in a following PR (need to make sure that removing this hook won't impact any other logic in the application).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

No UI changes.

TESTING INSTRUCTIONS

  1. Make sure you have a dashboard and a chart with the same ID.
  2. Assign a tag for both assets. Also add owners to both assets.
  3. Validate that you're able to delete one of the assets.

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

@dosubot dosubot bot added dashboard Namespace | Anything related to the Dashboard viz:charts Namespace | Anything related to viz types labels Jun 12, 2024
@Vitor-Avila
Copy link
Contributor Author

@mistercrunch @john-bodley let me know your thoughts with this approach

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.73%. Comparing base (76d897e) to head (47d4139).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29229       +/-   ##
===========================================
+ Coverage   60.48%   83.73%   +23.24%     
===========================================
  Files        1931      518     -1413     
  Lines       76236    37522    -38714     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31419    -14695     
+ Misses      28017     6103    -21914     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.94% <ø> (-0.22%) ⬇️
javascript ?
mysql 77.22% <ø> (?)
postgres 77.34% <ø> (?)
presto 53.57% <ø> (-0.24%) ⬇️
python 83.73% <ø> (+20.24%) ⬆️
sqlite 76.78% <ø> (?)
unit 59.21% <ø> (+1.58%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

It'd be great to capture this as comment, something like

viewonly=True,  # cascading handled by tag.models.ObjectUpdater.after_delete

for all 3 intances plz. As someone reading the code, it'd be a head scratcher, and I have to say that while I worked on this bug I never knew this ObjectUpdater existed...

@Vitor-Avila Vitor-Avila requested a review from mistercrunch June 12, 2024 16:23
@mistercrunch mistercrunch merged commit 5167d20 into apache:master Jun 12, 2024
37 checks passed
@john-bodley john-bodley added review:checkpoint Last PR reviewed during the daily review standup and removed review:checkpoint Last PR reviewed during the daily review standup labels Jun 12, 2024
eschutho pushed a commit that referenced this pull request Jun 23, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 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 dashboard Namespace | Anything related to the Dashboard size/S viz:charts Namespace | Anything related to viz types 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants