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: state backend using workspace, and upgrade of state #669

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

healthjyk
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

  1. update package /engine/backend, use cli flags, environment variables, and workspace backend configs in descending order to generate state storage.
  2. cmd/preview, cmd/apply and cmd/project use the new NewStateStorage;
  3. do not support path config for local backend, and default state file updated to kusion_state.yaml;
  4. rename db backend to mysql, allow password empty;
  5. backend s3, allow endpoint empty, default state file updated to kusion_state.yaml;
  6. backend oss, default state file updated to kusion_state.yaml;
  7. delete Backend in Configuration of project, do not support configure backend in project.yaml.

Which issue(s) this PR fixes:

Fixes #647

@coveralls
Copy link

coveralls commented Dec 11, 2023

Pull Request Test Coverage Report for Build 7209460420

  • 294 of 381 (77.17%) changed or added relevant lines in 13 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 74.534%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/engine/states/local/backend.go 3 4 75.0%
pkg/engine/states/local/filesystem_state.go 31 33 93.94%
pkg/cmd/preview/options.go 2 5 40.0%
pkg/engine/backend/util.go 18 22 81.82%
pkg/cmd/destroy/options.go 4 9 44.44%
pkg/engine/backend/options.go 47 53 88.68%
pkg/engine/states/remote/mysql/mysql_backend.go 33 46 71.74%
pkg/engine/states/remote/oss/oss_state.go 13 29 44.83%
pkg/engine/states/remote/s3/s3_state.go 28 44 63.64%
pkg/engine/backend/config.go 104 125 83.2%
Files with Coverage Reduction New Missed Lines %
pkg/engine/states/local/backend.go 1 75.0%
Totals Coverage Status
Change from base Build 7208654199: 0.3%
Covered Lines: 7153
Relevant Lines: 9597

💛 - Coveralls

@healthjyk
Copy link
Contributor Author

already test e2e locally, shown as follows:

  1. preview
    image
  2. apply
    image
  3. destroy
    image

@healthjyk healthjyk force-pushed the state-backend-workspace branch 3 times, most recently from a6ec36b to 8cb9d5c Compare December 13, 2023 06:52
Copy link
Member

@SparkYuan SparkYuan left a comment

Choose a reason for hiding this comment

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

lgtm

@SparkYuan SparkYuan merged commit 1dd8aa2 into KusionStack:main Dec 14, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
@healthjyk healthjyk deleted the state-backend-workspace branch December 27, 2023 03:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Update workspace backend config and use the workspace backend config for state
3 participants