Skip to content

Simplify require_type_on_refinement

Jennifer Li requested to merge jennli-event-type_label_added into master

What does this MR do and why?

Simplifies the logic in require_type_on_refinement processor to only look at event.type_label_set?.

Closes #1279 (closed).

Why I chose to refactor

I realized that the added_label_names method is defined as

 def added_label_names
    @added_label_names ||= current_label_names - previous_label_names
  end

And current_label_names is always included in the array which the type_label_set? method looks at, ie event.current_label_names == event.label_names.

So I feel there is no need for the || condition as both will always evaluate to the same result.

Expected impact & dry-runs

These are strongly recommended to assist reviewers and reduce the time to merge your change.

See https://gitlab.com/gitlab-org/quality/triage-ops/-/tree/master/doc/scheduled#testing-policies-with-a-dry-run on how to perform dry-runs for new policies.

See https://gitlab.com/gitlab-org/quality/triage-ops/-/blob/master/doc/reactive/best_practices.md#use-the-sandbox-to-test-new-processors on how to make sure a new processor can be tested.

Action items

Edited by Jennifer Li

Merge request reports