Delete orphaned approvals

Created on 4 October 2024, 6 months ago

Problem/Motivation

When a user is removed, and that user is the reviewer of a request approval, the entity ends up orphaned.
When a workflow is removed, and there are related request approvals, those entitoes ends up orphaned.

Steps to reproduce

Proposed resolution

React on removals to clean up.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇵🇪Peru marvil07

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @marvil07
  • Merge request !2#3478867 Delete orphaned approvals → (Merged) created by marvil07
  • 🇵🇪Peru marvil07

    I have added a hook_ENTITY_TYPE_delete() for both user and workspace entities.

    On the user case, I am checking only for the reviewer.
    I have not tried to check for the owner.
    Arguably, even if the owner of the request approval is removed, the approval may still continue.

    I also needed to add a small change to the entity class to handle the no subject case a bit more, following the recent addition to allow it to be nullable at a0d4ce4fab6a8310860a7de94936852a6198a1ec.

    New commits on new 3478867-delete-orphaned-approvals topic branch and related new MR !2

    - 260b87e Delete workspace request approvals when the reviewer is deleted
    - e72f5e6 Handle no subject on WorkspaceApprovalRequest::urlRouteParameters()
    - d9cc422 Delete workspace request approvals when the subject is deleted

  • Pipeline finished with Skipped
    6 months ago
    #301287
  • First commit to issue fork.
  • heddn Nicaragua

    Great work here.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024