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

WP-379: Error handling for site search results #925

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Conversation

chandra-tacc
Copy link
Collaborator

@chandra-tacc chandra-tacc commented Dec 20, 2023

Overview

In site search, involves 3 things:

  • cms search
  • public data file search
  • community data file search

When community data file search fails because user does not have access to community, the entire site-search fails. This PR addresses that. It allows user to see the other site search results, when public and community data files search files with specific tapis errors.

Related

Changes

  • Catch Tapis Exception and do not raise an error for ssh permission denied or ssh missing credentials. Log the error and let rest of the site search continue. These are valid error conditions to not allow access to search, any other error would need immediate attention and is ok to raise.
  • Throwing this error back to the user results in a generic error message which does not help the user.

Testing

Local testing pre-req: Setup search

  1. Tested site search with authenticated user (no regression)
    Screenshot 2023-12-18 at 5 19 28 PM

  2. Tested site search without authenticated user (no regression)
    Screenshot 2023-12-18 at 5 19 07 PM

  3. The above two scenarios still do not hit the use case this PR is fixing. New unit tests are written to force tapis error and check the response.

  4. For pprd and prod scenario, use a2cps site search to validate this PR.

UI

Notes

Error handling for site search results
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (306aa20) 63.52% compared to head (f603807) 63.54%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #925      +/-   ##
==========================================
+ Coverage   63.52%   63.54%   +0.02%     
==========================================
  Files         431      431              
  Lines       12424    12433       +9     
  Branches     2591     2594       +3     
==========================================
+ Hits         7892     7901       +9     
+ Misses       4317     4315       -2     
- Partials      215      217       +2     
Flag Coverage Δ
javascript 69.81% <ø> (ø)
unittests 57.17% <100.00%> (+0.06%) ⬆️

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

Files Coverage Δ
server/portal/apps/site_search/api/views.py 88.67% <100.00%> (+2.31%) ⬆️

@chandra-tacc chandra-tacc marked this pull request as ready for review December 20, 2023 14:13
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

Copy link
Contributor

@edmondsgarrett edmondsgarrett left a comment

Choose a reason for hiding this comment

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

Looks good!

@chandra-tacc chandra-tacc merged commit 3b4abc6 into main Dec 21, 2023
6 checks passed
@chandra-tacc chandra-tacc deleted the bug/WP-379 branch December 21, 2023 19:00
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