Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jan 1, 2026

Description

This PR add mountopts to backup repository response.

Fixes #12359

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?

Updated the mount options for the backup repository and re-open on the edit and update mount options again.

BEFORE CHANGES:

(localcloud) 🐱 > list backuprepositories 
{
  "backuprepository": [
    {
      "address": "10.0.32.4:/acs/secondary/ref-trl-9825-k-Mol8-suresh-anaparti/ref-trl-9825-k-Mol8-suresh-anaparti-backup1",
      "capacitybytes": 2898029182976,
      "created": "2025-10-29T08:04:43+0000",
      "id": "f61598ba-be80-4647-96e2-403e74e59027",
      "name": "backup1",
      "provider": "nas",
      "type": "nfs",
      "zoneid": "55b9a950-738c-4075-9111-05c106cac653",
      "zonename": "ref-trl-9825-k-Mol8-suresh-anaparti"
    },
    {
      "address": "10.0.32.4:/acs/secondary/ref-trl-9825-k-Mol8-suresh-anaparti/ref-trl-9825-k-Mol8-suresh-anaparti-backup2",
      "capacitybytes": 2898029182976,
      "created": "2025-10-29T20:45:47+0000",
      "crosszoneinstancecreation": true,
      "id": "5bbd734e-4dac-4926-9665-e116babcc345",
      "name": "backup2",
      "provider": "nas",
      "type": "nfs",
      "zoneid": "55b9a950-738c-4075-9111-05c106cac653",
      "zonename": "ref-trl-9825-k-Mol8-suresh-anaparti"
    }
  ],
  "count": 2
}

AFTER CHANGES:

BackupRepo_MountOptions
(localcloud) 🐱 > list backuprepositories
{
  "backuprepository": [
    {
      "address": "10.0.32.4:/acs/secondary/ref-trl-9825-k-Mol8-suresh-anaparti/ref-trl-9825-k-Mol8-suresh-anaparti-backup1",
      "capacitybytes": 2898029182976,
      "created": "2025-10-29T08:04:43+0000",
      "id": "f61598ba-be80-4647-96e2-403e74e59027",
      "mountopts": "testmntopts1",
      "name": "backup1",
      "provider": "nas",
      "type": "nfs",
      "zoneid": "55b9a950-738c-4075-9111-05c106cac653",
      "zonename": "ref-trl-9825-k-Mol8-suresh-anaparti"
    },
    {
      "address": "10.0.32.4:/acs/secondary/ref-trl-9825-k-Mol8-suresh-anaparti/ref-trl-9825-k-Mol8-suresh-anaparti-backup2",
      "capacitybytes": 2898029182976,
      "created": "2025-10-29T20:45:47+0000",
      "crosszoneinstancecreation": true,
      "id": "5bbd734e-4dac-4926-9665-e116babcc345",
      "mountopts": "testmntopts2",
      "name": "backup2",
      "provider": "nas",
      "type": "nfs",
      "zoneid": "55b9a950-738c-4075-9111-05c106cac653",
      "zonename": "ref-trl-9825-k-Mol8-suresh-anaparti"
    }
  ],
  "count": 2
}

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

@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.59%. Comparing base (7ff76cb) to head (3aba1ce).

Files with missing lines Patch % Lines
...udstack/api/response/BackupRepositoryResponse.java 0.00% 6 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 2 Missing ⚠️
...user/backup/repository/AddBackupRepositoryCmd.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #12360   +/-   ##
=========================================
  Coverage     17.59%   17.59%           
- Complexity    15597    15599    +2     
=========================================
  Files          5910     5910           
  Lines        529618   529626    +8     
  Branches      64708    64709    +1     
=========================================
+ Hits          93197    93204    +7     
  Misses       425930   425930           
- Partials      10491    10492    +1     
Flag Coverage Δ
uitests 3.57% <ø> (ø)
unittests 18.66% <0.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

Copilot AI left a comment

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 adds the mountopts field to the backup repository API response, fixing issue #12359 where mount options would disappear from the UI after saving even though they were persisted in the database.

  • Added mountOptions field to BackupRepositoryResponse with appropriate serialization and getter/setter methods
  • Updated ApiResponseHelper.createBackupRepositoryResponse() to populate the mount options from the repository entity
  • Minor formatting cleanup in BackupRepositoryService interface (removed trailing blank line)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
api/src/main/java/org/apache/cloudstack/api/response/BackupRepositoryResponse.java Added mountOptions field with serialization annotation, getter and setter methods to expose mount options in API responses
server/src/main/java/com/cloud/api/ApiResponseHelper.java Updated createBackupRepositoryResponse method to set mount options from the BackupRepository entity
api/src/main/java/org/apache/cloudstack/backup/BackupRepositoryService.java Removed trailing blank line (formatting cleanup)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

Code LGTM

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup Repository Mount Option goes away in UI but setting are saved in 4.22

3 participants