Commit c07aae5f authored by Robert Speicher's avatar Robert Speicher

Merge branch '294202-updated-at' into 'master'

Resolve "Issue changes with updated_at not properly respected"

See merge request gitlab-org/gitlab!50272
parents fd12d684 a3ec58fa
......@@ -19,7 +19,7 @@ module ResourceEvents
state: ResourceStateEvent.states[state],
close_after_error_tracking_resolve: close_after_error_tracking_resolve,
close_auto_resolve_prometheus_alert: close_auto_resolve_prometheus_alert,
created_at: Time.zone.now
created_at: resource.system_note_timestamp
)
resource.expire_note_etag_cache
......
---
title: Persist updated_at value in state change events
merge_request: 50272
author:
type: fixed
......@@ -30,6 +30,15 @@ RSpec.describe ResourceEvents::ChangeStateService do
expect_event_source(event, source)
end
it "sets the created_at timestamp from the system_note_timestamp" do
resource.system_note_timestamp = Time.at(43).utc
described_class.new(user: user, resource: resource).execute(status: state, mentionable_source: source)
event = resource.resource_state_events.last
expect(event.created_at).to eq(Time.at(43).utc)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment