Skip to content

Sync destruction between requirements and issues

What does this MR do?

First bit of Stage II in #323779 (closed).

Syncs the destruction of Requirements and their associated requirement-type Issues. Note: users can't destroy requirements, but someone using a console can, so I opted to cover all cases as close to the metal as possible.

The foreign key CASCADE DELETE covers deleting the RequirementsManagement::Requirement object when its associated requirement type Issue is destroyed. (note that there aren't really any yet)

To handle the destruction going the other way, we used dependent: :destroy even though the docs prohibit it without express DB expert permission. This is temporary until we migrate all issues over and then destroy the requirements anyway (and we'll be removing the sync before we do that, of course!)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #323779 (closed) and #337190 (closed)

Edited by charlie ablett

Merge request reports