Skip to content

Organizations API - Delayed group deletion

Zack Cuddy requested to merge 442810-organizations-groups-delayed-deletion into master

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

  1. isAdjournedDeletionEnabled is enabled by default on all Groups.
  2. 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.
  3. marked_for_deletion_on is the date when the deletion was triggered.

Screenshots or screen recordings

CE API Res EE API Res
ce ee

How to set up and validate locally

Setup Organizations

important: You only need to do this in your GDK if you haven't yet!

  1. Access rails c
  2. Enable Feature Flag Feature.enable(:ui_for_organizations)
  3. 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)
  1. Create a test group

  2. Navigate to the GDK home page ex: 127.0.0.1:3000/

  3. Click Organizations in the sidebar

  4. Click the Default Organization

  5. Click the Manage > Groups and projects in the sidebar

  6. Switch list to Groups in the dropdown

  7. Check API response from GraphQL for your group

  8. Ensure isAdjournedDeletionEnabled is true and permanentDeletionDate is a date one week out for your group.

  9. Click the ... for the group you made

  10. Follow prompts to trigger deletion and then refresh the page

  11. Ensure your group has label pending deletion

  12. Ensure the API response in GraphQL for your group now has a value in markedForDeletionOn of today.

Related to #442810 (closed)

Edited by Zack Cuddy

Merge request reports