Skip to content
Snippets Groups Projects
Verified Commit 3a1e6ea4 authored by Marcin Sedlak-Jakubowski's avatar Marcin Sedlak-Jakubowski :palm_tree: Committed by GitLab
Browse files

Merge branch '453986-update-migration-docs' into 'master'

Update work item type migration guidelines

See merge request !148565



Merged-by: default avatarMarcin Sedlak-Jakubowski <msedlakjakubowski@gitlab.com>
Approved-by: default avatarMayra Cabrera <mcabrera@gitlab.com>
Reviewed-by: default avatarMayra Cabrera <mcabrera@gitlab.com>
Co-authored-by: default avatarMario Celi <mcelicalderon@gitlab.com>
parents e0a0dbd2 88596a55
No related branches found
No related tags found
1 merge request!148565Update work item type migration guidelines
Pipeline #1239896346 failed
......@@ -229,6 +229,12 @@ Keep the following in mind when you write your migration:
[post deploy migration](database/post_deployment_migrations.md).
This way, follow-up MRs that depend on the type being created can assume it exists right away,
instead of having to wait for the next release.
**Important:** Because we use a regular migration, we need to make sure it does two things:
1. Don't exceed the [time guidelines](migration_style_guide.md#how-long-a-migration-should-take) of regular migrations.
1. Make sure the migration is [backwards-compatible](multi_version_compatibility.md).
This means that deployed code should continue to work even if the MR that introduced this migration is
rolled back and the migration is not.
- Migrations should avoid failures.
- We expect data related to `work_item_types` to be in a certain state when running the migration that will create a new
type. At the moment, we write migrations that check the data and don't fail in the event we find
......@@ -251,13 +257,18 @@ Keep the following in mind when you write your migration:
- Similarly to the `Hierarchy` widget, the `Linked items` widget also supports rules defining which work item types can be
linked to other types. A restriction can specify if the source type can be related to or blocking a target type. Current restrictions:
| 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 |
| 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 |
- Use shared examples for migrations specs.
There are different shared examples you should use for the different migration types (new work item type, new widget definition, etc) in
[`add_work_item_widget_shared_examples.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/14c0a4df57a562a7c2dd4baed98f26d208a2e6ce/spec/support/shared_examples/migrations/add_work_item_widget_shared_examples.rb).
##### Example of adding a ticket work item
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment