Skip to content

On-call: edit user overrides, and one person's overrides may not overlap (#7630, #7631) - #7770

Merged
simlarsen merged 25 commits into
mainfrom
claude/user-overrides
Nov 14, 2026
Merged

simlarsen merged 25 commits into
mainfrom
claude/user-overrides

Conversation

@simlarsen

@simlarsen simlarsen commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7630, Closes #7631

What changes

Edit a user override (#7631). Every list of overrides has an Edit: a policy's User Overrides tab, the project's User Overrides page (global ones), and the Active overrides card on a schedule's Layers page. It opens the same dialog as Add User Override, filled in:

  • Who covers? can change until the override ends (or be cleared, for a skip).
  • Starts can be moved until it starts; once it is under way, it is shown and locked, and Ends says how to end it now.
  • Ends can be moved until it ends, never into the past.
  • Who is away? is shown and locked (and its column takes no update).
  • An override that has ended cannot be changed: its Edit is locked and says why.

Editing takes the same rights as adding (Edit On-Call Policy User Override, and the project-wide grant for a global override), and the server checks every rule above, whatever sends the edit (the API's PUT /api/on-call-duty-policy-user-override/:id too). Each refusal of an edit is a sentence that says what to do next, for example:

An override has to end after it starts. Pick an end time later than its start time.

Each edit of a policy's override writes one User Override changed entry to the policy's feed (and its chat updates), saying what changed.

One person's overrides may not overlap (#7630). The server refuses an add or an edit that overlaps another override of the same person in the same scope (both on one policy, or both global), naming the other one in the caller's time zone, then what to do:

Jane Doe is already covered by Bob Lee on this policy from Nov 13, 2026, 1:00 PM UTC to Nov 13, 2026, 5:00 PM UTC. Change the times, or edit that override.

  • Back to back is fine: one may end as the next starts.
  • A policy's own override over a global one is allowed; the dialog says that on that policy the policy's own is used, and the global one everywhere else.
  • The dialog says it as soon as the times are picked, under Ends, with Edit that override.
  • The check and the write are one transaction under the project's lock on override times (ProjectLimitLock, user-override-times): adds through getCreateLimit, edits through a new DatabaseService.getUpdateLimit hook. Two writes that would overlap cannot both pass.
  • Overlaps saved before the rule are not changed. Lists mark them Overlaps, and the mark says which one is used: the one that names who covers over a skip, then the one that starts first, then the one added first. Paging and the schedules follow that order; both now break a tie of start times by which was added first. Where such overlaps put several in the way of new times, the refusal and the dialog both name the one used first.

Mobile. The Get cover sheet shows the refusal whole and stays open; with several policies ticked, the refusal starts with that policy's name. (Editing on the phone is a follow-up.)

Docs and words. The User Overrides docs page has an Edit an override section, the overlap rule and marks, the Edit permission and the API's PUT, in all 17 languages. Every new Dashboard word is in all 17 Dashboard languages.

Tests

  • Server: OnCallDutyPolicyUserOverrideEdit, OnCallDutyPolicyUserOverrideOverlap, OnCallDutyPolicyUserOverrideGlobalAccess, DatabaseServiceUpdateLimit, WriteStepRecordedGuard, and the rules in UserOverrideEdit / UserOverrideOverlap.
  • Real Postgres: UserOverrideOverlapPostgres (Postgres Schema Drift, shard 1). Twelve overlapping adds, held until all passed their checks, save exactly one; an add and an edit, or two edits, that overlap only with each other cannot both pass (racing freely, or with one held inside its lock); back to back, other people, other policies, global beside a policy's and another project all save. Without the advisory lock, or without the edit's check, the racing cases fail.
  • Dashboard: UserOverrideEditAndOverlapPages (the three lists, the dialog, the live notice, the marks), UserOverrideEditForm, UserOverrideFormGuard, UserOverrideWordsInEveryLanguage (every new word in every language, filled sentences, German, Arabic and Japanese renders), UserOverrideDarkMode (every colour the change draws with is one Theme.css re-colours for the dark theme).
  • Docs: OnCallAdministrationDocsFacts holds the page to the model, the edit rule, the service and the forms; the translations suites hold all 16 translations line for line.
  • Mobile: CreateOnCallOverrideScreen (the refusal whole, the policy named when several are ticked).
  • Suites that follow the change: OnCallShiftConfigPropagation (an edit carries forward pairs and before), LongFormStepsGuard (the dialog moved to UserOverrideFormModal), DashboardComponentsMRTranslation.

Checked locally

After merging the newest main, which now holds #7751 (a schedule's layers saved at once). Main's changes met this branch's files only in the Dashboard locale files, at their end (each is main's file, key for key, followed by this branch's 28 keys), in the Postgres drift workflow, which keeps both new steps, and in OnCallAdministrationDocsFacts, where main's new facts sit beside this branch's.

  • Type checks, part by part as npm run compile-tests runs them with its 8 GiB heap: server-utils, app-rest, app-dashboard-a-m, ui and rest have no errors; server has one, from main (below).
  • Dashboard i18n: i18n:check finds every locale file sound with no translation lost, and i18n:extract finds nothing new.
  • OpenAPISpec (main's newest additions with this branch's model): 50 tests pass.
  • Guards: all 239 Common guard suites pass (14,119 tests); 55 of the 58 App guard suites pass (1,711 tests), and EmailDividerGuard, OidcEgressGuard and SmtpEgressGuard need App packages this checkout does not install.
  • ESLint and Prettier on every TypeScript file this branch changes: no problems.
  • Every on-call, user override and schedule layers suite in Common, server and Dashboard, with the suites the change reaches and main's newly changed ones that import a module it changes: 335 suites and 11,561 tests pass (the Postgres ones skip here without their database).
  • Docs and App wiring: the on-call docs facts and translations, every docs translation and its status, the on-call schedules docs page, the Dashboard words and the on-call test page wiring: 8 suites, 1,619 tests pass.
  • Real Postgres (a throwaway container, migrated to head with no schema drift; main has added no migration since): UserOverrideOverlapPostgres 8 of 8, and feat(on-call): changes to a schedule's layers wait for Save changes, then save in one go #7751's ScheduleLayersSavePostgres 7 of 7, pass.
  • Mobile: CreateOnCallOverrideScreen under jest-expo, ios and android: 136 tests pass.

PR CI was not waited for.

Failures seen on main

One check failed on main as merged here; this PR touches no file it names, and main has since fixed it (ac8e7b9).

  • Type check, server part: Tests/Server/API/PrometheusAPIRoutes.test.ts(182,27) TS2345, a mock of executeQuery that takes only a Statement (SQL / PromQL queries #6796).

UI review

Every surface this PR adds or changes was rendered from the branch's own components: a policy's User Overrides tab and the global page, the Add and Edit dialogs with the overlap notice under Ends (a conflict, a global override under a policy's own, Edit that override, a save the server refuses), the schedule's user overrides card, the Overlaps marks and their tooltips, a locked Edit, and the policy feed. Each at 1280 and 390 px, light and dark, in English, German and Arabic, for a reader with every right, one limited to a label, and one who may only read. Fixed in this review:

  • Starts said its column's description, in English, in every language. Editing an override that has not started, the field's empty description fell back to the model's: "When the override starts sending the Override User's alerts to the Route Alerts To User...". It now says "Pick any time from now on. Once the override starts, its start can't be changed." in all 18 Dashboard languages, and UserOverrideEditForm holds every row of the Add form and of both Edit forms to words of their own.
  • Who is away? in the Edit dialog is the person alone. It showed a greyed Change button for a change the line above it says is not made there. A people picker field can now be read-only (PeoplePickerFieldConfig.isReadOnly, the picker's existing readOnly).
  • A dialog no longer starts its focus on a read-only field. Editing an override under way opened with the caret in its locked Starts. A dialog now starts on the first field that can be changed (Ends, there); Tab still reaches the read-only one, and a dialog with nothing else still starts on it (Modal: pickInitialFocusElement and the late-form watcher, isReadOnlyField).
  • The overlap notice and the Overlaps marks write times as the lists do, "Sat, Nov 14, 01:25": no zone, which Starts, Ends and the lists already say, and no year in the current year. On the schedule card they are in the schedule's zone, as its rows are.
  • The Overlaps mark has its own icon (two stacked squares), not the warning triangle of the "Only for " pill beside it on the schedule card; a changed override's feed entry draws an edit pencil rather than the added one's arrow.
  • The policy feed's filter names "User Override Changed" in every language: FeedOptionsLocales failed on the new feed kind.
  • App's I18nExtractStrings failed: it pins the extractor's source roots, and this branch added two (UserOverrideOverlap.ts, UserOverrideEdit.ts). It names them now.

Looked at and kept: the red conflict box with its link, the amber Overlaps pill, the locked Edit with its reason on hover (an ended override, a reader without the permission, a label-limited reader on a global override), and the server's refusal shown under Ends. Nothing scrolls sideways at 390 px.

Checked after merging the newest main (384d577). Main's changes met this branch's only in the Dashboard locale files, which merged cleanly: all 18 parse, hold the same keys in the same order, and round-trip unchanged.

  • Common: the user override, overlap, on-call layer and schedule override suites, Modal and its late-form focus, every people picker suite, the suites that check focus beside a read-only field, the Dashboard runtime locales and the Arabic guards: 58 suites, 1,476 tests pass. All 239 Common guard suites pass (14,119 tests).
  • App: the i18n, user override, on-call and guard suites, and every other App suite that reads a file this PR changes: 137 suites, 8,251 tests pass.
  • Each new test fails with its fix taken out: the empty Starts description (3 tests), the picker's read-only wiring (the Edit page test), and the read-only focus rule (3 Modal tests).
  • Type checks of the changed tests and the components they reach under Common's test config, and of the changed Dashboard components under the Dashboard's own: no errors.
  • Dashboard i18n: i18n:extract finds nothing new, i18n:check finds every locale sound with no translation lost (Arabic: 0 left).
  • Prettier on every TypeScript file the PR changes and on the locale files, and ESLint per tsconfig on the same files: no problems. The two MobileApp files could not be linted in this checkout, which has no MobileApp packages; this review changed neither.

Follow-ups filed: #7897 (edit an override from the mobile app), #7898 (the Skip until... dialog says an overlap as the times are picked), #7899 (End now for an override under way).

Merge order

It is meant to merge after #7655 (minute pickers), which is in main now and merged in here, as is #7751 (a schedule's layers saved at once). This PR left the Layers page's own files to #7751; the Skip until dialog there does not yet say an overlap as the times are picked, as the Add dialog now does (#7898). #7746 (on-call chat updates, #7549) adds ON_CALL_DUTY_POLICY_FEED_UPDATE_KINDS, a record over every on-call feed kind: whichever of the two merges second adds UserOverrideChanged to it as Overrides, or that table no longer type-checks. #7746 also gives the added and removed entries a one-line chat text (OnCallChatText); the changed entry here should get one too.

🤖 Generated with Claude Code

valeriamustafaeva and others added 11 commits November 13, 2026 14:36
…first: the override dialog's pickers hold minutes)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… are picked (#7630, #7631)

The one Add/Edit dialog (UserOverrideFormModal) for the User Overrides
tables and a schedule's active overrides card; the overlap notice under
Ends with Edit that override; Overlaps marks on legacy overlaps; tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… mark reads out once, the note is valid HTML (#7630, #7631)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#7630, #7631)

The User Overrides page gains an Edit an override section (who covers,
when it starts and ends; who is away stays; an ended override is locked),
says that two overrides of one person on one policy, or both global, may
not overlap (back to back is fine; policy over global is allowed and the
page says which is used), how overlaps saved before the rule are marked,
the Edit permission, and the API's PUT. All 16 translations follow line
for line; the facts suite holds the page to the model, the edit rule, the
service and the forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n several are ticked (#7630)

The server now refuses an override that overlaps another of the same
person in the same scope, in a sentence that says who covers them and
when. The phone's Get cover sheet shows that sentence as the server words
it and stays open; with several policies ticked, the refusal of one of
them starts with that policy's name, since the server's own words say
only "this policy".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Postgres (#7630)

UserOverrideOverlapPostgres races adds and edits through the real
override service on a migrated Postgres (every table cloned into a schema
of its own): twelve overlapping adds of one person, on one policy or all
global, held until every one has passed its checks, save exactly one and
the rest are refused naming it; an add and an edit, or two edits, that
overlap only with each other cannot both pass, free racing or with one
held inside its lock while the other tries; back to back, other people,
other policies, global beside a policy's and another project all save.
Without the advisory lock, or with the edit's check dropped, the racing
cases fail.

Runs in the Postgres Schema Drift workflow's shard 1, opted in with
RUN_POSTGRES_USER_OVERRIDE_OVERLAP_TESTS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nal types (#7630, #7631)

compile-tests' parts hold Dashboard files to exactOptionalPropertyTypes:
Starts, edited before it starts, says nothing but the time zone with an
empty description rather than an undefined one, and Ends always has its
footer, which draws the dialog's overlap notice when one is handed in and
nothing otherwise. The M-R translation test's override rows carry the
override's id and policy the rows now have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Dashboard locale files' tails conflicted (main's PromQL and Twilio
words, the branch's override edit and overlap words): main's keys first,
then the branch's, in all 18 files, the same keys in the same order.
Main brings #7655 (minute pickers), which this branch builds on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…override edit (#7630, #7631)

An override edit carries forward the people each override named and its
times before the edit (pairs and before), so OnCallShiftConfigPropagation
reads the people from pairs. The Add User Override form moved from the
table into UserOverrideFormModal, which also edits one: LongFormStepsGuard
lists it there, with why it is one page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@simlarsen

simlarsen commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

valeriamustafaeva and others added 12 commits November 13, 2026 18:52
… to do (#7631)

ErrorMessagesGuard holds each file to no more messages that are not
sentences than it had. The edit's four refusals repeated the add's
("Start time must be before end time" and the rest); they now say what
happened and what to do next: an override has to end after it starts,
always has both times, and the person away cannot cover for themselves.
The add's own messages are as they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Dashboard locale files met at their tail again: main's 12 new keys
first, then this branch's 28, so every locale keeps en.json's keys in
en.json's order (51825 keys each).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the dark theme (#7630, #7631)

Theme.css re-colours the light utility classes under html.dark, one rule
per class; a class without one keeps its light colour and nothing fails.
UserOverrideDarkMode holds the dialog, the notice under Ends (red for an
overlap, grey for a note), the lists' Overlaps mark (amber) and the Edit
on the lists and the Active overrides card to what Theme.css remaps, with
no dark: variant and no colour built from a template. An unmapped colour
on the mark, or a dark: variant on the notice, fails it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's translation fixes changed values inside the Dashboard locale
files; they merged on their own. The branch's 28 keys stay at the tail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's Twilio account description ends each Dashboard locale file now;
the branch's 28 keys follow it at the tail, in en.json's order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e dialog does (#7630)

Where overrides saved before the rule put both a skip and an override
that names who covers in the way of new times, the server named the one
that starts first, while the dialog's notice and the Overlaps marks name
the one used there. The server now reads the overrides in the way and
names the one used first: one that names who covers over a skip, then
the one that starts first, then the one added first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's exception breadcrumb words now come before the Twilio account
description at the tail of each Dashboard locale file; the branch's 28
keys follow them, in en.json's order. Every locale file is main's, key
for key, plus those 28.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#7630, #7631)

The suite keeps console.error to pass on what is not a nesting warning,
as the other suites that watch for them do: with the rule switched off
for that one line, and a word on why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's new words (the Layers page's save bar among them) end each
Dashboard locale file now; the branch's 28 keys follow them, in en.json's
order. Every locale file is main's, key for key, plus those 28. The
drift workflow keeps both new Postgres steps: the schedule layers save
(shard 3) and the user override overlap (shard 1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's new words end each Dashboard locale file now; the branch's 28
keys follow them, in en.json's order. Every locale file is main's, key
for key, plus those 28. Main's new on-call docs facts merge beside the
branch's in OnCallAdministrationDocsFacts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a field that can change

UI review of editing user overrides and refusing overlaps (#7630, #7631):

- Starts of an override not started yet said its column's description,
  "When the override starts sending the Override User's alerts to the
  Route Alerts To User", in English in every language: its empty
  description fell back to the column's. It now says what it may be moved
  to, in all 18 Dashboard languages, and a test holds every row of the Add
  form and both Edit forms to words of their own.
- Who is away in the Edit dialog is the person alone: a locked Change
  button offered what the description says is not made there. A people
  picker field can now be read-only (PeoplePickerFieldConfig.isReadOnly).
- A dialog no longer starts its focus on a read-only field - an override
  under way opened with the caret in its locked Starts. The first field
  that can be changed comes first; Tab still reaches the read-only one.
- The overlap notice and the Overlaps marks write times as the lists do:
  Sat, Nov 14, 01:25 - no zone, which the dialog and the lists already
  say, and no year while it is this year.
- The Overlaps mark draws two stacked squares instead of the warning
  triangle the policy-scope pill beside it uses; a changed override's feed
  entry draws an edit pencil instead of the added one's arrow.
- The policy feed's filter names User Override Changed in every language
  (FeedOptionsLocales failed on it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
valeriamustafaeva and others added 2 commits November 13, 2026 23:53
…erlap and edit words

This branch reads two more files for the Dashboard's keys
(UserOverrideOverlap.ts and UserOverrideEdit.ts, #7630 and #7631), and
App's I18nExtractStrings pins the list of source roots: it failed on the
two it did not name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@simlarsen
simlarsen merged commit d85d840 into main Nov 14, 2026
2 of 88 checks passed
@simlarsen
simlarsen deleted the claude/user-overrides branch November 14, 2026 00:21
simlarsen pushed a commit that referenced this pull request Nov 14, 2026
Brings in main up to d85d840: user overrides that can be edited
(#7770: #7630, #7631), owner and on-call policy conditions (#7554,
#7582, #7583), the paging docs (#7596) and the rest.

Conflicts, each kept both ways:
- WorkspaceNotificationRule's description keeps the API's account of
  updatesToPost and its on-call kinds, and adds main's sentence that
  owner and on-call policy conditions name people, teams and policies of
  this project by ID. The rule form hides the column's description
  (hideColumnDescription), so its length is the API reference's.
- WorkspaceNotificationRuleService checks a new rule's updatesToPost and
  then, as main does, the IDs its conditions name.
- OnCallDutyPolicyUserOverrideService imports main's FeedMarkdown with
  this branch's OnCallChatText and WorkspaceMessageTime.
- The Dashboard locale files keep both sides' keys, each once
  (i18n:extract makes no change; i18n:check passes).

main's new OnCallDutyPolicyFeedEventType.UserOverrideChanged is mapped
to the User overrides update, as added and removed are:
ON_CALL_DUTY_POLICY_FEED_UPDATE_KINDS is a Record of every entry type,
so the merge needs it to compile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
simlarsen pushed a commit that referenced this pull request Nov 14, 2026
…olicy's channels too (#7549)

#7770 (#7630, #7631) lets an override be edited, and the edit writes a
User Override Changed entry in the policy's feed, which its chat channels
were sent as written: "Changed a User Override Rule for user ... All
alerts will be routed to ... from ... to ... Changed: who covers (it was
...)", each time in the zones of both people.

The channels now hear the override as it is now, said as an added one
is, each moment in the reader's own zone:

  ✏️ Changed an override on Payments: @Carol covers for @jane from
  tomorrow at 9:00 AM to tomorrow at 5:00 PM.

What it was stays in the policy's feed. The line is posted under the
User overrides update (the merge mapped the entry there), so the box's
words now say "Overrides added, changed and taken back", in all 18
Dashboard languages, and so does the Slack docs' table of on-call
updates, in all 17 languages. OnCallChatText's added and changed lines
share one wording of who covers for whom.

Tests: the exact changed line with a cover, without one and with an
empty name (OnCallHandoffPosts); what the real edit posts to the
channels - a new cover, a cover taken off, new times, nothing for an
edit that changes nothing or a global override's - and that the feed
keeps what it was (OnCallDutyPolicyUserOverrideEdit); the entry is a
User overrides update, and the override service gives each of its three
entries a short line (FeedUpdateKinds). Mutation-checked: mapping the
entry elsewhere, leaving it unmapped, dropping its line and swapping
who covers each fail them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Allow editing existing user overrides Missing validation: System allows overlapping user overrides for the same user

1 participant