Skip to content

Part of Phase 1 (1b): Archive Notifier migrated from Redux to Zustand#3715

Merged
yurishkuro merged 8 commits intojaegertracing:mainfrom
Parship12:migrate-archive-notifier
Apr 9, 2026
Merged

Part of Phase 1 (1b): Archive Notifier migrated from Redux to Zustand#3715
yurishkuro merged 8 commits intojaegertracing:mainfrom
Parship12:migrate-archive-notifier

Conversation

@Parship12
Copy link
Copy Markdown
Member

Which problem is this PR solving?

Description of the changes

  • New files:

    • src/stores/archive-store.ts: Zustand store owning archives: Record<string, TraceArchive>, plus submitArchiveTrace(traceId) (async, calls JaegerAPI directly, handles loading/success/error transitions) and acknowledge(traceId).
    • src/stores/archive-store.test.ts
  • Modified:

    • TracePage/index.tsx
    • configure-store.ts: removed archive reducer from combineReducers.
    • types/index.ts: removed archive: TracesArchive from ReduxState.
    • TracePage/index.test.jsx
  • Deleted:

    • ArchiveNotifier/duck.ts
    • ArchiveNotifier/duck.test.js

How was this change tested?

  • Unit tests
  • Manually verified Archive button visibile... with local jaeger-ui.config.json (archiveStorage: true), clicked Archive on a trace, and confirmed the client issues POST /api/archive/<traceId>; backend returned 500 with “archive span storage was not configured” on my local Query (expected without archive storage).

Checklist

AI Usage in this PR (choose one)

See AI Usage Policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
@Parship12 Parship12 requested a review from a team as a code owner April 9, 2026 12:58
Copilot AI review requested due to automatic review settings April 9, 2026 12:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with submitArchiveTrace and acknowledge actions
  • Updated TracePage component to use the new Zustand store via hooks instead of Redux dispatch/state
  • Removed Redux archive duck (ArchiveNotifier/duck.ts and 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
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (f9226f8) to head (bb79a89).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Copilot AI review requested due to automatic review settings April 9, 2026 14:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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.

@yurishkuro yurishkuro added the changelog:refactoring Internal, non-functional code improvements label Apr 9, 2026
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
@Parship12 Parship12 requested a review from yurishkuro April 9, 2026 15:33
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Copilot AI review requested due to automatic review settings April 9, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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>
Copilot AI review requested due to automatic review settings April 9, 2026 17:01
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
@yurishkuro yurishkuro merged commit 95915ea into jaegertracing:main Apr 9, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:refactoring Internal, non-functional code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants