Skip to content

small refactors on account manager - #11784

Open
DaanHoogland wants to merge 3 commits into
apache:mainfrom
DaanHoogland:accountManagerRefactors
Open

DaanHoogland wants to merge 3 commits into
apache:mainfrom
DaanHoogland:accountManagerRefactors

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR does some small refactors encountered during trouble shooting. ...

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)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

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?

How did you try to break this feature and the system with this change?

@DaanHoogland DaanHoogland modified the milestones: 4.23, 4.20.3 Oct 3, 2025
@codecov

codecov Bot commented Oct 3, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.76%. Comparing base (d6390bd) to head (c20d96a).

Files with missing lines Patch % Lines
...c/main/java/com/cloud/user/AccountManagerImpl.java 58.33% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #11784   +/-   ##
=========================================
  Coverage     20.76%   20.76%           
- Complexity    21903    21910    +7     
=========================================
  Files          6496     6496           
  Lines        591612   591612           
  Branches      72585    72584    -1     
=========================================
+ Hits         122851   122868   +17     
+ Misses       455424   455407   -17     
  Partials      13337    13337           
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.07% <58.33%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
DaanHoogland requested a lite review from Copilot October 6, 2025 06:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DaanHoogland
DaanHoogland marked this pull request as ready for review October 7, 2025 07:09
@DaanHoogland
DaanHoogland force-pushed the accountManagerRefactors branch from 9dc2f0d to bee7667 Compare December 8, 2025 15:34
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@apache apache deleted a comment from blueorangutan Dec 8, 2025
@DaanHoogland
DaanHoogland force-pushed the accountManagerRefactors branch from bee7667 to 9c9bb32 Compare December 8, 2025 15:50
@apache apache deleted a comment from blueorangutan Dec 9, 2025

@hsato03 hsato03 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DaanHoogland
DaanHoogland force-pushed the accountManagerRefactors branch from 10fa999 to a9df597 Compare December 23, 2025 19:41
@apache apache deleted a comment from blueorangutan Aug 17, 2026
@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16768)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56898 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11784-t16768-kvm-ol8.zip
Smoke tests completed. 155 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_ssl_offloading_isolated_network Failure 710.49 test_ssl_offloading.py
test_02_ssl_offloading_project_vpc Failure 809.94 test_ssl_offloading.py

@DaanHoogland
DaanHoogland marked this pull request as ready for review August 18, 2026 07:26
@DaanHoogland DaanHoogland moved this from Backlog to Ready in CloudStack Testing Aug 31, 2026
@RosiKyu RosiKyu self-assigned this Sep 8, 2026
@RosiKyu

RosiKyu commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

@DaanHoogland could you merge main into this branch please?

The PR targets main (24.0) but the branch is still on 4.23.0.0-SNAPSHOT, so the PR packages are being built as 4.23 and we cannot test them against a 24.0 environment.

Copilot AI review requested due to automatic review settings September 8, 2026 07:00
@DaanHoogland
DaanHoogland force-pushed the accountManagerRefactors branch from ef1e1d8 to 55eae45 Compare September 8, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The domain-grouping map lookup in checkAccess still uses entity.getDomainId() instead of the resolved domainId, which can drop earlier entities and break the new test expectations.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Account account = ApiDBUtils.findAccountById(entity.getAccountId());
domainId = account != null ? account.getDomainId() : -1;
}
long domainId = getDomainIdFor(entity);
@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez 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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 19784

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

I will revisit these kinds of refactors in quieter times

@DaanHoogland
DaanHoogland marked this pull request as draft October 28, 2026 11:31
@DaanHoogland
DaanHoogland force-pushed the accountManagerRefactors branch from 55eae45 to c20d96a Compare November 2, 2026 10:54
@DaanHoogland
DaanHoogland marked this pull request as ready for review November 2, 2026 10:57
Copilot AI lite review requested due to automatic review settings November 2, 2026 10:57
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and regression coverage addresses the corrected domain-resolution and grouping behavior.

1 open issue

Review effort: Lite

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19877

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-17475)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56041 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11784-t17475-kvm-ol8.zip
Smoke tests completed. 157 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

9 participants