Skip to content
Snippets Groups Projects

Organizations API - Delayed group deletion

Merged Zack Cuddy requested to merge 442810-organizations-groups-delayed-deletion into master
All threads resolved!

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Zack Cuddy
  • Zack Cuddy
  • Zack Cuddy
  • Zack Cuddy
  • Zack Cuddy
    • Author Maintainer
      Resolved by Robert May

      Hey @SamWord! Do you have capacity for a backend review here? This change is the API portion for #442810 (closed).

      This change is very heavily modeled after its Projects counterpart !147949 (merged). The Frontend MR hasn't been created yet but will look very similar to !147479 (merged).

      This change adds the fields to the API that we need to power the upcoming frontend changes. I have provided context in various threads and in the description as well.

      Please let me know if you have any questions :basketball:

    • Author Maintainer
      Resolved by Robert May

      Hey @kpalchyk! Do you have capacity for a frontend review here? This change is the API portion for #442810 (closed).

      This change is very heavily modeled after its Projects counterpart !147949 (merged). The Frontend MR hasn't been created yet but will look very similar to !147479 (merged).

      This change adds the fields to the API that we need to power the upcoming frontend changes. I have provided context in various threads and in the description as well.

      Please let me know if you have any questions :basketball:

  • Zack Cuddy requested review from @SamWord and @kpalchyk

    requested review from @SamWord and @kpalchyk

  • Zack Cuddy added 156 commits

    added 156 commits

    Compare with previous version

  • Zack Cuddy mentioned in merge request !148701 (merged)

    mentioned in merge request !148701 (merged)

  • Sam Word requested review from @ivaneG and removed review request for @SamWord

    requested review from @ivaneG and removed review request for @SamWord

  • Kos Palchyk
  • Kos Palchyk approved this merge request

    approved this merge request

  • Kos Palchyk requested review from @ealcantara

    requested review from @ealcantara

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for a4c6864a

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Verify      | 35     | 0      | 1       | 0     | 36    | ✅     |
    | Create      | 83     | 0      | 9       | 0     | 92    | ✅     |
    | Govern      | 66     | 0      | 0       | 0     | 66    | ✅     |
    | Release     | 5      | 0      | 0       | 0     | 5     | ✅     |
    | Monitor     | 7      | 0      | 0       | 0     | 7     | ✅     |
    | Data Stores | 31     | 0      | 0       | 0     | 31    | ✅     |
    | Plan        | 51     | 0      | 2       | 0     | 53    | ✅     |
    | Package     | 24     | 0      | 6       | 0     | 30    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Manage      | 0      | 0      | 1       | 0     | 1     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 304    | 0      | 19      | 0     | 323   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :white_check_mark: test report for a4c6864a

    expand test summary
    +---------------------------------------------------------------------+
    |                           suites summary                            |
    +----------------+--------+--------+---------+-------+-------+--------+
    |                | passed | failed | skipped | flaky | total | result |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Plan           | 249    | 0      | 19      | 0     | 268   | ✅     |
    | Configure      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Create         | 570    | 0      | 81      | 6     | 651   | ✅     |
    | Govern         | 272    | 0      | 19      | 0     | 291   | ✅     |
    | Data Stores    | 119    | 0      | 28      | 0     | 147   | ✅     |
    | Verify         | 150    | 0      | 30      | 0     | 180   | ✅     |
    | Manage         | 38     | 0      | 12      | 0     | 50    | ✅     |
    | Package        | 205    | 0      | 38      | 0     | 243   | ✅     |
    | Systems        | 10     | 0      | 0       | 0     | 10    | ✅     |
    | GitLab Metrics | 2      | 0      | 1       | 0     | 3     | ✅     |
    | Analytics      | 7      | 0      | 0       | 0     | 7     | ✅     |
    | Fulfillment    | 8      | 0      | 75      | 1     | 83    | ✅     |
    | Monitor        | 36     | 0      | 13      | 0     | 49    | ✅     |
    | Secure         | 6      | 0      | 3       | 0     | 9     | ✅     |
    | Growth         | 0      | 0      | 6       | 0     | 6     | ➖     |
    | Release        | 15     | 0      | 3       | 0     | 18    | ✅     |
    | Ai-powered     | 0      | 0      | 3       | 0     | 3     | ➖     |
    | ModelOps       | 0      | 0      | 3       | 0     | 3     | ➖     |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Total          | 1688   | 0      | 343     | 7     | 2031  | ✅     |
    +----------------+--------+--------+---------+-------+-------+--------+
  • Zack Cuddy added 574 commits

    added 574 commits

    Compare with previous version

  • Zack Cuddy added 1 commit

    added 1 commit

    • f63e3eef - Temp: Move permanent_deletion_date to model

    Compare with previous version

  • Zack Cuddy mentioned in merge request !148997 (merged)

    mentioned in merge request !148997 (merged)

  • Zack Cuddy added 4 commits

    added 4 commits

    • 6b0a6371 - Group_Project - permanent_deletion_date to model
    • 038f7c30 - Organizations API - Delayed group deletion
    • fbae4740 - Changes based on FE feedback
    • 1b676208 - Changes based on BE feedback

    Compare with previous version

  • Zack Cuddy changed the description

    changed the description

  • Zack Cuddy changed target branch from master to zcuddy-abstract-deletion-date-to-group-project-model

    changed target branch from master to zcuddy-abstract-deletion-date-to-group-project-model

  • Ivane Gkomarteli
  • Ivane Gkomarteli
  • Ivane Gkomarteli approved this merge request

    approved this merge request

  • Ivane Gkomarteli requested review from @robotmay_gitlab and removed review request for @ivaneG

    requested review from @robotmay_gitlab and removed review request for @ivaneG

  • Zack Cuddy added 4 commits

    added 4 commits

    • 0ca96792 - 1 commit from branch zcuddy-abstract-deletion-date-to-group-project-model
    • ab041cbc - Organizations API - Delayed group deletion
    • ad6da519 - Changes based on FE feedback
    • 8f77d337 - Changes based on BE feedback

    Compare with previous version

  • Zack Cuddy added 1 commit

    added 1 commit

    • 72615987 - Changes based on BE feedback

    Compare with previous version

  • Looking now :eyes:

  • Enrique Alcántara approved this merge request

    approved this merge request

  • Zack Cuddy deleted the zcuddy-abstract-deletion-date-to-group-project-model branch. This merge request now targets the master branch

    deleted the zcuddy-abstract-deletion-date-to-group-project-model branch. This merge request now targets the master branch

  • Zack Cuddy marked the checklist item Merge target MR: !148997 (merged) as completed

    marked the checklist item Merge target MR: !148997 (merged) as completed

  • Zack Cuddy added 279 commits

    added 279 commits

    Compare with previous version

  • Zack Cuddy removed review request for @kpalchyk

    removed review request for @kpalchyk

    • Author Maintainer
      Resolved by Robert May

      Target branch just merged, looks like we lost the approvals :cry:


      At this point I believe we are just awaiting backend maintainer review @robotmay_gitlab.

      Please let me know if you have any questions, sorry for the jumpiness of this MR it had a few iterations :bow:

  • Zack Cuddy changed the description

    changed the description

  • Robert May resolved all threads

    resolved all threads

  • Robert May approved this merge request

    approved this merge request

  • Robert May resolved all threads

    resolved all threads

  • Robert May enabled an automatic merge when the pipeline for 9fef8b5d succeeds

    enabled an automatic merge when the pipeline for 9fef8b5d succeeds

  • merged

  • Robert May mentioned in commit 00cad7ae

    mentioned in commit 00cad7ae

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading