Skip to content

Add outdated index entity table to "Check indices" modal - #26966

Open
gally47 wants to merge 7 commits into
masterfrom
incompatible-indices-table-in-modal
Open

Add outdated index entity table to "Check indices" modal#26966
gally47 wants to merge 7 commits into
masterfrom
incompatible-indices-table-in-modal

Conversation

@gally47

@gally47 gally47 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

/nocl

Description

Reuses the incompatible indices management table in the “Check index versions” modal, providing a consistent workflow for identifying and resolving indices that block OpenSearch upgrades.

Reindex actions are shown only when supported by the configured search backend, with guidance for migrating to Data Nodes when required.

Motivation and Context

fixes https://github.com/Graylog2/graylog-plugin-enterprise/issues/14965

Screenshots (if appropriate):

Screenshot 2026-08-13 at 17 10 38

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@gally47 gally47 self-assigned this Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the “Check index versions” modal to reuse the existing incompatible/outdated indices table and related actions, aligning the upgrade workflow across the indices and Data Node OpenSearch upgrade areas. It also introduces reindex action availability gating based on the configured search backend, with guidance for Data Node migration when needed.

Changes:

  • Replaced the modal’s bespoke incompatible-index listing with the shared IncompatibleIndicesTable and added local (non-URL) pagination state for modal usage.
  • Expanded the incompatible indices feature to support backend-dependent reindex availability and Data Node migration hints.
  • Added supporting hooks/utilities for fetching outdated indices, tracking selection across pagination, and tracking pending archive/reindex actions.

Reviewed changes

Copilot reviewed 15 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
graylog2-web-interface/src/components/indices/IncompatibleIndicesModal.tsx Reuses shared incompatible indices table inside the modal and adjusts modal layout.
graylog2-web-interface/src/components/indices/IncompatibleIndicesModal.test.tsx Adds coverage ensuring the modal renders the table with local pagination state.
graylog2-web-interface/src/components/indices/incompatible-indices/telemetry.ts Centralizes telemetry defaults for incompatible index actions.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesTable.tsx Adds Data Node migration hinting and supports local pagination state via withoutURLParams.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesTable.test.tsx Extends tests for migration hint rendering behavior and table wiring.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesContext.tsx Extends context with reindexActionsAvailable.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesColumnRenderers.tsx Adds richer column rendering (badges, ranges) for the outdated indices entity table.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesBulkActions.tsx Gates bulk reindex behavior and telemetry based on reindex availability.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesBulkActions.test.tsx Adds tests for reindex gating in bulk actions.
graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndexTableActions.tsx Gates per-row reindex actions based on reindex availability.
graylog2-web-interface/src/components/indices/incompatible-indices/incompatibleIndexActions.tsx Refactors action selection to consider archive/reindex availability and archive state.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useTrackedIncompatibleIndices.ts New hook to keep selected rows across pagination/refresh for bulk actions.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useTrackedIncompatibleIndices.test.ts Tests selection persistence and refresh behavior for the tracking hook.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/usePendingIncompatibleIndexActions.ts New hook to persist and reconcile pending archive/reindex actions via local storage + cluster jobs.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/usePendingIncompatibleIndexActions.test.ts Tests storage failure handling and reconciliation behavior.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useIncompatibleIndexActionState.ts Adds reindex availability and wires it into context state alongside archive state.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useIncompatibleIndexActionState.test.ts Adds tests for reindex availability gating.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useClusterJobs.ts New react-query hook to fetch cluster jobs for action tracking.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useCanReindex.ts New hook to determine whether system-index reindexing is supported (Data Node backend).
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useArchivedIndexNames.ts New wrapper hook around the archive plugin binding for archived index names.
graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useArchivedIndexNames.test.ts Tests plugin binding behavior for archived index names hook.
graylog2-web-interface/src/components/indices/incompatible-indices/fetchIncompatibleIndices.ts Adds a paginated fetcher for outdated indices using SystemIndexerIndices.listOutdatedIndices.
graylog2-web-interface/src/components/indices/incompatible-indices/constants.ts Adds shared polling interval constant.
graylog2-web-interface/src/components/indices/incompatible-indices/bulkIndexActions.ts Extends bulk candidate selection to respect reindex availability.
graylog2-web-interface/src/components/indices/incompatible-indices/BulkIndexActionConfirmDialog.tsx Adds a shared confirm dialog for bulk actions.
graylog2-web-interface/src/components/datanode/opensearch-upgrade/OpenSearchUpgradeSection.tsx Switches to using the shared incompatible indices table component and adds heading.
graylog2-web-interface/src/components/datanode/opensearch-upgrade/OpenSearchUpgradeSection.test.tsx Updates mocks to match the relocated shared incompatible indices table import.
graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts Extends datanode permissions typing to include read.
Suppressed comments (2)

graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesTable.test.tsx:85

  • This test treats AppConfig.isCloud/isFeatureEnabled as jest mocks, but the module is not mocked and these are real functions. Calling .mockReturnValue on them will fail at runtime; use jest.spyOn(...).mockReturnValue(...) (and restore) instead.
    graylog2-web-interface/src/components/indices/incompatible-indices/IncompatibleIndicesTable.tsx:70
  • The “System indices can only be reindexed…” hint is shown solely based on reindexActionsAvailable, even when the current result set contains no system indices (or before any data has loaded). This can display irrelevant guidance; gate it on whether any tracked index is a system index.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 28 changed files in this pull request and generated no new comments.

Suppressed comments (2)

graylog2-web-interface/src/components/indices/IncompatibleIndicesModal.tsx:37

  • The modal entry point is guarded only by indexranges:rebuild (src/pages/IndicesPage.tsx:36), but this reused table exposes Delete, Reindex, and Rotate actions whose endpoints require separate permissions such as indices:delete and indices:reindex. A custom role allowed to rebuild ranges but not perform those operations now receives controls that consistently fail with 403. Gate each action with the current user's permission or make this modal read-only for unsupported actions.
      <IncompatibleIndicesTable withoutURLParams />

graylog2-web-interface/src/components/indices/incompatible-indices/hooks/useCanReindex.ts:40

  • This fails open whenever the capability query is loading, errors, or is disabled because the user lacks datanode:read. On a direct OpenSearch backend, the Reindex controls are therefore briefly—or permanently—shown even though that backend cannot execute them, contradicting the backend-capability guard this hook provides. Keep the action hidden until the endpoint has positively reported Data Node support.
  return runsWithDataNode !== false;

@gally47
gally47 requested a review from a team August 14, 2026 08:43
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.

2 participants