Refactor: Migrate Tier 3 Reflux stores to react-query and direct API calls#25320
Open
dennisoelkers wants to merge 17 commits intomasterfrom
Open
Refactor: Migrate Tier 3 Reflux stores to react-query and direct API calls#25320dennisoelkers wants to merge 17 commits intomasterfrom
dennisoelkers wants to merge 17 commits intomasterfrom
Conversation
Use StaticFields.create/remove from @graylog/server-api instead of the Reflux store. Remove cross-store dependency from InputsStore since react-query cache invalidation already handles input list refresh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace all usages of the Reflux InputStatesStore with the existing useInputsStates hook and useInputStateMutations hook. Components now use SystemInputStates from @graylog/server-api directly where hooks cannot be used (StartInputStep). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace all usages of InputTypesStore with existing hooks: - useInputTypesDescriptions for input type descriptions - useInputTypes (hooks/) for input type summaries - fetchInputType for fetching a single input type definition Move InputDescription type to hooks/useInputType.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create usePipelineConnections hook for fetching connections and usePipelineConnectionMutation for updating pipeline-to-stream connections. Uses PipelinesConnections from @graylog/server-api. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace StreamRulesStore with useStreamRuleMutations hook for create/update/remove operations. Update useStreamRuleTypes to use generated API client directly. Remove onChange/unregister callbacks in favor of query invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace GrokPatternsStore with exported functions in hooks/useGrokPatterns.ts that call the generated SystemGrok API client. Update all three consumers (GrokPatterns, BulkLoadPatternModal, GrokExtractorConfiguration) and replace CancellablePromise patterns with unmounted flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create useOutputMutations hook for save/update/remove operations using SystemOutputs API client. Move Output type to hooks/useOutputs. Update OutputsComponent to use useOutputs/useStreamOutputs hooks instead of store callbacks. Update OutputsList and AddOutputButton to use mutations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ContentPacksActions with direct calls to SystemContentPacks API client. Replace useStore(ContentPacksStore) in EditContentPackPage with useContentPackRevisions hook. Use queryClient.invalidateQueries for cache refresh after upload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… API calls Replace LookupTablesStore, LookupTableCachesStore, and LookupTableDataAdaptersStore with direct REST calls via lookupTablesAPI.ts. Consumers now use react-query or call API functions directly instead of going through Reflux stores. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…query hooks Replace the Reflux store with standalone API functions (fetchIndexSets, createIndexSet, updateIndexSet, deleteIndexSet, setDefaultIndexSet, etc.) and leverage existing useIndexSetsList/useSingleIndexSet react-query hooks. Update all 20 consumer files including tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
472787e to
82c46d3
Compare
Replace the useFetchLookupTables hook with direct named exports of fetchPaginatedLookupTables and lookupTablesKeyFn from useLookupTablesAPI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
linuspahl
reviewed
Mar 20, 2026
Contributor
linuspahl
left a comment
There was a problem hiding this comment.
How the code has been refactored and the concept behind it seems very reasonable, but I am having a hard time testing every related page manually. We are just changing too many files in one PR. I started with content packs, lookup tables and pipelines.
Member
Author
Agreed. I think we need to do a best effort PR review and utilize e2e-tests, testing days and manual testing before the release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
react-queryfor API caching,useState/direct API functions for simpler casesconnect()HOC dependency with IndexerOverviewStore in IndexSetPageStores migrated
InputStaticFieldsStore@graylog/server-apicallsInputTypesStorereact-queryhookInputStatesStorereact-queryhookPipelineConnectionsStorereact-queryhooksStreamRulesStoreuseStreamRuleMutationshookGrokPatternsStoreOutputsStoreuseOutputMutationshookContentPacksStoreLookupTablesStorelookupTablesAPI.tsLookupTableCachesStorelookupTablesAPI.tsLookupTableDataAdaptersStorelookupTablesAPI.tsIndexSetsStoreuseIndexSetsList/useSingleIndexSethooks/prd Graylog2/graylog-plugin-enterprise#13565
/nocl Internal refactoring
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: