Skip to content

Don't change escalations if neither status nor policy changed

Peter Leitzen requested to merge pl-incident-system-note-any-change into master

What does this MR do and why?

This fixes a bug where a system note was emitted with policy on any change.

Found during !100028 (diffs, comment 1125049757).

Screenshots or screen recordings

Before After
Screenshot_from_2022-10-05_18-01-18 Screenshot_from_2022-10-05_18-14-12

How to set up and validate locally

Visually

  1. Add escalation policy
  2. Create incident manually
  3. Assign an Escalation Policy from the sidebar dropdown
  4. 👁 See system note YOU paged escalation policy NAME just now
  5. Change unrelated/arbitrary issue attributes
    • Assign Severity
    • Change Title
    • ...
  6. 👁 No system notes about escalation policy
  7. Resetting Escalation Policy still emits a policy system note

Spec

# Passes
bin/rspec ee/spec/services/ee/incident_management/issuable_escalation_statuses/after_update_service_spec.rb

# Back to master
git checkout master -- ee/app/services/ee/incident_management/issuable_escalation_statuses/after_update_service.rb
# This fails :boom:
bin/rspec ee/spec/services/ee/incident_management/issuable_escalation_statuses/after_update_service_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports

Loading