Update parent link validate_max_children validation
What does this MR do and why?
Related to #451062 (closed)
When migrating epics to work items some parent epics could have more children than the limit set for parent links (100) but we need these links to remain valid after the backfilling. To achieve it, this MR modifies the validation validate_max_children
in WorkItems::ParentLink
model to be performed only when the parent changes so this will cover both create and update actions.
As these changes make the validation more lenient there is no risk involved for existing records.
Changelog: changed
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.
Screenshots or screen recordings
How to set up and validate locally
- Enable feature flag
Feature.enable(:namespace_level_work_items)
- Visit any group work items URL and create a work item epic Parent Epic. E.g.
http://gdk.test:3000/groups/GROUP_PATH/-/work_items/new
- In the
child items
create and add 2 new child issues - Go to your IDE and open the file
app/models/work_items/parent_link.rb
to modify theMAX_CHILDREN
variable. Set a limit of 1. - Back in the browser try to add a new issue to Parent Epic, this should display an error because the limit has been reached
- Verify that the existing 2 children are valid by changing their position in the list (when invalid the update action for reordering would fail)
Merge request reports
Activity
assigned to @egrieff
added backend groupproduct planning sectiondev typemaintenance labels
added devopsplan label
added typefeature label and removed typemaintenance label
2 Warnings b9b71d7e: The commit body should not contain more than 72 characters per line. For more information, take a look at our Commit message guidelines. This merge request does not refer to an existing milestone. Reviewer roulette
Category Reviewer Maintainer backend @syarynovskyi
(UTC+3, 1 hour ahead of author)
@lma-git
(UTC-7, 9 hours behind author)
Please check reviewer's status!
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by Heinrich Lee Yu
@akotte Would you mind taking the first review, please?
requested review from @akotte
added pipeline:mr-approved label
- Resolved by Heinrich Lee Yu
@akotte
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
requested review from @engwan
removed review request for @akotte
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for b9b71d7eexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Plan | 51 | 0 | 2 | 47 | 53 | ✅ | | Verify | 31 | 0 | 1 | 30 | 32 | ✅ | | Package | 19 | 0 | 12 | 19 | 31 | ✅ | | Create | 101 | 0 | 9 | 94 | 110 | ✅ | | Analytics | 2 | 0 | 0 | 1 | 2 | ✅ | | Govern | 66 | 0 | 0 | 43 | 66 | ✅ | | Release | 5 | 0 | 0 | 5 | 5 | ✅ | | Monitor | 7 | 0 | 0 | 7 | 7 | ✅ | | Data Stores | 31 | 0 | 0 | 22 | 31 | ✅ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 313 | 0 | 25 | 268 | 338 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for b9b71d7eexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Plan | 285 | 0 | 23 | 0 | 308 | ✅ | | Create | 183 | 0 | 20 | 0 | 203 | ✅ | | Verify | 10 | 0 | 0 | 0 | 10 | ✅ | | Govern | 28 | 0 | 0 | 0 | 28 | ✅ | | Package | 6 | 0 | 8 | 0 | 14 | ✅ | | Data Stores | 22 | 0 | 0 | 0 | 22 | ✅ | | Monitor | 8 | 0 | 0 | 0 | 8 | ✅ | | Release | 2 | 0 | 0 | 0 | 2 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 544 | 0 | 51 | 0 | 595 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
removed review request for @engwan
enabled an automatic merge when all merge checks for b9b71d7e pass
requested review from @engwan
changed milestone to %17.0
mentioned in commit 758d0385
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added releasedcandidate label
added pipelinetier-3 label
mentioned in issue #463557 (closed)
mentioned in merge request kubitus-project/kubitus-installer!3058 (merged)
added releasedpublished label and removed releasedcandidate label