Part of Phase 1 (1b): Archive Notifier migrated from Redux to Zustand#3715
Conversation
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request completes Phase 1b of the Redux-to-Zustand migration by moving the Archive Notifier state management from Redux to a dedicated Zustand store. The archive functionality (submitting trace archives and acknowledging completion) is now managed client-side through the new useArchiveStore hook, with all Redux-related code cleanly removed.
Changes:
- Created new Zustand store (
src/stores/archive-store.ts) managing archive state withsubmitArchiveTraceandacknowledgeactions - Updated
TracePagecomponent to use the new Zustand store via hooks instead of Redux dispatch/state - Removed Redux archive duck (
ArchiveNotifier/duck.tsand its tests) - Cleaned up Redux configuration and type definitions
- Updated all related tests to use the new store
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/stores/archive-store.ts | New Zustand store managing archive state and async submission logic |
| src/stores/archive-store.test.ts | Comprehensive tests for store actions and state transitions |
| src/components/TracePage/index.tsx | Migrated from Redux dispatch/selectors to Zustand hooks |
| src/components/TracePage/index.test.jsx | Updated tests to mock Zustand store instead of Redux actions |
| src/utils/configure-store.ts | Removed archive reducer from Redux combineReducers |
| src/types/index.ts | Removed archive field from ReduxState type |
| docs/adr/0004-state-management-strategy.md | Marked Phase 1b as complete |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3715 +/- ##
==========================================
- Coverage 89.21% 89.21% -0.01%
==========================================
Files 330 330
Lines 9900 9889 -11
Branches 2570 2566 -4
==========================================
- Hits 8832 8822 -10
+ Misses 926 925 -1
Partials 142 142 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Which problem is this PR solving?
Description of the changes
New files:
src/stores/archive-store.ts: Zustand store owningarchives: Record<string, TraceArchive>, plussubmitArchiveTrace(traceId)(async, calls JaegerAPI directly, handles loading/success/error transitions) andacknowledge(traceId).src/stores/archive-store.test.tsModified:
TracePage/index.tsxconfigure-store.ts: removedarchivereducer fromcombineReducers.types/index.ts: removedarchive: TracesArchivefromReduxState.TracePage/index.test.jsxDeleted:
ArchiveNotifier/duck.tsArchiveNotifier/duck.test.jsHow was this change tested?
jaeger-ui.config.json(archiveStorage: true), clicked Archive on a trace, and confirmed the client issuesPOST /api/archive/<traceId>; backend returned 500 with “archive span storage was not configured” on my local Query (expected without archive storage).Checklist
make lint testAI Usage in this PR (choose one)
See AI Usage Policy.