Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:db automatic database backup #4377

Merged
merged 1 commit into from
Dec 5, 2023
Merged

feat:db automatic database backup #4377

merged 1 commit into from
Dec 5, 2023

Conversation

zjy365
Copy link
Contributor

@zjy365 zjy365 commented Dec 4, 2023

πŸ€–[deprecated] Generated by Copilot at 0170ef1

Summary

πŸŒπŸ› οΈπŸ’Ύ

This pull request adds a new feature to the frontend of the dbprovider, which allows users to turn off the automatic backup of a cluster and view the backup policy details. It also updates the backup API and UI components to use the new backup policy structure in the cluster spec, and fixes some localization and git issues. The main files affected are BackupModal.tsx, BackupTable.tsx, backup.ts, updatePolicy.ts, and adapt.ts.

backup UI texts
adapt to cluster spec change
autumn leaves falling

Walkthrough

  • Remove unused keys from English localization file (link, link)
  • Add new keys and values for backup UI texts to English and Chinese localization files (link, link)
  • Import getBackupPolicyByCluster function from backup API module to backup API file (link)
  • Delete empty getBackupPolicy function from backup policy API file (link)
  • Log dbName, dbType, and patch parameters for debugging (link)
  • Use apps.kubeblocks.io group and clusters plural for patching cluster resource (link)
  • Use dbName as name and patch as body of patchNamespacedCustomObject call (link)
  • Include data property with patch result in jsonRes call (link)
  • Use useConfirm hook to create confirmation dialog for turning off automatic backup (link)
  • Use new path and value for backup spec in patch variable (link)
  • Use updateBackupPolicy API function to turn off automatic backup by setting enabled to false (link)
  • Check defaultVal.start and call CloseAutoBackup function with onclickCloseAutoBackup function as argument (link)
  • Render AutoBackupConfirmChild component as confirmation dialog (link)
  • Import getBackupPolicyByCluster function from backup API module (link)
  • Use getBackupPolicyByCluster function instead of getBackupPolicy function in useQuery hook call (link)
  • Add adaptBackupPolicy function to adapt.ts module to adapt backup policy data from cluster spec to auto backup form type (link)
  • Use --rebase option for git pull command to avoid merge conflicts (link)
  • Add error parameter to console.log statement to print error message if git operation times out (link)

Signed-off-by: jingyang <3161362058@qq.com>
@sealos-ci-robot
Copy link
Member

πŸ€– Generated by lychee action

Summary

Status Count
πŸ” Total 1081
βœ… Successful 395
⏳ Timeouts 0
πŸ”€ Redirected 0
πŸ‘» Excluded 685
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Dec 4, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (f52b174) 65.45% compared to head (0170ef1) 65.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4377   +/-   ##
=======================================
  Coverage   65.45%   65.45%           
=======================================
  Files           8        8           
  Lines         660      660           
=======================================
  Hits          432      432           
  Misses        180      180           
  Partials       48       48           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@c121914yu c121914yu merged commit d518f58 into labring:main Dec 5, 2023
28 of 29 checks passed
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.

3 participants