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

chore: refactor the dependencies between the cluster, component, and its objects #8809

Merged
merged 13 commits into from
Jan 21, 2025

Conversation

leon-inf
Copy link
Contributor

@leon-inf leon-inf commented Jan 15, 2025

  1. Remove the dependency of the cluster on the its object
  2. Remove the dependency of the component on the cluster object

@github-actions github-actions bot added the size/XXL Denotes a PR that changes 1000+ lines. label Jan 15, 2025
@leon-inf leon-inf force-pushed the support/refine-cluster-and-component-tests branch from 18160a6 to f44e709 Compare January 15, 2025 07:41
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 49.54955% with 168 lines in your changes missing coverage. Please review.

Project coverage is 60.23%. Comparing base (1f8a679) to head (48ab945).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
controllers/apps/util/utils.go 8.69% 63 Missing ⚠️
controllers/apps/util/multicluster.go 0.00% 23 Missing ⚠️
...rs/apps/component/transformer_component_restore.go 0.00% 12 Missing ⚠️
pkg/controller/component/synthesize_component.go 73.52% 5 Missing and 4 partials ⚠️
.../apps/cluster/transformer_cluster_backup_policy.go 42.85% 8 Missing ⚠️
...s/apps/component/transformer_component_deletion.go 58.82% 4 Missing and 3 partials ⚠️
controllers/apps/util/mock_reader.go 0.00% 7 Missing ⚠️
...s/apps/component/transformer_component_workload.go 80.00% 3 Missing and 3 partials ⚠️
...s/component/transformer_component_configuration.go 66.66% 5 Missing ⚠️
...ers/apps/component/transformer_component_status.go 0.00% 5 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8809      +/-   ##
==========================================
- Coverage   60.33%   60.23%   -0.10%     
==========================================
  Files         382      382              
  Lines       46348    46123     -225     
==========================================
- Hits        27964    27783     -181     
+ Misses      15708    15674      -34     
+ Partials     2676     2666      -10     
Flag Coverage Δ
unittests 60.23% <49.54%> (-0.10%) ⬇️

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.

@leon-inf leon-inf marked this pull request as ready for review January 15, 2025 08:09
@leon-inf leon-inf requested review from sophon-zt, a team and Y-Rookie as code owners January 15, 2025 08:09
@leon-inf leon-inf force-pushed the support/refine-cluster-and-component-tests branch 2 times, most recently from fcf533c to 075402c Compare January 21, 2025 03:15
@leon-inf leon-inf force-pushed the support/refine-cluster-and-component-tests branch from 075402c to 0282966 Compare January 21, 2025 03:39
Copy link
Contributor

@zjx20 zjx20 left a comment

Choose a reason for hiding this comment

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

Most changes are code refactoring, but I noticed that some Events originally sent to the Cluster CR are now being sent to the Component CR. This could introduce breaking changes or make it difficult to observe or debug the cluster's status. Alternatively, we could introduce an event aggregator to aggregate Component events into Cluster events.

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jan 21, 2025
@@ -89,9 +89,9 @@ func (t *componentDeletionTransformer) handleCompDeleteWhenScaleIn(transCtx *com

// handleCompDeleteWhenClusterDelete handles the component deletion when the cluster is being deleted, the sub-resources owned by the component depends on the cluster's TerminationPolicy.
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove or update the comment "depends on the cluster's TerminationPolicy"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@leon-inf
Copy link
Contributor Author

/approve

@apecloud-bot apecloud-bot removed the approved PR Approved Test label Jan 21, 2025
@apecloud-bot apecloud-bot added the approved PR Approved Test label Jan 21, 2025
@leon-inf leon-inf merged commit fbd2ea0 into main Jan 21, 2025
36 checks passed
@leon-inf leon-inf deleted the support/refine-cluster-and-component-tests branch January 21, 2025 08:57
@leon-inf
Copy link
Contributor Author

/cherry-pick release-1.0-beta

@github-actions github-actions bot added this to the Release 0.9.3 milestone Jan 21, 2025
@apecloud-bot
Copy link
Collaborator

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/apecloud/kubeblocks/actions/runs/12883386201

apecloud-bot pushed a commit that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR Approved Test size/XXL Denotes a PR that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants