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(cmd/trait): refactor cmd & trait packages #3279

Merged
merged 1 commit into from
May 18, 2022

Conversation

tadayosi
Copy link
Member

Moved test and helper functions to where they should be.

Release Note

NONE

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

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

We can use this opportunity to refactor the depracated and soon-to-become-deprecated fields.

Status: v1.IntegrationStatus{
Phase: v1.IntegrationPhaseDeploying,
Spec: v1.IntegrationSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

This is deprecated. We should use related traits instead.

Name: "integration-name",
IntegrationKit: &v1.IntegrationKit{
Spec: v1.IntegrationKitSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet deprecated, but it will be soon. Let's try to use traits instead.

},
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet deprecated, but it will be soon. Let's try to use traits instead.

Status: v1.IntegrationStatus{
Phase: v1.IntegrationPhaseDeploying,
Spec: v1.IntegrationSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

Name: "integration-name",
IntegrationKit: &v1.IntegrationKit{
Spec: v1.IntegrationKitSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

},
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Configuration: []v1.ConfigurationSpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@tadayosi
Copy link
Member Author

tadayosi commented May 18, 2022

@squakez Actually the tests in trait_types_test.go are for testing the methods e.collectConfigurationValues() and e.collectConfigurationPairs(), which operate on the deprecated Configuration fields. So I don't think there is any point in having those tests if we rewrite them to use the corresponding traits.

I think the best timing to remove those tests is when we finally remove the deprecated fields and related code.

@tadayosi tadayosi merged commit d9f10e9 into apache:main May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants