Skip to content

Backup rework pt 2 - #1967

Merged
Timofei Larkin (lllamnyp) merged 2 commits into
feat/backup-work-consolidationfrom
backup-rework-pt-2
Feb 3, 2026
Merged

Timofei Larkin (lllamnyp) merged 2 commits into
feat/backup-work-consolidationfrom
backup-rework-pt-2

Conversation

@androndo

Copy link
Copy Markdown
Contributor

What this PR does

Release note

[
- add BackupClass Velero and strategy for VM
- dashboard fixes for BackupClass and simplifed Plan/BackupJob API
]

@coderabbitai

coderabbitai Bot commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backup-rework-pt-2

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • ✨ 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello Andrey Kolkov (@androndo), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the backup capabilities by introducing a dedicated BackupClass for Virtual Machines, which utilizes Velero to manage backup strategies. It provides a robust framework for defining what and how VM-related resources are backed up. Concurrently, the user interface has been refined to seamlessly integrate these new backup functionalities, offering a more intuitive experience for configuring and viewing backup plans.

Highlights

  • New BackupClass for Virtual Machines: Introduced a new BackupClass named velero specifically designed for Virtual Machines, leveraging Velero for backup operations.
  • Velero Backup Strategy for VMs: Implemented a detailed Velero backup strategy for Virtual Machines, specifying included Kubernetes resources (like helmreleases, virtualmachines, datavolumes, persistentvolumeclaims, etc.) and backup parameters such as storageLocation and ttl.
  • Dashboard UI Enhancements for Backups: Updated the dashboard UI to support the new BackupClass concept, including a new form override for backup plans that allows users to select a BackupClass via an API-driven dropdown. Display logic for backup-related information has been simplified to show the Backup Class name instead of separate storage and strategy references.
  • API-Driven Form Item Creation: Added a new helper function createFormItemWithAPI to facilitate the creation of dashboard form items that dynamically fetch data from API endpoints, enabling resource-based select fields.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • internal/controller/dashboard/static_refactored.go
    • Added a new form override for backups.cozystack.io/v1alpha1/plans to enable BackupClass selection.
    • Replaced storageRef and strategyRef display blocks with a unified backupClassName display in various dashboard factories.
    • Introduced createFormItemWithAPI helper for API-driven select form items.
  • packages/system/backup-controller/templates/class.yaml
    • Added a new BackupClass definition named velero for Virtual Machines.
  • packages/system/virtual-machine-rd/cozyrds/backup-strategy.yaml
    • Added a new Velero backup strategy for Virtual Machines, detailing included resources and backup configurations.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the backup functionality by introducing BackupClass to simplify the Plan and BackupJob APIs. The dashboard changes align with this simplification. My review includes a correction for a potentially critical bug in the Velero backup strategy template and a couple of suggestions to improve the user interface for creating backup plans.

Comment on lines +11 to +12
labelSelector:
apps.cozystack.io/application.Kind: {{ .kind }}

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.

high

The labelSelector field appears to be structured incorrectly. According to the Velero API specification, it should contain a matchLabels field. The current structure may not be parsed correctly by Velero, which could cause backups to fail to select any resources.

      labelSelector:
        matchLabels:
          apps.cozystack.io/application.Kind: {{ .kind }}

Comment on lines +504 to +505
createFormItem("spec.applicationRef.kind", "Application Kind", "text"),
createFormItem("spec.applicationRef.name", "Application Name", "text"),

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.

medium

Using text inputs for Application Kind and Application Name is error-prone. To improve user experience and prevent typos, consider using a component that allows selecting an existing application from a list. This would ensure a valid application is selected.

"clusterNameVar": "clusterName",
},
}),
createFormItem("spec.schedule.type", "Schedule Type", "text"),

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.

medium

The Schedule Type is based on the PlanScheduleType enum. Using a select input type instead of text would be more appropriate and prevent users from entering invalid values.

Suggested change
createFormItem("spec.schedule.type", "Schedule Type", "text"),
createFormItem("spec.schedule.type", "Schedule Type", "select"),

snapshotMoveData: true

ttl: 720h0m0s
itemOperationTimeout: 24h0m0s

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.

medium

The itemOperationTimeout is set to 24 hours, which is significantly longer than Velero's default of 1 hour. Such a long timeout could cause the entire backup process to hang for an extended period if a single item operation gets stuck. Consider reducing this to a more reasonable value (e.g., 4h0m0s) to prevent potential stalls in the backup queue.

      itemOperationTimeout: 4h0m0s

@lllamnyp
Timofei Larkin (lllamnyp) changed the base branch from main to feat/backup-work-consolidation February 3, 2026 17:15
@lllamnyp
Timofei Larkin (lllamnyp) marked this pull request as ready for review February 3, 2026 17:27
@dosubot dosubot Bot added the size/L This PR changes 100-499 lines, ignoring generated files label Feb 3, 2026
@lllamnyp
Timofei Larkin (lllamnyp) merged commit 3eaadfc into feat/backup-work-consolidation Feb 3, 2026
5 of 6 checks passed
@lllamnyp
Timofei Larkin (lllamnyp) deleted the backup-rework-pt-2 branch February 3, 2026 17:27
@dosubot dosubot Bot added the kind/feature Categorizes issue or PR as related to a new feature label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants