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

REST API: count include-all results when checking max resources limit #901

Merged
merged 3 commits into from
Feb 25, 2022

Conversation

cce
Copy link
Contributor

@cce cce commented Feb 25, 2022

Summary

Handle include-all when checking max resources limit by adding option to perform count queries to buildAccountQuery rather than fetch full results. Follow-up to #872

Test Plan

Extended TestAccountMaxResultsLimit to create and destroy assets and apps, check behavior of include-all with limits.


if opts.IncludeDeleted {
// if IncludeDeleted is set, need to construct a query (preserving filters) to count deleted values that would be returned from
// asset, app, account_asset, account_app
o.CountOnly = true
countOnly = true
Copy link
Contributor

Choose a reason for hiding this comment

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

For the resource limit check, don't we always want this to be true?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, I forgot that in that case we are looking up the data from the account.

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2022

Codecov Report

❗ No coverage uploaded for pull request base (feature/unlimited-assets@dadae50). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                     Coverage Diff                     @@
##             feature/unlimited-assets     #901   +/-   ##
===========================================================
  Coverage                            ?   59.07%           
===========================================================
  Files                               ?       42           
  Lines                               ?     5644           
  Branches                            ?        0           
===========================================================
  Hits                                ?     3334           
  Misses                              ?     1868           
  Partials                            ?      442           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dadae50...3dfdcfa. Read the comment docs.

@cce cce merged commit 8444586 into feature/unlimited-assets Feb 25, 2022
@cce cce deleted the feature/unlimited-assets-include-all branch February 25, 2022 18:22
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.

4 participants