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

11708 handle list of search results for permission_backend.get_search_ui_permissions #11709

Open
wants to merge 9 commits into
base: dev/7.6.x
Choose a base branch
from

Conversation

whatisgalen
Copy link
Member

@whatisgalen whatisgalen commented Jan 2, 2025

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

This PR addresses the fact that an ORM query gets called for each individual search result whenever get_search_ui_permissions gets called. None of the actual logic has been altered, however now the method accepts either a single search_result dict or a list of them, returning the same type of thing as it received. This means the ORM query to lookup nodegroup permissions now happens once for a set of results, significantly speeding up performance on larger sets of search_results. The Search Results filter has been updated to send/receive a list.

Issues Solved

Closes #11708

Checklist

  • I targeted one of these branches:
    • dev/8.0.x (under development): features, bugfixes not covered below
    • dev/7.6.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/6.2.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Ticket Background

  • Sponsored by:
  • Found by: @
  • Tested by: @
  • Designed by: @

Further comments

@whatisgalen whatisgalen changed the title 11708 bulk search UI perms 11708 handle list of search results for permission_backend.get_search_ui_permissions Jan 2, 2025
@whatisgalen whatisgalen linked an issue Jan 2, 2025 that may be closed by this pull request
@@ -142,6 +142,9 @@ def get_permission_search_filter(self, user): ...
@abstractmethod
def get_search_ui_permissions(self, user, search_result, groups=None): ...

@abstractmethod
Copy link
Member

Choose a reason for hiding this comment

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

Hey Galen. I haven't looked too closely yet, but can you share why would we need a separate method if the signature is the same as get_search_ui_permissions?

Copy link
Member Author

@whatisgalen whatisgalen Jan 2, 2025

Choose a reason for hiding this comment

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

I actually ended up just updating the original logic of the get_search_ui_permissions method to handle either a dict or a list of search results and return back the like. I wanted to ensure this wouldn't be a breaking change.

@chiatt
Copy link
Member

chiatt commented Jan 7, 2025

While I think it would be really great to have this performance improvement 7.6, I feel that it is just too significant a change to go in a patch release. I think it should instead target the 8.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_search_ui_permissions bulk method
3 participants