Skip to content
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

CV2-4223 readd condition for checking if we should even search for the type #1780

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

DGaffney
Copy link
Contributor

Description

In Bot::Alegre.get_similar_items(pm) (i.e. the original similarity matching function in alegre), we run a conditional check of !Bot::Alegre.should_get_similar_items_of_type?('master', pm.team_id) || !Bot::Alegre.should_get_similar_items_of_type?(type, pm.team_id) - this effectively checks the team to ensure that similarity searching is enabled at all, and specifically, similarity searching for that media modality is enabled. In the massive simplification/refactor, we lost that condition for V2. Adding that back in at the point of search, which should be all that's needed to get Alegre back to spec.
References: CV2-4223

How has this been tested?

Strange that we didn't have a unit test for this - I will be writing one for this test case, but I want to see test results for just the change itself with no alterations to tests first to see if there's breaks in existing tests - will serve as the jumping off point for rewriting those tests or adding new ones.

Things to pay attention to during code review

Are we missing any other "core" features? This would be a good time to check!

Checklist

  • I have performed a self-review of my own code
  • I have added unit and feature tests, if the PR implements a new feature or otherwise would benefit from additional testing
  • I have added regression tests, if the PR fixes a bug
  • I have added logging, exception reporting, and custom tracing with any additional information required for debugging
  • I considered secure coding practices when writing this code. Any security concerns are noted above.
  • I have commented my code in hard-to-understand areas, if any
  • I have made needed changes to the README
  • My changes generate no new warnings
  • If I added a third party module, I included a rationale for doing so and followed our current guidelines

Copy link
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

As you noted, just missing the unit test - I'll re-review once it's there and everything is passing (and then I'm happy to test it locally too).

Copy link

codeclimate bot commented Jan 24, 2024

Code Climate has analyzed commit 4b5505d and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (100% is the threshold).

This pull request will bring the total coverage in the repository to 99.9% (0.0% change).

View more on Code Climate.

@DGaffney DGaffney requested a review from caiosba January 24, 2024 19:52
Copy link
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

Devin and I paired on the tests.

@DGaffney DGaffney merged commit b0d41d4 into develop Jan 24, 2024
8 checks passed
@DGaffney DGaffney deleted the cv2-4223-fix-workspace-modality-enabled branch January 24, 2024 20:04
DGaffney added a commit that referenced this pull request Jan 24, 2024
…e type (#1780)

* CV2-4223 readd condition for checking if we should even search for the type

* fix missing var

* add tests for explicitly disabling similarity

* fix typo and remove stubs

* refactor after discussion with @caio

* Fixing tests

---------

Co-authored-by: Caio <[email protected]>
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