Skip to content

NMS-20108: On-Call Roles management via versioned REST API and PrimeVue UI - #8702

Closed
joseanesONMS wants to merge 4 commits into
OpenNMS:developfrom
joseanesONMS:jira/NMS-20108-oncall-roles-pr
Closed

NMS-20108: On-Call Roles management via versioned REST API and PrimeVue UI#8702
joseanesONMS wants to merge 4 commits into
OpenNMS:developfrom
joseanesONMS:jira/NMS-20108-oncall-roles-pr

Conversation

@joseanesONMS

Copy link
Copy Markdown

Rewrites Admin → On-Call Roles as a PrimeVue page backed by a new versioned REST API, keeping groups.xml as the system of record.

  • Adds admin-only /api/v2/on-call-roles: list/get/create/update/rename/delete plus a computed month calendar that reuses the exact interval resolution notifd uses; time-zone is reported so clients render times in server time.
  • Hand-edited roles round-trip untouched and stay editable: file changes are picked up on read, schedule entries already stored skip new-entry validation, the optional time id attribute is preserved, and a role whose schedule the runtime cannot evaluate reports schedule-error instead of failing the list.
  • New entries are validated and canonicalized to the exact forms BasicScheduleUtils dispatches on (zero-padded widths, English month names, lowercase weekday, unpadded monthly day); overnight begins>ends entries are rejected because the runtime never matches them.
  • The page shows the legacy list columns plus an explicit supervisor-fallback indicator, a month calendar with one-off coverage add/remove (content-matched removal, refetch-before-mutate, confirmation before removing recurring entries), rename/delete with referential warnings, and inline field validation with API errors shown in the dialogs.
  • The admin menu entry now points at the new page. 16 integration tests cover the API; store, validation and dialog behavior are covered by vitest.

Adds an admin-only versioned /api/v2/on-call-roles API over the existing
groups.xml role storage (list/get/create/update/rename/delete plus a computed
month calendar from GroupManager.getRoleScheduleEntries), and a PrimeVue
Manage On-Call Roles page with a schedule calendar and one-off coverage
editor. The admin menu entry now points at the new page.

Roles stay in groups.xml: hand-edited entries (including recurring weekly,
daily and monthly schedules) are picked up on read via GroupManager.update(),
round-trip unmodified, and remain editable; schedule validation applies only
to entries added through the API. New overnight duty entries (begin after
end) are rejected because DutySchedule never matches them at runtime.
Review fixes for the on-call roles API and page. New schedule entries are
canonicalized to the exact forms the scheduler dispatches on (zero-padded
widths, JVM-default-locale month names, lowercase weekly days, unpadded
monthly days), closing the gap where the API accepted entries notifd
silently ignored. The optional time id attribute now round-trips, partial
updates can change supervisor or membership-group independently, and a role
whose schedule cannot be evaluated no longer breaks the whole list response.

The calendar reports the server time zone and the dialog renders and labels
all times in it, so what is entered matches what notifd evaluates. Coverage
edits re-read the stored role before mutating and match removals by content,
narrowing the window where a concurrent edit could be overwritten; removing
a recurring (hand-edited) entry asks for confirmation since this editor
cannot recreate one. Dialogs show API rejections inline like the users and
groups pages.
…rver locale

Formatting with the default locale made specific-schedule writes fail only
in months whose abbreviation breaks the 20-character width (janv. but not
mai), and stored strings the API itself could not re-parse. Dates are now
always stored in the fixed-width Locale.ROOT form; if the default locale
cannot parse that form back, the write is rejected up front with a clear
message, since notifd would silently ignore the entry at runtime.
A role whose stored schedule the runtime cannot evaluate now reports a
schedule-error field instead of silently showing an empty currently-on-call
list, and the roles table renders it as a warning tag — an unevaluable rota
is a notifd outage, not an idle one. The name regex scans for forbidden
characters instead of a newline-bypassable full-string match.
@joseanesONMS
joseanesONMS force-pushed the jira/NMS-20108-oncall-roles-pr branch from 0ac35c5 to 5938f18 Compare July 30, 2026 20:26
@joseanesONMS

Copy link
Copy Markdown
Author

@marshallmassengill could you take a review pass when you get a chance?

@joseanesONMS

Copy link
Copy Markdown
Author

Replaced by #8715 (in-repo branch so CI runs).

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.

1 participant