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

[Feature][BE] After users remove a board from a blueprint or connection, the data relates to the board will be deleted #4762

Closed
2 of 7 tasks
Startrekzky opened this issue Mar 24, 2023 · 6 comments
Assignees
Labels
component/framework This issue or PR relates to the framework type/feature-request This issue is a proposal for something new
Milestone

Comments

@Startrekzky
Copy link
Contributor

Startrekzky commented Mar 24, 2023

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Use case

As a scrum manager, I re-organize Jira boards at times. When I first started using DevLake, I collected data from Jira board-1, then I created a new board in Jira called board-2, added board-2, and removed board one from the corresponding DevLake blueprint.

I was expecting that DevLake would delete the board-1 data, but it did not happen.

Description

I want DevLake to support the data deletion of a removed data scope after editing a blueprint, a connection, or any operation that might delete the data scope.

For example, if I collected b1, and then edited the blueprint to ONLY collect b2.

  • b1: i1, i2, i3, i4
  • b2: i2, i3, i5, i6

b1 in table.boards, i1,i4 in table.issues, and all issue_changelogs, issue_labels, issue_worklogs related to i1 and i4 will be deleted.

i2 and i3 in b1 won't be affected as they also belong to other boards. See the pic below, the shadow part should be kept.

image

To Do

  • Detect if there're boards removed after users save a 'data scope edit'
  • If so, prompt the users if they want to delete the data. The default operation is to delete or not (needs discussion)?
    • If users choose to delete the data of the removed data scope, only the data of the existing data scope will be kept.
    • If not, delete the data (belonging to existing boards) automatically when the bp runs the next time

Related issues

Obsolete PR:
#4906

Child PRs:
#5153
#5155

Child Issue:
#5277

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Startrekzky Startrekzky added type/feature-request This issue is a proposal for something new component/framework This issue or PR relates to the framework labels Mar 24, 2023
@Startrekzky Startrekzky changed the title [Feature][BE] After users remove a board from a blueprint or connection, the data relates to the repo will be deleted [Feature][BE] After users remove a board from a blueprint or connection, the data relates to the board will be deleted Mar 28, 2023
@Startrekzky Startrekzky added this to the v0.18.0 milestone Mar 28, 2023
@keon94
Copy link
Contributor

keon94 commented Apr 7, 2023

This sounds conceptually similar to deleting a blueprint. We essentially need to know what data belongs to a given scope which is just like the problem with blueprints: what data belongs to a given blueprint? I think both of these problems have to be solved in a similar way

@Startrekzky
Copy link
Contributor Author

Based on today's discussion, it seems @klesh wants the approach to be simple. If a user is facing the problem described above, deleting board-1 will delete all records associated with board-1, which might include issue-2 and 3, depending on issue-2 and 3 are "tagged" with which data scope, board-1 or board-2.

If issue-2 and 3 are "tagged" with board-1, the deletion will affect the data integrity of board-2, the user has to rerun bp to collect all board -2 issues.

Correct me if I'm wrong. Cc. @keon94 @hezyin @klesh @yumengwang03

@klesh
Copy link
Contributor

klesh commented Apr 13, 2023

Based on today's discussion, it seems @klesh wants the approach to be simple. If a user is facing the problem described above, deleting board-1 will delete all records associated with board-1, which might include issue-2 and 3, depending on issue-2 and 3 are "tagged" with which data scope, board-1 or board-2.

If issue-2 and 3 are "tagged" with board-1, the deletion will affect the data integrity of board-2, the user has to rerun bp to collect all board -2 issues.

Correct me if I'm wrong. Cc. @keon94 @hezyin @klesh @yumengwang03

Yes, that is correct.

@keon94
Copy link
Contributor

keon94 commented Apr 13, 2023

But wouldn't this lead to a full data collection for those blueprints? Maybe it'd be better to not allow deletion if a scope has multiple blueprints using it

@klesh
Copy link
Contributor

klesh commented Apr 14, 2023

But wouldn't this lead to a full data collection for those blueprints? Maybe it'd be better to not allow deletion if a scope has multiple blueprints using it

Do you mean that scope that gets deleted is still being included in some bp?

  1. it is problematic since the scope record is gone, thus the bp wouldn't function properly, we should do sth about it.
  2. as for the collected data, maybe it is a good thing because Incremental Collection can not delete records in the database that were removed from the data source. In fact, we don't have a full collection option at the moment, come to think about it, we should offer a "Clear" button for the scope for deleting data only.

@yumengwang03
Copy link
Contributor

Adding the prototype here:
Screen Shot 2023-05-11 at 5 13 44 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/framework This issue or PR relates to the framework type/feature-request This issue is a proposal for something new
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants