Skip to content

Add filters, server-side sort, and test incident hiding to incidents tables - #182

Merged
kwent merged 3 commits into
masterfrom
feat/incidents-page-filters
Oct 11, 2026
Merged

kwent merged 3 commits into
masterfrom
feat/incidents-page-filters

Conversation

@kwent

@kwent kwent commented Oct 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds filters, server-side sorting, and test incident hiding to the incidents tables (RootlyPage Incidents tab and RootlyIncidentsPage entity tabs).

Closes #47
Closes #48
Closes #49

Filters (#47)

  • New filter bar above the table: Status, Severity, Teams, Services, Environments (multi-select autocompletes, options searched through the Rootly API), plus Clear filters.
  • Filters are sent to GET /v1/incidents as filter[status], filter[severity_id], filter[team_ids], filter[service_ids], filter[environment_ids], so they apply across every page.
  • Filters a page already fixes through params are hidden. The Rootly API ORs all relationship filters (environments, services, functionalities, teams, ...) together, so on entity pages scoped to a service, functionality, team or system the team/service/environment filters are hidden: adding one would widen the results instead of narrowing them. On the global page, a caption explains that several relationship filters match any selected item.
  • Ongoing-incident tables on entity pages pass showFilters={false} to stay compact.

Server-side sort (#48)

  • The table now uses Material Table remote data: page, page size and sort are sent to the Rootly API (sort=-started_at by default).
  • The Started At, Mitigated At (new) and Resolved At (new) columns are sortable. The API only sorts on created_at, updated_at, started_at, in_triage_at, mitigated_at and resolved_at, so the other columns are no longer clickable. Before, clicking them only re-sorted the current page.
  • Changing search, filters or the test toggle refetches from page 1 and keeps the current sort.

Test incidents (#49)

  • Test incidents are hidden by default with filter[kind][not_in]=test,test_sub.
  • New per-organization config rootly.<org>.showTestIncidents (@visibility frontend) lists them by default, for example in a sandbox account.
  • A Show test incidents toggle in the filter bar overrides the default for the session.

Also

  • Fixes the functionality incidents tables sending filter[functionalitys] and the system tables sending filter[groups]. Neither is a supported filter, so those tables were not scoped. They now send functionalities and teams.
  • Search input is debounced (300ms) before it reaches the API.
  • resolveRootlyOrganizationKey / useRootlyInstanceSettings helpers in src/api.ts resolve the active rootly.<key> block (explicit, then isDefault, then the first entry).
  • Fixes a race in the overview card test: the card briefly renders "No ongoing incidents" before the resource loads, which made the test flaky.
  • README documents the configuration options, test incidents and the filter/sort behavior. CHANGELOG has an Unreleased entry.

Notes

  • @rootly/backstage-plugin-common has no public severities or environments methods yet. Those two option lists go through the client's authenticated fetch (/v1/severities, /v1/environments), with a guard that returns no options if it is unavailable. Follow-up: add getSeverities / getEnvironments to the common package.
  • RootlyIncidentsFetchOpts has no sort field. The extra sort key goes through the common client's qs.stringify unchanged.

Test plan

  • yarn tsc
  • yarn lint (no new errors; 2 new warnings for import React, same pattern as the rest of the codebase)
  • yarn test: 134 tests pass, including 10 consecutive full runs
  • New unit tests for query building, filter options, the filter bar, instance settings and the config schema
  • Integration test against the real Backstage/Material Table remote data (sort header clicks, sort kept across pages)

kwent added 3 commits October 11, 2026 10:45
The card briefly renders "No ongoing incidents" before the resource
has loaded, so findByText could return a node that is then replaced.
…tables

- Filter bar with status, severity, teams, services and environments,
  sent to the Rootly API as filter[...] params so filters apply across
  all pages. Filters already fixed by an entity page are hidden.
- Material Table remote data: page, page size and sort are sent to the
  Rootly API (sort=started_at / mitigated_at / resolved_at). Columns the
  API cannot sort on are no longer sortable.
- Hide test incidents by default with filter[kind][not_in]=test,test_sub.
  New per-organization showTestIncidents config option and a UI toggle.
- Fix functionality and system tables sending unsupported filter keys.
Replace the private fetch workaround with RootlyApi.getSeverities and
RootlyApi.getEnvironments, and use the typed sort option on getIncidents.
@kwent
kwent force-pushed the feat/incidents-page-filters branch from 4b1fffd to 74a3bfd Compare October 11, 2026 08:45
@kwent
kwent merged commit 2a80a2f into master Oct 11, 2026
3 checks passed
@kwent
kwent deleted the feat/incidents-page-filters branch October 11, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant