-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix templates and ISOs listing pagination #7974
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
Fix templates and ISOs listing pagination #7974
Conversation
|
@blueorangutan package |
|
@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report
@@ Coverage Diff @@
## main #7974 +/- ##
============================================
+ Coverage 21.20% 29.09% +7.89%
- Complexity 20501 30378 +9877
============================================
Files 4968 5102 +134
Lines 336855 358767 +21912
Branches 48389 52356 +3967
============================================
+ Hits 71416 104379 +32963
+ Misses 255044 240066 -14978
- Partials 10395 14322 +3927
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1471 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7057 |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7688)
|
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@blueorangutan package |
|
@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7149 |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7756)
|
GutoVeronezi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLGTM
|
@shwstppr @DaanHoogland it would be interesting to have this fix on 4.19 |
|
@hsato03 are you allright with this PR like this? |
|
Code LGTM |
@DaanHoogland yes, some users have tested these changes; I will ask them to report the results here. |
1d228d3 to
15f5279
Compare
15f5279 to
0fc8748
Compare
|
@blueorangutan package |
|
@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7285 |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7896)
|
It would be nice to see those, thanks. |
|
I have tested this PR by replicating the tests on my local lab. First, I tested on the current main and verified the problem was present. Then, I applied the changes and verified it had been fixed. My scenario had the same amount of domains, templates and ISOs ( Templates: Without the changesWith
I marked one of the
With
With the changesWith
I marked one of the templates as non-public. It stopped showing in
With
With
ISOs: Without the changesWith
I marked one of the
With
With the changesWith
I marked one of the ISOs as non-public. It stopped showing in
With
I marked one of the ISOs as non-public. It stopped showing with
My testing yielded the same results. The only caveat is that the featured not-public templates do not show under the featured filter to anyone. However, this situation was observed even without the patch; therefore, it is outside the scope of this PR. |
|
@hsato03 Do you think this is ready for merge, now? |
|
@DaanHoogland Yes, didn't test but CLGTM. |






Description
After the changes in #4774, when an account other than the root admin lists templates/ISOs with pagination, count gets set to the number of items returned in that page. For example, when the user lists 10 templates/ISOs and 15 entries are found, in the first page, count is set to 10 (the number of items being returned), as opposed to 15 (the total number of items). As a result, the deploy VM wizard only shows the first page of templates/ISOs.
This PR fixes this behavior and makes count return the correct number of found entries.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Everything has been tested in a local lab.
In the tested scenario, the following domains have templates:
ROOT: 13 public and featured templates;ROOT/test: 4 public and featured templates.CloudMonkey command used to list templates.
In every test, the expected number of templates/ISOs was returned.
With
share.public.templates.with.other.domainsset totruein both domains:ROOT, I listed the templates. I verified that the expected value of 17 was returned;ROOT/test, I listed the templates. I verified that the expected value of 17 was returned;ROOTas not public. Then, in a user account belonging toROOT, I listed the templates. I verified that the expected value of 16 was returned;ROOTas not public. Then, in a user account belonging toROOT/test, I listed the templates. I verified that the expected value of 16 was returned;ROOT/testas not public. Then, in a user account belonging toROOT, I listed the templates. I verified that the expected value of 16 was returned;ROOT/testas not public. Then, in a user account belonging toROOT/test, I listed the template. I verified that the expected value of 16 was returned.With
share.public.templates.with.other.domainsset tofalsein both domains:ROOT, I listed the templates. I verified that the expected value of 13 was returned;ROOT/test, I listed the templates. I verified that the expected value of 4 was returned;ROOTas not public. Then, in a user account belonging toROOT, I listed the templates. I verified that the expected value of 12 was returned;ROOTas not public. Then, in a user account belonging toROOT/test, I listed the templates. I verified that the expected value of 4 was returned;ROOT/testas not public. Then, in a user account belonging toROOT, I listed the templates. I verified that the expected value of 13 was returned;ROOT/testas not public. Then, in a user account belonging toROOT/test, I listed the template. I verified that the expected value of 3 was returned.I also verified the behavior of the listIsos API. In the tested scenario, the following domains have ISOs:
ROOT: 11 public and featured ISOs;ROOT/test: 2 public and featured ISOs.CloudMonkey command used to list ISOs.
With
share.public.templates.with.other.domainsset totruein both domains:ROOT, I listed the ISOs. I verified that the expected value of 13 was returned;ROOT/test, I listed the ISOs. I verified that the expected value of 13 was returned;ROOTas not public. Then, in a user account belonging toROOT, I listed the ISOs. I verified that the expected value of 12 was returned;ROOTas not public. Then, in a user account belonging toROOT/test, I listed the ISOs. I verified that the expected value of 12 was returned;ROOT/testas not public. Then, in a user account belonging toROOT, I listed the ISOs. I verified that the expected value of 12 was returned;ROOT/testas not public. Then, in a user account belonging toROOT/test, I listed the ISOs. I verified that the expected value of 12 was returned.With
share.public.templates.with.other.domainsset tofalsein both domains:ROOT, I listed the ISOs. I verified that the expected value of 11 was returned;ROOT/test, I listed the ISOs. I verified that the expected value of 2 was returned;ROOTas not public. Then, in a user account belonging toROOT, I listed the ISOs. I verified that the expected value of 10 was returned;ROOTas not public. Then, in a user account belonging toROOT/test, I listed the ISOs. I verified that the expected value of 2 was returned;ROOT/testas not public. Then, in a user account belonging toROOT, I listed the ISOs. I verified that the expected value of 11 was returned;ROOT/testas not public. Then, in a user account belonging toROOT/test, I listed the ISOs. I verified that the expected value of 1 was returned.I also verified the changes in the UI. Before, the deploy VM wizard showed only one page of templates/ISOs. After the changes, all pages are shown as expected.