You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "MANN3005 (via GitHub)" <gi...@apache.org> on 2023/11/23 22:46:12 UTC
[PR] Enhancement to files to improve readability [cloudstack]
MANN3005 opened a new pull request, #8263:
URL: https://github.com/apache/cloudstack/pull/8263
### Description
This PR...
I have refactored code by following certain refactoring techniques and enhanced code readability and less complexity.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [x] 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 -->
#### How did you try to break this feature and the system with this change?
I have checked the build and the class behaviour and it has been working perfectly.
<!-- 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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1829495131
<b>[SF] Trillian Build Failed (tid-8407)<b/>
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "MANN3005 (via GitHub)" <gi...@apache.org>.
MANN3005 closed pull request #8263: Enhancement to files to improve readability
URL: https://github.com/apache/cloudstack/pull/8263
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1827314617
@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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "MANN3005 (via GitHub)" <gi...@apache.org>.
MANN3005 commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1405124906
##########
agent/src/main/java/com/cloud/agent/IAgentShell.java:
##########
@@ -37,14 +37,12 @@ public interface IAgentShell {
String getNextHost();
- String getPrivateIp();
+
Review Comment:
Refactored it using push down method and Moved it to the implementation of that
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1405769192
##########
agent/src/main/java/com/cloud/agent/IAgentShell.java:
##########
@@ -37,14 +37,12 @@ public interface IAgentShell {
String getNextHost();
- String getPrivateIp();
+
Review Comment:
Ok, this change mandates that this be extensively tested for regressions. The rest of the PR seems trivial.
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1829368984
<b>[SF] Trillian Build Failed (tid-8404)<b/>
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1828225945
@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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1405188767
##########
agent/src/main/java/com/cloud/agent/IAgentShell.java:
##########
@@ -37,14 +37,12 @@ public interface IAgentShell {
String getNextHost();
- String getPrivateIp();
+
Review Comment:
That is how you did it. I get that. But why do you think this is an improvement?
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1829557575
@MANN3005 I see this on hosts:
```
2023-11-28 09:32:44,674 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
java.lang.NullPointerException
at com.cloud.agent.AgentShell.getHosts(AgentShell.java:155)
at com.cloud.agent.AgentShell.getNextHost(AgentShell.java:117)
at com.cloud.agent.Agent.<init>(Agent.java:197)
at com.cloud.agent.AgentShell.launchNewAgent(AgentShell.java:451)
at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:430)
at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:414)
at com.cloud.agent.AgentShell.start(AgentShell.java:510)
at com.cloud.agent.AgentShell.main(AgentShell.java:540)
```
On MSses I see that they are not able to reach each other or the hosts. I haven´t investigated further yet, so I can't say what is wrong exactly but my first guess is the public methods being expected somewhere. Can you try reverting just that part?
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1405124216
##########
agent/src/main/java/com/cloud/agent/IAgentShell.java:
##########
@@ -37,14 +37,12 @@ public interface IAgentShell {
String getNextHost();
- String getPrivateIp();
+
Review Comment:
@MANN3005 , what is your reason to remove these from the interface?
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1828231872
@DaanHoogland a [SL] 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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1827393803
Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7836
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1825749065
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8263?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`5c7e4b7`)](https://app.codecov.io/gh/apache/cloudstack/commit/5c7e4b7edc88a588b94db64998e83b6fcc76048a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 29.16% compared to head [(`e14bf0f`)](https://app.codecov.io/gh/apache/cloudstack/pull/8263?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 4.49%.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #8263 +/- ##
============================================
- Coverage 29.16% 4.49% -24.67%
============================================
Files 5193 354 -4839
Lines 366292 27907 -338385
Branches 53555 4881 -48674
============================================
- Hits 106816 1255 -105561
+ Misses 244832 26514 -218318
+ Partials 14644 138 -14506
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8263/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8263/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8263/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.49% <ø> (ø)` | |
| [unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8263/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/8263?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1824976534
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:
- In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
- Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
- Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
- Please follow [ASF Code of Conduct](https://github.com/apache/.github/blob/main/.github/CODE_OF_CONDUCT.md) for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
- Be sure to read the [CloudStack Coding Conventions](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions).
Apache CloudStack is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@cloudstack.apache.org (https://cloudstack.apache.org/mailing-lists.html)
Slack: https://apachecloudstack.slack.com/
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1827316508
@DaanHoogland a [SL] 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.
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1828317085
<b>[SF] Trillian Build Failed (tid-8401)<b/>
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "MANN3005 (via GitHub)" <gi...@apache.org>.
MANN3005 commented on PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#issuecomment-1829995952
Yes will revert it
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1428399613
##########
core/src/main/java/org/apache/cloudstack/agent/lb/SetupMSListCommand.java:
##########
@@ -25,27 +25,27 @@
public class SetupMSListCommand extends Command {
- private List<String> msList;
- private String lbAlgorithm;
- private Long lbCheckInterval;
Review Comment:
why add the final?
--
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
Re: [PR] Enhancement to files to improve readability [cloudstack]
Posted by "MANN3005 (via GitHub)" <gi...@apache.org>.
MANN3005 commented on code in PR #8263:
URL: https://github.com/apache/cloudstack/pull/8263#discussion_r1405189489
##########
agent/src/main/java/com/cloud/agent/IAgentShell.java:
##########
@@ -37,14 +37,12 @@ public interface IAgentShell {
String getNextHost();
- String getPrivateIp();
+
Review Comment:
It's because that has only 1 implementation and it in the file where I moved it so to remove unnecessary abstraction
--
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