Move clear_consumed_relations logic to main consume_relation method"
What does this MR do?
Based on the discussion in !41699 (merged),
this MR implements an argument of consume_relation
, mark_as_consumed: true
, which allows us to consume relations without marking them as consumed. This way we can find the closest middle date of all issues and milestones, in order to correct due_dates and start_dates for Sample Data Template
def consume_relation(importable_path, key, mark_as_consumed: true)
And likely rewrite this method a little:
def dates
return unless relation_reader.legacy?
DATE_MODELS.flatten_map do |model|
relation_reader.consume_relation(@importable_path, model, mark_as_consumed: false).map do |model|
model.first['due_date']
end
end
end
Note
We don't need a changelog entry, since this is only developer-facing change.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #268276 (closed)
Edited by Bob Van Landuyt