Project deletion and usage quota management

Problem

We need to define how soft-deleted (pending deletion) groups and projects affect usage quotas and how restoration is handled with respect to quota limits.

Currently:

  • We don't have a clear policy on whether projects pending deletion should count towards usage quotas
  • When restoring groups or projects, we don't check if the restoration would put users over their quota limits

Proposals

Option 1: Block restore if it exceeds quota

  • Don't count soft-deleted projects towards usage quotas
  • When trying to restore a project/group, check if restore would result in exceeding the storage limit
  • If quota would be exceeded, throw an error explaining the situation
  • Require users to increase their storage limit before restoration is permitted

Option 2: Allow restoration regardless of quota

  • Don't count soft-deleted projects towards usage quotas
  • Allow restoration even if it puts the user over quota
  • Projects/groups exceeding quota limits would enter a read-only state after restoration

Option 3: Items pending deletion still count towards usage quota

  • Soft-deleted groups or projects count towards usage quotas until they are permanently deleted

Implementation Considerations

  • Need to modify restoration logic to check expected usage after restoration
  • Current usage recalculation happens after restore, which doesn't prevent quota issues
  • Decision needed on whether to implement quota checking as part of the restore action

Decision

Items pending deletion will continue to count towards usage quotas (option 3). This was documented in gitlab-com/content-sites/handbook!13312 (merged).

Edited by Christina Lohr