Skip to content

feat(compass-indexes): add index build progress COMPASS-9495 #7200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Aug 15, 2025

Description

Add a percentage to the index build row in the table if it is in progress.

https://jira.mongodb.org/browse/COMPASS-9495

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature - parity with legacy DE
  • Dependency update
  • Misc

Open Questions

For reviewers:

  • Did I make good use of hooks by writing useIndexProgress?
  • The getInProgressIndexInfo used to just list stub indexes because even in progress ones would be listed as "ready" while they continued to build on the server. We now will list "real" indexes via this function. Is that the right approach?

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)
Screen.Recording.2025-08-15.at.2.29.25.PM.mov
index_finish.mov

@nbbeeken nbbeeken marked this pull request as ready for review August 15, 2025 19:18
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 19:18
@nbbeeken nbbeeken requested a review from a team as a code owner August 15, 2025 19:18
Copy link
Contributor

@Copilot 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 PR adds index build progress tracking to the MongoDB Compass indexes table, showing a percentage indicator when indexes are being built. The implementation introduces a new hook for polling index progress via currentOp command and updates the UI to display build progress and a spinner for in-progress indexes.

  • Adds useIndexProgress hook for tracking index build progress via polling
  • Updates Redux state to track progress percentage for in-progress indexes
  • Modifies UI components to display progress indicators and spinners for building indexes

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/setup-store.ts Adds mock currentOp method to test data service
src/stores/store.ts Extends data service type to include currentOp for progress tracking
src/modules/regular-indexes.ts Adds progress tracking logic, new actions, and getIndexesProgress thunk
src/modules/regular-indexes.spec.ts Adds tests for index progress tracking functionality
src/hooks/use-index-progress.ts New custom hook for managing index build progress polling
src/components/regular-indexes-table/regular-indexes-table.tsx Integrates progress hook and updates index filtering logic
src/components/regular-indexes-table/regular-indexes-table.spec.tsx Updates tests to mock the progress hook
src/components/regular-indexes-table/regular-index-actions.tsx Adds progress display UI with spinner and percentage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant