Skip to content

ui: list resources of project-owned instances outside project view - #14581

Open
DaanHoogland wants to merge 5 commits into
4.20from
ghi14572-projectVmVolumes
Open

DaanHoogland wants to merge 5 commits into
4.20from
ghi14572-projectVmVolumes

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

When a project-owned instance is opened outside its project (Default view, or another project selected), several lists on the instance page come up empty or show the caller's own resources instead of the project's. The list APIs skip project resources unless the request names a project, and these calls did not send one.

Each call now sends the instance's own projectid:

  • volumes: the instance Volumes tab, and the volume lists in the snapshot, destroy and migrate dialogs (listVolumes)
  • networks: the Add network to instance dialog on the NICs tab (listNetworks)
  • security groups: the Change security groups dialog and the Edit instance form (listSecurityGroups); SecurityGroupSelection gets an optional projectId prop, so the deploy wizards keep using the selected project
  • instance groups: the Edit instance form (listInstanceGroups)

The instance's own project is used rather than projectid=-1, because -1 only reaches the caller's own account and the projects the caller is a member of, which would hide other accounts' resources from a domain admin. An instance outside any project sends no projectid, so its requests are unchanged. The project view keeps working as before: the request interceptor only adds the selected project when a call has none.

The Add network dialog also no longer throws when there is no network left to offer.

The VolumesTab spec comes from #14158 (without its GiB label test, which depends on a change that is not on 4.20).

Fixes #14572
Fixes #14573
Fixes #14070

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?

  • VolumesTab.spec.js covers root admin and domain admin callers in Default view, in the instance's project and in another project, plus instances outside any project and system VMs. Without the fix, the three cases for a project instance outside its project fail.
  • Headless Chrome against a dev management server, with the instance response rewritten to carry a projectid: the Volumes tab sends projectid=<project>; for an instance outside any project the request is unchanged.
  • eslint on all changed files.

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

Checked that an explicit projectid wins over the selected project in the request interceptor and that an undefined one falls back to it, so the project view and instances outside any project send the same requests as before. SecurityGroupSelection drops account/domainid when a project is passed, since the API rejects account together with projectid.

🤖 Generated with Claude Code

@DaanHoogland DaanHoogland added this to the 4.20.4 milestone Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.45%. Comparing base (18c4bdf) to head (6f332e9).

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #14581      +/-   ##
============================================
+ Coverage     16.44%   16.45%   +0.01%     
- Complexity    13686    13688       +2     
============================================
  Files          5669     5669              
  Lines        501683   501686       +3     
  Branches      60944    60950       +6     
============================================
+ Hits          82480    82540      +60     
+ Misses       409965   409898      -67     
- Partials       9238     9248      +10     
Flag Coverage Δ
uitests 4.28% <ø> (+0.11%) ⬆️
unittests 17.31% <ø> (+<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 changed the title ui: list volumes of project-owned instances outside project view ui: list resources of project-owned instances outside project view Nov 4, 2026
@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 KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@1fanwang, please review my version of your fix here.

@blueorangutan

Copy link
Copy Markdown

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

@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-17490)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54797 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14581-t17490-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@bddvlpr

bddvlpr commented Nov 6, 2026

Copy link
Copy Markdown

Unsure if it's something wrong on my setup but I cannot see templates on the "Default view" anymore without the following patch.

diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue
index 72cb74399d..dba8501023 100644
--- a/ui/src/views/compute/DeployVM.vue
+++ b/ui/src/views/compute/DeployVM.vue
@@ -1007,7 +1007,7 @@ export default {
         groups: false
       },
       owner: {
-        projectid: store.getters.project?.id,
+        projectid: store.getters.project?.id || null,
         domainid: store.getters.project?.id ? null : store.getters.userInfo.domainid,
         account: store.getters.project?.id ? null : store.getters.userInfo.account
       },

The rest seems to work. I can see the resources from the default view while they are owned by a project.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@bddvlpr , thanks for the finding, I'll look into that and update.

@DaanHoogland
DaanHoogland force-pushed the ghi14572-projectVmVolumes branch from 2dacf7d to 34cb371 Compare November 6, 2026 14:06
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@bddvlpr, it wasn't you/your env, but a conflict with an old PR. I added a fix. hope all works now.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/14581 (QA-JID-1012)

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

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

None yet

3 participants