Skip to content

Move clear_consumed_relations logic to main consume_relation method"

Nikola Milojevic requested to merge 268276-move-clear-consumed-relations into master

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

Availability and Testing

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

Merge request reports