Skip to content

Conversation

@nguyenduy
Copy link
Contributor

@nguyenduy nguyenduy commented Dec 20, 2024

Summary by Sourcery

Change the return type of indexExists from Promise<boolean> to boolean.

@nguyenduy nguyenduy requested a review from gidich as a code owner December 20, 2024 16:35
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 20, 2024

Reviewer's Guide by Sourcery

This pull request changes the return type of the indexExists method from Promise<boolean> to boolean, removing the asynchronous nature of the method. The implementation of this method is updated in both the MemoryCognitiveSearch and AzCognitiveSearch classes to reflect this change. Additionally, some minor code cleanup is performed, such as removing unnecessary empty lines and unused imports.

Class diagram showing interface and implementation changes for indexExists method

classDiagram
    class CognitiveSearchBase {
        <<interface>>
        +indexExists(indexName: string) boolean
        +deleteDocument(indexName: string, document: any) Promise~void~
        +indexDocument(indexName: string, document: any) Promise~void~
        +deleteIndex(indexName: string) Promise~void~
    }

    class MemoryCognitiveSearch {
        -searchCollectionIndexMap: Map
        -searchCollectionIndexDefinitionMap: Map
        +indexExists(indexName: string) boolean
    }

    class AzCognitiveSearch {
        -searchClients: Map
        +indexExists(indexName: string) boolean
    }

    CognitiveSearchBase <|.. MemoryCognitiveSearch
    CognitiveSearchBase <|.. AzCognitiveSearch

    note for CognitiveSearchBase "Changed indexExists from Promise<boolean> to boolean"
Loading

File-Level Changes

Change Details Files
Changed the return type of indexExists to boolean.
  • Removed the async keyword from the indexExists method signature.
  • Updated the implementation to return a boolean value directly.
  • Removed the Promise<boolean> return type annotation and replaced it with boolean.
data-access/seedwork/services-seedwork-cognitive-search-in-memory/index.ts
data-access/seedwork/services-seedwork-cognitive-search-az/index.ts
data-access/seedwork/services-seedwork-cognitive-search-interfaces/index.ts
Performed minor code cleanup.
  • Removed unnecessary empty lines and trailing spaces.
  • Removed unused import statements.
data-access/seedwork/services-seedwork-cognitive-search-in-memory/index.ts
data-access/seedwork/services-seedwork-cognitive-search-az/index.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nguyenduy - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nguyenduy nguyenduy requested review from nnoce14 and removed request for gidich December 20, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants