Skip to content

Propagate stats retrieval failures in unused-index cleanup service#447

Closed
kingjia90 with Copilot wants to merge 1 commit into
2026.xfrom
copilot/fix-code-for-review-comment
Closed

Propagate stats retrieval failures in unused-index cleanup service#447
kingjia90 with Copilot wants to merge 1 commit into
2026.xfrom
copilot/fix-code-for-review-comment

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the review feedback on discussion_r3303031990: UnusedIndexCleanupService::getAllManagedIndices() was swallowing getStats() exceptions and returning an empty result, which could falsely report “no unused indices.”
The change makes stats failures explicit by letting exceptions propagate to command-level error handling.

  • Service behavior change

    • Removed local exception swallowing in UnusedIndexCleanupService::getAllManagedIndices().
    • SearchIndexServiceInterface::getStats() failures now bubble up instead of being converted to [].
  • Focused unit coverage

    • Added a unit test asserting findUnusedIndices() propagates a thrown stats exception.
// before
try {
    $stats = $this->searchIndexService->getStats($indexPrefix . '*');
} catch (Exception) {
    return [];
}

// after
$stats = $this->searchIndexService->getStats($indexPrefix . '*');

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI changed the title [WIP] Fix code based on review comment Propagate stats retrieval failures in unused-index cleanup service Jun 29, 2026
Copilot AI requested a review from kingjia90 June 29, 2026 10:51
@kingjia90 kingjia90 closed this Jun 29, 2026
@kingjia90 kingjia90 deleted the copilot/fix-code-for-review-comment branch June 29, 2026 12:58
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants