small refactors on account manager - #11784
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #11784 +/- ##
=============================================
- Coverage 19.65% 3.41% -16.25%
=============================================
Files 6368 487 -5881
Lines 574889 41867 -533022
Branches 70353 7912 -62441
=============================================
- Hits 112985 1429 -111556
+ Misses 449634 40238 -409396
+ Partials 12270 200 -12070
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR performs small refactoring improvements to the AccountManagerImpl class to enhance code readability and maintainability. The changes include simplifying conditional logic, extracting reusable methods, and updating logging patterns.
- Simplified multiple conditional statements to use direct return expressions
- Extracted domain ID calculation logic into a reusable private method
- Updated logging to use parameterized format and modern charset handling
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9dc2f0d to
bee7667
Compare
bee7667 to
9c9bb32
Compare
|
|
||
| } | ||
|
|
||
| private static long getDomainIdFor(ControlledEntity entity) { |
There was a problem hiding this comment.
| private static long getDomainIdFor(ControlledEntity entity) { | |
| private long getDomainIdFor(ControlledEntity entity) { |
Can static be removed?
There was a problem hiding this comment.
sure, I think it can. Any pressing reason? It is a bit of a utility method and has no bearing on the manager internals.
There was a problem hiding this comment.
I don't think the keyword is useful here, but it's just a nitpicking. ;)
9c9bb32 to
10fa999
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Block when is not in the list of allowed IPs | ||
| if (!NetUtils.isIpInCidrList(loginIpAddress, accessAllowedCidrs.split(","))) { | ||
| logger.warn("Request by account '" + account.toString() + "' was denied since " + loginIpAddress.toString().replace("/", "") + " does not match " + accessAllowedCidrs); | ||
| logger.warn("Request by account '{}' was denied since {} does not match {}", account , loginIpAddress.toString().replace("/", ""), accessAllowedCidrs); |
There was a problem hiding this comment.
There's an extra space before the comma after the first placeholder. The code has "account ," but it should be "account," for consistent formatting.
| logger.warn("Request by account '{}' was denied since {} does not match {}", account , loginIpAddress.toString().replace("/", ""), accessAllowedCidrs); | |
| logger.warn("Request by account '{}' was denied since {} does not match {}", account, loginIpAddress.toString().replace("/", ""), accessAllowedCidrs); |
10fa999 to
a9df597
Compare
a9df597 to
7718dd8
Compare
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
Hi @DaanHoogland is this PR still in progress? |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18873 |
Description
This PR does some small refactors encountered during trouble shooting. ...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?