Add default related link restrictions
Related to #424880 (closed)
What does this MR do and why?
This is a follow-up to !133044 (merged) which added a table to store restrictions for work item links. This MR adds the default restrictions that will be supported for the following work item types:
Type | Can be related to | Can block | Can be blocked by |
---|---|---|---|
Epic | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task |
Issue | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task |
Task | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task, Objective, Key Result | Epic, Issue, Task |
Objective | Epic, Issue, Task, Objective, Key Result | Objective, Key Result | Epic, Issue, Task, Objective, Key Result |
Key Result | Epic, Issue, Task, Objective, Key Result | Objective, Key Result | Epic, Issue, Task, Objective, Key Result |
As well as a migration to add the records, these changes include a database importer that populates the restrictions when seeding the default work item types. This is a very similar approach to the one used for hierarchy restrictions.
Database
- UP
❯ bin/rails db:migrate:down:main VERSION=20231005131445
main: == [advisory_lock_connection] object_id: 226640, pg_backend_pid: 51811
main: == 20231005131445 AddWorkItemsRelatedLinkRestrictions: reverting ==============
main: == 20231005131445 AddWorkItemsRelatedLinkRestrictions: reverted (0.0134s) =====
main: == [advisory_lock_connection] object_id: 226640, pg_backend_pid: 51811
- DOWN
❯ bin/rails db:migrate:up:main VERSION=20231005131445
main: == [advisory_lock_connection] object_id: 226740, pg_backend_pid: 52309
main: == 20231005131445 AddWorkItemsRelatedLinkRestrictions: migrating ==============
main: == 20231005131445 AddWorkItemsRelatedLinkRestrictions: migrated (0.0327s) =====
main: == [advisory_lock_connection] object_id: 226740, pg_backend_pid: 52309
How to set up and validate locally
The model validation will be added in a following MR so the unit testing should be sufficient to validate these changes.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugenia Grieff