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

Bug/WP-384: workspace search: handle scenario where id is missing in results #899

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

chandra-tacc
Copy link
Collaborator

@chandra-tacc chandra-tacc commented Nov 9, 2023

Overview

There are documents in the projects index which are old and do not have same schema as the search expects.
Some of those do not have id field.

Related

Changes

  • Handle scenario where id is missing.

Testing

Setup for testing:

  • exec into portal: docker exec -it core_portal_django bash

  • Add 2 projects to index which could cause problems.

    • project with no "id" field
curl -H "Content-Type: application/json" -X POST http://core_portal_elasticsearch:9200/cep-dev-projects/_doc -d '
{"name": "CEP-foo","host": "cloud.data.tacc.utexas.edu","updated": "2023-11-11T00:00:00","owner": {"username": "foo","first_name": "foo","last_name": "foo","email": "foo@tacc.utexas.edu"},"title": "testfoo","description": "foo"}'
  • project does not exist in tapis
curl -H "Content-Type: application/json" -X POST http://core_portal_elasticsearch:9200/cep-dev-projects/_doc -d '
{"id":"cep.project.CEP-foo1","path":"/corral-repl/tacc/aci/CEP/projects/CEP-foo1", "name": "CEP-foo1","host": "cloud.data.tacc.utexas.edu","updated": "2023-11-11T00:00:00","owner": {"username": "foo","first_name": "foo","last_name": "foo","email": "foo@tacc.utexas.edu"},"title": "testfoo1 buggy search","description": "foo"}'

Test

Go to shared workspaces

  1. Without the fix, repro the error. search for test keyword. Below error is seen in UI
    Screenshot 2023-11-09 at 5 43 09 PM

  2. With the fix, search for test keyword. Both the above added projects are not seen in results and the UI does not show error.

  3. Search for keyword from projects from your list, it should show up project results.

  4. Search for a keyword not in project list, the results should be empty and not an error message in UI.

UI

Notes

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #899 (6f58c61) into main (4d006aa) will not change coverage.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #899   +/-   ##
=======================================
  Coverage   63.41%   63.41%           
=======================================
  Files         432      432           
  Lines       12393    12393           
  Branches     2581     2581           
=======================================
  Hits         7859     7859           
  Misses       4324     4324           
  Partials      210      210           
Flag Coverage Δ
javascript 69.75% <ø> (ø)
unittests 56.94% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
server/portal/apps/projects/views.py 34.23% <0.00%> (ø)

@chandra-tacc chandra-tacc changed the title project search:Handle scenario where id is missing Bug/WP-384: workspace search: handle scenario where id is results Nov 9, 2023
@chandra-tacc chandra-tacc marked this pull request as ready for review November 9, 2023 23:48
Copy link
Contributor

@shayanaijaz shayanaijaz left a comment

Choose a reason for hiding this comment

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

LGTM

@chandra-tacc chandra-tacc changed the title Bug/WP-384: workspace search: handle scenario where id is results Bug/WP-384: workspace search: handle scenario where id is missing in results Nov 14, 2023
Copy link
Member

@rstijerina rstijerina left a comment

Choose a reason for hiding this comment

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

Nice fix 👍

@chandra-tacc chandra-tacc merged commit 1af7c8f into main Nov 15, 2023
5 of 6 checks passed
@chandra-tacc chandra-tacc deleted the bug/WP-384-hits-without-id branch November 15, 2023 14:29
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.

3 participants