You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "shwstppr (via GitHub)" <gi...@apache.org> on 2023/04/11 06:02:20 UTC
[GitHub] [cloudstack] shwstppr opened a new pull request, #7423: ui: fix custom offering cpuspeed during vm import
shwstppr opened a new pull request, #7423:
URL: https://github.com/apache/cloudstack/pull/7423
### Description
Fixes #7420
Fixes CPU speed param value when using custom compute offering during VM import
### 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
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
<!-- see how your change affects other areas of the code, etc. -->
<!-- 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] rohityadavcloud merged pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud merged PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423
--
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] shwstppr commented on a diff in pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on code in PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#discussion_r1169670872
##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -522,6 +523,9 @@ export default {
}
return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER
},
+ getCPUSpeed () {
+ return (this.computeOffering.iscustomized ? this.resource.cpuspeed : 0) || this.computeOffering?.cpuspeed * 1 || 0
Review Comment:
refactored
--
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 a diff in pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#discussion_r1180073546
##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -522,6 +523,15 @@ export default {
}
return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER
},
+ getCPUSpeed () {
+ if (!this.computeOffering) {
+ return 0
+ }
+ if (this.computeOffering.cpuspeed) {
+ return this.computeOffering.cpuspeed * 1
+ }
+ return this.resource.cpuspeed * 1 || 0
Review Comment:
is the `|| 0` needed here?
--
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 #7423: ui: fix custom offering cpuspeed during vm import
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#issuecomment-1516038393
@rohityadavcloud a Jenkins job has been kicked to build UI QA env. 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] codecov[bot] commented on pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#issuecomment-1502784875
## [Codecov](https://codecov.io/gh/apache/cloudstack/pull/7423?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#7423](https://codecov.io/gh/apache/cloudstack/pull/7423?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e93928e) into [4.18](https://codecov.io/gh/apache/cloudstack/commit/9e1304212054c4b92128c49e23c4223252eea5a1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9e13042) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## 4.18 #7423 +/- ##
============================================
- Coverage 12.69% 12.69% -0.01%
+ Complexity 8661 8656 -5
============================================
Files 2717 2717
Lines 256165 256161 -4
Branches 39928 39926 -2
============================================
- Hits 32526 32512 -14
- Misses 219504 219515 +11
+ Partials 4135 4134 -1
```
[see 2 files with indirect coverage changes](https://codecov.io/gh/apache/cloudstack/pull/7423/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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] sonarcloud[bot] commented on pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#issuecomment-1502794628
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7423)
[](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7423&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7423&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7423&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7423&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7423&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7423&metric=duplicated_lines_density&view=list) No Duplication information
--
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] rohityadavcloud commented on a diff in pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on code in PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#discussion_r1180255893
##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -522,6 +523,15 @@ export default {
}
return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER
},
+ getCPUSpeed () {
+ if (!this.computeOffering) {
+ return 0
+ }
+ if (this.computeOffering.cpuspeed) {
+ return this.computeOffering.cpuspeed * 1
+ }
+ return this.resource.cpuspeed * 1 || 0
Review Comment:
if the NaN is created from previous expression, then NaN || 0 will return 0. I think this LGTM.
--
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] rohityadavcloud commented on pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#issuecomment-1516036833
@blueorangutan ui
--
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 #7423: ui: fix custom offering cpuspeed during vm import
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#issuecomment-1516055331
UI build: :heavy_check_mark:
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/7423 (QA-JID-91)
--
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 a diff in pull request #7423: ui: fix custom offering cpuspeed during vm import
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7423:
URL: https://github.com/apache/cloudstack/pull/7423#discussion_r1168819809
##########
ui/src/views/tools/ImportUnmanagedInstance.vue:
##########
@@ -522,6 +523,9 @@ export default {
}
return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER
},
+ getCPUSpeed () {
+ return (this.computeOffering.iscustomized ? this.resource.cpuspeed : 0) || this.computeOffering?.cpuspeed * 1 || 0
Review Comment:
should it be
```suggestion
return (this.computeOffering?.iscustomized ? this.resource.cpuspeed : 0) || this.computeOffering?.cpuspeed * 1 || 0
```
?
It seems we don´t trust the presence of `this.computeOffering` in the later part but rely on it in hte first part of the expression.
--
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