Skip to content

Validate parent and child depth and cyclic references

Jan Provaznik requested to merge jp-db-validations-depth into master

What does this MR do and why?

Adds hierarchy-sepcific restrictions:

  • checks for cyclic references
  • checks for maxium_depth

Related to #378801 (closed)

DB queries:

Note: we don't support creating multi-level hierarchy yet, queries below are for a random issue task in gitlab/gitlab-org project but there are no ancestors/descendants for it.

To get ancestors/descendants, this MR adds an object hierarchy (lib/gitlab/work_items/work_item_hierarchy.rb, heavily inspired by lib/gitlab/ci/pipeline_object_hierarchy.rb).

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jan Provaznik

Merge request reports

Loading