Skip to content

Destroy related adherences for project on destroy

What does this MR do and why?

Destroy related adherences for project on destroy

  • Adhereneces have a not-null constraint on project_id hence they need to be destroyed along with the project explicitly.

  • This change was based off of: !174996 And avoids needing to change the DB in the same MR to make it easier to review and reduce potential impact.

  • Explicitly disabled CodeReuse/ActiveRecord to make use of where to avoid the delete_all for related adherences to trigger the not-null clause, when used through the project model. Wasn't able to fully determine the root cause of this distinction. The specs test for a the same query given and both calls pass this. I avoided going deeper into the error and opted for this pragmatism.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Create a group in ultimate plan
  2. Create project
  3. Add standards adherences to project
  4. Destroy group or just project
Edited by Sam Figueroa

Merge request reports

Loading