You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/12/16 06:30:07 UTC

[GitHub] [cloudstack] Pearl1594 opened a new pull request #5782: api: Fix search cluster by name

Pearl1594 opened a new pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782


   ### Description
   
   This PR fixes an issue noticed while searching for clusters based on name. When the 'name' parameter is passed, it treats it as a keyword to be searched (https://github.com/apache/cloudstack-cloudmonkey/issues/109). 
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   #### Prior Fix:
   ```
   (localcloud) 🐱 > list clusters name=Pool1 filter=name,id,
   {
     "cluster": [
       {
         "id": "0b02dfba-27b8-4371-ad16-23d6df57ffca",
         "name": "Pool1"
       },
       {
         "id": "dc6a03fd-7d33-47cd-9bc0-a15c8fcda139",
         "name": "Pool10"
       }
     ],
     "count": 2
   }
   
   ```
   #### Post Fix:
   ```
   (localcloud) 🐱 > list clusters name=Pool1 filter=name,id,
   {
     "cluster": [
       {
         "id": "11d536bb-7719-4c39-8ecc-eca11d2ef3bf",
         "name": "Pool1"
       }
     ],
     "count": 1
   }
   (localcloud) 🐱 > list clusters name=Pool filter=name,id,
   (localcloud) 🐱 > list clusters keyword=Pool1 filter=name,id,
   {
     "cluster": [
       {
         "id": "11d536bb-7719-4c39-8ecc-eca11d2ef3bf",
         "name": "Pool1"
       },
       {
         "id": "67fd82e2-ab33-4b7f-af5b-95a6a38b4191",
         "name": "Pool10"
       }
     ],
     "count": 2
   }
   
   
   ```
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995511932


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-999291424


   Merging this based on the approvals and test results.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995786499


   @Pearl1594 @sureshanaparti @DaanHoogland 
   
   do we need to fix the similar issue in following file ?
   ```
   engine/schema/src/main/java/org/apache/cloudstack/acl/dao/ProjectRoleDaoImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + podName + "%");
   server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995963065


   > > @Pearl1594 @sureshanaparti @DaanHoogland
   > > do we need to fix the similar issue in following file ?
   > > ```
   > > engine/schema/src/main/java/org/apache/cloudstack/acl/dao/ProjectRoleDaoImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   > > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + podName + "%");
   > > server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > > server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   > > ```
   > 
   > Agree, if name param in the API has to exactly match with the name in the respective resource. Please note, this may fail any of the scripts written considering the name param as keyword (as it changes the API response behavior).
   
   @sureshanaparti yes, it will break backwards compatibility.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995480231


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-996616882


   > This is the same for the `listHosts`. Do we need to fix other searches as well, such as for hosts?
   > 
   > Additionally, this will change the behavior of the UI searches. I particularly have been using a lot the list filtering to give hosts/clusters with name matching with the provided string. I am not sure what would be the best option here, but particularly I like having the possibility to filter hosts by name. If we want a specific host we can already filter by uuid.
   
   I don't think it does @GabrielBrascher, the UI uses the keyword parameter and not the name (unless there's a bug there as well.
   
   > 
   > However, if the expected behavior of the API is to list by matching exactly with the name, then this PR is OK. But we might need to refactor the UI.
   
   The problem is mainly custom scripts I think, but we could label it a bug that has been featured. I that case we would need to deprecate the existing bahaviour and implement a new API with correct behaviour (to be very formally correct)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti merged pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
sureshanaparti merged pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995481630


   @Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995512843


   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-996670423


   I agree with what @DaanHoogland mentioned. Ideally this is an issue with the way the API has worked. If users do have scripts that pass name to list resources with matching names (i.e., like a wildcard) then it would need to be changed, to use 'keyword' parameter to do the same.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995977456


   <b>Trillian test result (tid-2661)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 30756 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5782-t2661-kvm-centos7.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995893304


   > @Pearl1594 @sureshanaparti @DaanHoogland
   > 
   > do we need to fix the similar issue in following file ?
   > 
   > ```
   > engine/schema/src/main/java/org/apache/cloudstack/acl/dao/ProjectRoleDaoImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/com/cloud/server/ManagementServerImpl.java:            sc.setParameters("name", "%" + podName + "%");
   > server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:            sc.setParameters("name", "%" + name + "%");
   > server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:            sc.setParameters("name", "%" + keyword + "%");
   > ```
   
   Agree, if name param in the API has to exactly match with the name in the respective resource. Please note, this may fail any of the scripts written considering the name param as keyword (as it changes the API response behavior).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5782: api: Fix search cluster by name

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5782:
URL: https://github.com/apache/cloudstack/pull/5782#issuecomment-995511627


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1910


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org