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

Don't validate individual org users requests #2651

Merged
merged 3 commits into from
Jul 6, 2018

Conversation

richard-cox
Copy link
Contributor

@richard-cox richard-cox commented Jul 5, 2018

It's probably best to test after #2613 has merged.

Don't validate individual org users requests when fetching all users via individual org users call

  • Setup - Non-admin user who's an org user of many orgs
  • Non-admin users can't hit the users/ endpoint to fetch all users, so we go out to each org and fetch
    the orgs users (these can contain duplicated users)
  • Validation was executed on every user in every response
  • If a user had more than 50 roles that part of the response is missing
  • Validation would catch this and make extra request per org per user per missing data
  • This was a lot of duplicate calls * no. of orgs
  • Solution is to still fetch these inline fields but don't validate each one. This is left to the validation executed during pagination to handle

…via individal org users call

- 100 org user calls
- might be same users returned every time, which are missing same set
- 100 * 1-6 = lots of spam
- Don't validate each response, leave to pagination sections to validate properly
@cfdreddbot
Copy link

Hey richard-cox!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@codecov
Copy link

codecov bot commented Jul 5, 2018

Codecov Report

Merging #2651 into v2-master will decrease coverage by <.01%.
The diff coverage is 18.75%.

@@              Coverage Diff              @@
##           v2-master    #2651      +/-   ##
=============================================
- Coverage      47.94%   47.93%   -0.01%     
=============================================
  Files            597      597              
  Lines          25342    25345       +3     
  Branches        5724     5735      +11     
=============================================
  Hits           12149    12149              
- Misses         13193    13196       +3

* v2-master:
  Fixed repeated org name on permission pills
  Tidy up safe observable code
  Fix unmap route action removing route from all lists
  Revert "Fix unmap route action removing route from all lists"
  Fix unmap route action removing route from all lists
  Select current service plan
  Fix unit tests
  Tidy up code
  Tidy up
  Fix edit of service instances
  Typo
  Update pagination if entities update
  Add column name tests
  Column names table unit tests
  Fixed linting
  Use better test reporter
  Ensure we don't recursively delete with the action is an update
  Ensure we don't show incorrect space roles in org users list - When there are many space roles we have to fetch them asyncronously - Previously the org users list would briefly show all space roles (even those for spaces not in org) before showing correct list - We now block until we have that space list - CF user and space user lists should remain unaffected
  Improve efficiency of calculating user other roles - Need to determine if a user has roles other than org user (to determine if we show the 'cross' on org user pill) - This happens per org user cell per user quite a lot of times - Previously this recalculated roles for each space and org. these could be 100s * above - Now we just check the user's arrays
  Ensure users with 100+ roles are stored correctly - admin with 100+ manager and dev space roles - we notice that the user is missing the manager and space properties and go out and fetch - previously we then stored the users managed spaces in the `spaces` property instead of `managed_spaces`
Copy link
Contributor

@KlapTrap KlapTrap left a comment

Choose a reason for hiding this comment

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

You left in some commented code. All good after that.

// initialParams = {
// page: 1,
// 'results-per-page': 100,
// 'order-direction': 'desc',
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented out code

@KlapTrap KlapTrap merged commit bdf09ac into v2-master Jul 6, 2018
@KlapTrap KlapTrap deleted the fix-non-admin-many-users-2 branch July 6, 2018 15:28
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.

3 participants