-
Notifications
You must be signed in to change notification settings - Fork 208
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 issue 9947, use isEmpty() for checking emptiness #9981
base: master
Are you sure you want to change the base?
Conversation
👋 Hello! Thanks for contributing to our project. You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/9981/checks If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code. Reference tests: KNOWN ISSUES Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience. For more tips on troubleshooting, see the troubleshooting guide. Happy hacking! |
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.
The text of the PR is twisted:
- GUI DIFF: remove before and after
- FALSE: No tests needed: already covered by existing tests.
- LINKS: in the original text you are requested to give only reference to the issue and backports (other things are not to be added)
- CHANGELOGS: why "No changelog needed"? You do need a changelog here. Please look at the rules to make one and do it. Then remove all other comments: that is not the place where they are requested
@CDellaGiusta Thank you for your feedback, I am new to open sourcing and appreciate the guidance. I still have some questions:
|
No. I had a quick chat with some colleagues, and the substitutions you did in the code are ok as you did it.
Something like: No tests done: just fixing sonar cloud issues
Just the first line is ok, something like "- Fixed SonarCloud Rule S1155 violations", how you did it is in the code, and "Improved code readability and maintainability" is not worth mentioning Please correct the changelog file, and add it to the commit (squashing it in 1 commit only) Then wait for some other reviewers to approve. |
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.
Your code changes are fine for me. However I would like you to copy the PR description as the commit message:
Refactored Java code to comply with SonarCloud rule S1155:
Replaced instances of collection.size() < 1 with collection.isEmpty(), and collection.size() >= 1 with !collection.isEmpty().
Github may go away, git history will last for ever!
Replaced instances of collection.size() < 1 with collection.isEmpty(), and collection.size() >= 1 with !collection.isEmpty().
@CDellaGiusta I have made the changes that you had suggested, I used osc vc to write the changelog, but the changelog check failed. Is it alright? Kindly review this PR. |
The check fails because you have to name the changelog correctly.
If not explicitly specified, fetch username and feature_name from git email's
Please note that you have to make your own branch (you can't be on master), I guess yours is fix-9947
please be aware that the max lenght is 65 and that any must then be aligned on the following line. |
https://github.com/uyuni-project/uyuni/wiki/Contributing#submitting-to-git |
Such a PR does not need a changelog entry. Remember that a changelog entry is something read by the end user. I would rather remove the changelog change from that commit and simply click the |
Ok, that's fair enough. |
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.
Thanks for the PR, @RohitBhojak. The code looks good. As per the comments above, just revert back spacewalk-java.changes
and you're good to go.
What does this PR change?
Refactored Java code to comply with SonarCloud rule S1155:
Replaced instances of
collection.size() < 1
withcollection.isEmpty()
, andcollection.size() >= 1
with!collection.isEmpty()
.GUI diff
No difference.
Documentation
No documentation needed: only internal and user-invisible changes
DONE
Test coverage
No tests done: just fixing sonar cloud issues
DONE
Links
Issue(s): #9947
Changelogs
Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:
Before you merge
Check How to branch and merge properly!