Skip to content

chore: remove unused SearchIndexPartition helper methods - #36489

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-unused-searchindexpartition-helper-me-3846db
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-unused-searchindexpartition-helper-me-3846db

Conversation

@detail-app

@detail-app detail-app Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Removed the four unused helper methods on SearchIndexPartition
(getProgressPercent, isComplete, isClaimable, getRemainingCount)
and the test cases that exclusively exercised them.

These methods had no production callers — distributed reindexing
production code (JobRecoveryManager, EntityCompletionTracker,
DistributedSearchIndexCoordinator) re-implements the same status/progress
checks inline or via SQL predicates rather than calling these helpers.
Their only consumers were in SearchIndexPartitionTest, which does not
count as a production consumer. The 22 Lombok-backed fields and the
testToBuilder test are kept since they remain in active use.

History

Describe your changes:

Fixes #N/A

I worked on removing dead code from SearchIndexPartition because the four
helper methods (getProgressPercent, isComplete, isClaimable,
getRemainingCount) had zero production callers and were only exercised
by tests, which do not count as production consumers.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change. Removed four unused helper methods from a single POJO
and the test cases that exclusively tested them. Production behavior is
unchanged since the methods were never called from production code.

Tests:

Use cases covered

  • testToBuilder continues to verify Lombok builder()/toBuilder()
    behavior on SearchIndexPartition (the only test that didn't depend on
    the removed helpers).

Unit tests

  • I kept the existing unit test that exercises the still-living
    Lombok-generated builder/toBuilder/getter API (testToBuilder).
  • Files updated: openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/searchIndex/distributed/SearchIndexPartitionTest.java
  • Coverage on changed classes: no production logic changed; the kept
    test still covers the builder pattern used in production.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  • Ran mvn test -pl openmetadata-service -Dtest=SearchIndexPartitionTest:
    1 test, 0 failures, 0 errors.

UI screen recording:

Not applicable — backend-only dead-code removal, no UI changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: no decision record needed — pure removal of unused helpers, no new schema fields, REST paths, formats, defaults, orderings, or rules being introduced.

Tooling: Detail: Dead Code


Dead Code PRs can be configured here.

@detail-app
detail-app Bot requested a review from a team as a code owner October 28, 2026 22:44
@detail-app
detail-app Bot requested review from harshach and sonika-shah October 28, 2026 22:44
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@detail-app detail-app Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant