Organizations API - Delayed group deletion
What does this MR do and why?
Modeled heavily from: !147949 (merged)
Part of #442810 (closed)
Supports FE MR: !148701 (merged)
Important: This change is behind a feature flag ui_for_organizations
This change makes the necessary API changes to support the Frontend for delayed group deletion in Organizations (WIP). The intention is to utilize the logic currently found in our RESTful Groups API
By itself this change doesn't do much besides expose new data to the GraphQL endpoint and update the mock group data.
CE Environments
Pending deletion is an EE only feature and thus will also return false/nil
data for anything related to pending deletion.
EE Environments
-
isAdjournedDeletionEnabled
is enabled by default on all Groups. -
permanent_deletion_date
is the date, X days in the future, that is configured by the instance for when the group will be deleted if it is triggered now. -
marked_for_deletion_on
is the date when the deletion was triggered.
Screenshots or screen recordings
CE API Res | EE API Res |
---|---|
![]() |
![]() |
How to set up and validate locally
Setup Organizations
important: You only need to do this in your GDK if you haven't yet!
- Access
rails c
- Enable Feature Flag
Feature.enable(:ui_for_organizations)
- Create the default organization and add root to it
you = User.find_by_username('root')
default_organization = Organizations::Organization.default_organization
Organizations::OrganizationUser.create!(organization_id: default_organization.id, user_id: you.id)
-
Create a test group
-
Navigate to the GDK home page
ex: 127.0.0.1:3000/
-
Click Organizations in the sidebar
-
Click the Default Organization
-
Click the Manage > Groups and projects in the sidebar
-
Switch list to Groups in the dropdown
-
Check API response from GraphQL for your group
-
Ensure
isAdjournedDeletionEnabled
is true andpermanentDeletionDate
is a date one week out for your group. -
Click the ... for the group you made
-
Follow prompts to trigger deletion and then refresh the page
-
Ensure your group has label pending deletion
-
Ensure the API response in GraphQL for your group now has a value in
markedForDeletionOn
of today.
Related to #442810 (closed)