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

Fixing Alegre path for tipline image search. #1776

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

caiosba
Copy link
Contributor

@caiosba caiosba commented Jan 10, 2024

Description

Tipline image search, and actually other places of the code, were still hitting a deprecated path of Alegre API, :type/similarity/search, while (AFAIU) it should be /similarity/sync/:type (for audio and image, only). This PR fixes it by creating a get_items_with_similar_media_v2 method that hits the new endpoint for image and audio and the old endpoint for video and text. This is not the ideal and I also noticed another problem, but I added a couple of #FIXME's to the code to handle that later.

Reference: CV2-4044.

How has this been tested?

Existing tests should cover this, they broke as expected and I fixed them.

Things to pay attention to during code review

I added a couple of FIXME's to the code, please check them.

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

Tipline image search, and actually other places of the code, were still hitting a deprecated path of Alegre API, `:type/similarity/search`, while (AFAIU) it should be `/similarity/sync/:type`. This PR fixes it by creating a `get_items_with_similar_media_v2` method that hits the new endpoint for image and audio and the old endpoint for video and text. This is not the ideal and I also noticed another problem, but I added a couple of `#FIXME`'s to the code to handle that later.

Reference: CV2-4044.
@caiosba caiosba requested a review from DGaffney January 10, 2024 02:25
@caiosba caiosba requested a review from melsawy as a code owner January 10, 2024 02:25
@caiosba caiosba removed the request for review from melsawy January 10, 2024 02:25
Copy link

codeclimate bot commented Jan 10, 2024

Code Climate has analyzed commit 9daa5dd 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 100.0% (0.0% change).

View more on Code Climate.

Copy link
Contributor

@DGaffney DGaffney left a comment

Choose a reason for hiding this comment

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

:shipit:

@caiosba caiosba merged commit c41bddd into develop Jan 12, 2024
8 checks passed
@caiosba caiosba deleted the fix/CV2-4044-tipline-image-search branch January 12, 2024 01:59
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