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: add v1 version lifecycle CRDs #8119

Merged
merged 25 commits into from
Sep 13, 2024
Merged

Conversation

leon-inf
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the size/XXL Denotes a PR that changes 1000+ lines. label Sep 10, 2024
@leon-inf leon-inf closed this Sep 11, 2024
@github-actions github-actions bot added this to the Release 0.9.2 milestone Sep 11, 2024
@leon-inf leon-inf reopened this Sep 11, 2024
@leon-inf leon-inf modified the milestones: Release 0.9.2, Release 1.0.0 Sep 11, 2024
@leon-inf leon-inf force-pushed the support/lifecycle-crds-version-v1 branch 4 times, most recently from 387ddcb to 3a36b9f Compare September 11, 2024 04:55
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 16.61570% with 818 lines in your changes missing coverage. Please review.

Project coverage is 61.29%. Comparing base (9b8eef3) to head (2b739a5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...is/apps/v1alpha1/componentdefinition_conversion.go 0.00% 252 Missing ⚠️
apis/apps/v1alpha1/cluster_conversion.go 0.00% 152 Missing ⚠️
apis/apps/v1/deprecated.go 0.00% 145 Missing ⚠️
apis/apps/v1alpha1/component_conversion.go 0.00% 57 Missing ⚠️
apis/apps/v1alpha1/clusterdefinition_conversion.go 0.00% 52 Missing ⚠️
apis/apps/v1alpha1/conversion.go 0.00% 37 Missing ⚠️
apis/apps/v1alpha1/componentversion_conversion.go 0.00% 28 Missing ⚠️
apis/apps/v1alpha1/servicedescriptor_conversion.go 0.00% 28 Missing ⚠️
apis/apps/v1alpha1/opsrequest_validation.go 0.00% 20 Missing ⚠️
controllers/apps/configuration/config_util.go 64.70% 4 Missing and 2 partials ⚠️
... and 19 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8119      +/-   ##
==========================================
- Coverage   62.47%   61.29%   -1.18%     
==========================================
  Files         333      359      +26     
  Lines       40681    41291     +610     
==========================================
- Hits        25417    25311     -106     
- Misses      12986    13740     +754     
+ Partials     2278     2240      -38     
Flag Coverage Δ
unittests 61.29% <16.61%> (-1.18%) ⬇️

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 force-pushed the support/lifecycle-crds-version-v1 branch from 3a36b9f to 31075f0 Compare September 11, 2024 05:43
@leon-inf leon-inf marked this pull request as ready for review September 11, 2024 05:44
controllers/apps/operations/volume_expansion.go Outdated Show resolved Hide resolved
hack/client-sdk-gen.sh Outdated Show resolved Hide resolved
apis/apps/v1alpha1/conversion.go Outdated Show resolved Hide resolved
Keys: spec.Keys,
ConfigConstraintRef: spec.ConfigConstraintRef,
AsEnvFrom: spec.AsEnvFrom,
InjectEnvTo: spec.InjectEnvTo,
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: #8115 conflicts with this function (and the following function).

Copy link
Contributor

Choose a reason for hiding this comment

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

can the copier package help?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have a try to it, the error handling introduced by copier is too cumbersome.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could implement our owned object conversion utility by using json encoding and decoding, to replace the usage of the copier package (including usages for the API conversion). The copier package feels like a complicated black box and it's hard to figure out how it actually behaves.

Copy link
Contributor

Choose a reason for hiding this comment

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

#8115 has been merged into main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged

Copy link
Contributor

Choose a reason for hiding this comment

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

Merged

That PR introduced a new field ComponentConfigSpec.AsSecret, which should be copied here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

apis/apps/v1alpha1/componentdefinition_conversion.go Outdated Show resolved Hide resolved
}
}

func (r *ComponentDefinition) toV1LifecycleAction(action *Action) *appsv1.Action {
Copy link
Contributor

Choose a reason for hiding this comment

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

this method can be defined as a free function (without the receiver r).
but it's not a big deal anyway.

apis/apps/v1alpha1/cluster_conversion.go Show resolved Hide resolved
apis/apps/v1alpha1/cluster_conversion.go Outdated Show resolved Hide resolved
@leon-inf leon-inf force-pushed the support/lifecycle-crds-version-v1 branch from 31075f0 to 6fae3db Compare September 13, 2024 01:53
@apecloud-bot apecloud-bot added the approved PR Approved Test label Sep 13, 2024
@leon-inf
Copy link
Contributor Author

/approve

@leon-inf leon-inf merged commit b6416ec into main Sep 13, 2024
37 checks passed
@leon-inf leon-inf deleted the support/lifecycle-crds-version-v1 branch September 13, 2024 10:32
wangyelei pushed a commit that referenced this pull request Sep 19, 2024
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.

3 participants