Uh oh!
There was an error while loading. Please reload this page.
Fix templates and ISOs listing pagination - #7974
Conversation
DaanHoogland
commented
Sep 19, 2023
@blueorangutan package |
blueorangutan
commented
Sep 19, 2023
@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 |
blueorangutan
commented
Sep 19, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7057 |
DaanHoogland
commented
Sep 19, 2023
@blueorangutan test |
blueorangutan
commented
Sep 19, 2023
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Sep 19, 2023
[SF] Trillian test result (tid-7688)
|
Uh oh!
There was an error while loading. Please reload this page.
DaanHoogland
commented
Sep 28, 2023
@blueorangutan package |
blueorangutan
commented
Sep 28, 2023
@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. |
blueorangutan
commented
Sep 28, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7149 |
DaanHoogland
commented
Sep 28, 2023
@blueorangutan test |
blueorangutan
commented
Sep 28, 2023
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Sep 29, 2023
[SF] Trillian test result (tid-7756)
|
GutoVeronezi
commented
Oct 9, 2023
@shwstppr@DaanHoogland it would be interesting to have this fix on 4.19 |
DaanHoogland
commented
Oct 9, 2023
@hsato03 are you allright with this PR like this? |
hsato03
commented
Oct 9, 2023
Code LGTM |
winterhazel
commented
Oct 9, 2023
@DaanHoogland yes, some users have tested these changes; I will ask them to report the results here. |
1d228d3 to
15f5279Compare15f5279 to
0fc8748CompareDaanHoogland
commented
Oct 9, 2023
@blueorangutan package |
blueorangutan
commented
Oct 9, 2023
@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. |
blueorangutan
commented
Oct 9, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7285 |
DaanHoogland
commented
Oct 10, 2023
@blueorangutan test |
blueorangutan
commented
Oct 10, 2023
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Oct 10, 2023
[SF] Trillian test result (tid-7896)
|
DaanHoogland
commented
Oct 11, 2023
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. |
DaanHoogland
commented
Oct 19, 2023
@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.