fix(aci): Change open period range boundary to inclusive
Some issues have the same regression/resolution time in our db and the range boundary today would reject those as valid start/end times for open periods. Updating the boundary to be inclusive on both ends should fix this and allow an open period to start at the same time that the previous one ends.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## master #93535 +/- ##
========================================
Coverage 88.03% 88.04%
========================================
Files 10325 10330 +5
Lines 595677 596288 +611
Branches 23134 23134
========================================
+ Hits 524411 524989 +578
- Misses 70773 70806 +33
Partials 493 493
Hm ADD CONSTRAINT EXCLUDE is an unsafe operation -- we can wipe the table and pause writes before applying this if that would make it safe? Otherwise the safer suggestion is to make a new table 🤔
Talked to @wedamija - we'll turn off the ff for writes and run the post-deploy migration to delete rows before running this migration with SafeRunSQL.
This PR has a migration; here is the generated SQL for src/sentry/migrations/0927_make_open_period_range_boundary_inclusive.py
for 0927_make_open_period_range_boundary_inclusive in sentry
--
-- Custom state/database change combination
--
ALTER TABLE "sentry_groupopenperiod" ADD CONSTRAINT "exclude_overlapping_date_start_end" EXCLUDE USING GIST ("group" WITH =, (TSTZRANGE("date_started", "date_ended", '[]')) WITH &&);
--
-- Remove constraint exclude_overlapping_start_end from model groupopenperiod
--
ALTER TABLE "sentry_groupopenperiod" DROP CONSTRAINT "exclude_overlapping_start_end";
This PR has a migration; here is the generated SQL for src/sentry/migrations/0930_make_open_period_range_boundary_inclusive.py
for 0930_make_open_period_range_boundary_inclusive in sentry
--
-- Custom state/database change combination
--
ALTER TABLE "sentry_groupopenperiod" ADD CONSTRAINT "exclude_overlapping_date_start_end" EXCLUDE USING GIST ("group_id" WITH =, (TSTZRANGE("date_started", "date_ended", '[]')) WITH &&);
--
-- Remove constraint exclude_overlapping_start_end from model groupopenperiod
--
ALTER TABLE "sentry_groupopenperiod" DROP CONSTRAINT "exclude_overlapping_start_end";