Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Use kctrl command tree by default in package plugin #3207

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Use kctrl command tree by default in package plugin #3207

merged 1 commit into from
Nov 1, 2022

Conversation

praveenrewar
Copy link
Contributor

@praveenrewar praveenrewar commented Aug 29, 2022

What this PR does / why we need it

Use kctrl command tree by default in package plugin.

Which issue(s) this PR fixes

Fixes #3761

Describe testing done for PR

Release note

Default value of `features.package.kctrl-package-command-tree` is now set to true. To use old package plugin, use `tanzu config set features.package.kctrl-package-command-tree false`

@praveenrewar praveenrewar requested a review from a team as a code owner August 29, 2022 03:41
@praveenrewar praveenrewar marked this pull request as draft August 29, 2022 03:42
@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #3207 (998765e) into main (485f0ce) will decrease coverage by 0.82%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3207      +/-   ##
==========================================
- Coverage   46.58%   45.75%   -0.83%     
==========================================
  Files         400      425      +25     
  Lines       39722    41278    +1556     
==========================================
+ Hits        18504    18888     +384     
- Misses      19519    20681    +1162     
- Partials     1699     1709      +10     
Impacted Files Coverage Δ
cli/runtime/config/featureflags.go 100.00% <ø> (ø)
addons/controllers/machine_controller.go 65.65% <0.00%> (-3.04%) ⬇️
...in/cluster/set_machinehealthcheck_control_plane.go 21.21% <0.00%> (ø)
cmd/cli/plugin/cluster/get_node_pools.go 10.52% <0.00%> (ø)
.../cli/plugin/cluster/set_machinehealthcheck_node.go 23.33% <0.00%> (ø)
cmd/cli/plugin/cluster/set_node_pool.go 14.63% <0.00%> (ø)
cmd/cli/plugin/cluster/osimage.go 100.00% <0.00%> (ø)
...i/plugin/cluster/delete_machinehealthcheck_node.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/delete.go 12.50% <0.00%> (ø)
cmd/cli/plugin/cluster/get_machinehealthcheck.go 11.42% <0.00%> (ø)
... and 21 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@praveenrewar praveenrewar marked this pull request as ready for review September 4, 2022 21:12
@praveenrewar praveenrewar marked this pull request as draft September 4, 2022 21:12
@praveenrewar praveenrewar marked this pull request as ready for review September 11, 2022 16:34
@praveenrewar praveenrewar requested a review from a team as a code owner September 11, 2022 16:34
By("disable kctrl command tree")
command := exec.NewCommand(
exec.WithCommand("tanzu"),
exec.WithArgs("config", "set", "features.package.kctrl-package-command-tree", "false"),
Copy link
Contributor

@maralavi maralavi Sep 26, 2022

Choose a reason for hiding this comment

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

Until when this flag going to stay false on test? (Is it part of the plan to make downstream integration tests eventually pass with kctrl feature enabled as well or if there is another way to for e2e testing kctrl-enabled package/secret plugin functionality?)

Copy link
Contributor

@maralavi maralavi Sep 26, 2022

Choose a reason for hiding this comment

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

I think modifying existing test libs which package_plugin_integration_test uses would not work, as will break earlier versions tests.

You might want to add your own set of test libs for kctrl feature being enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Until when this flag going to stay false on test?

I am guessing until the old behaviour is deprecated/removed and we no longer need these tests.

Is it part of the plan to make downstream integration tests eventually pass with kctrl feature enabled as well or if there is another way to for e2e testing kctrl-enabled package

kctrl has it's own set of e2e tests upstream and there are some tests that make sure that the differences in ux are taken care of. I felt that we would just be duplicating those upstream tests here and hence didn't add any new tests, but please let me know what y'all think.

Copy link
Contributor

@maralavi maralavi Sep 27, 2022

Choose a reason for hiding this comment

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

Thanks for the clarification @praveenrewar. As far as I know, TF tests would be needed to get a feature enabled & merged in Tanzu Framework. Also test-infra e2e tests need to get modified to point to the e2e tests corresponding to kctrl feature after 1.7 release. I let @vijaykatam and @shyaamsn decide on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@praveenrewar As @maralavi mentioned we cant enable kctrl in tanzu package plugin without tests even though they are tested upstream. We need to test tanzu package plugin in tanzu-framework and downstream.

There are two options:

  1. Fix these tests in tanzu-framework so that they can run.
  2. Make kctrl tests work in tanzu-framework and downstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @maralavi and @shyaamsn for sharing your thoughts.

Fix these tests in tanzu-framework so that they can run.

Sure, I think I can add more tests over here which will work cover the kctrl command tree enabled scenario (the only concern is that I have already mentioned, but I don't mind it)

Also test-infra e2e tests need to get modified to point to the e2e tests corresponding to kctrl feature after 1.7 release

Which tests are we talking about here, and do we need to make this change as part of the same PR? (Still trying to make my way through the codebase 😅 )

Make kctrl tests work in tanzu-framework and downstream

Are you referring to the upstream kctrl tests?

Copy link
Contributor

@maralavi maralavi Sep 29, 2022

Choose a reason for hiding this comment

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

Which tests are we talking about here

Hi @praveenrewar , the tests are those in this file which tests all commands end to end, that you are just disabling with your PR.

do we need to make this change as part of the same PR? (Still trying to make my way through the codebase 😅 )

Yes unfortunately Tanzu Framework code base policy is that everything should be tested properly as part of the same PR:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, okay. That makes sense.

@shyaamsn
Copy link
Contributor

@praveenrewar Could you please take a look at the failing tests ? Also please resolve the conflicts.

Another question on tests: So in package plugin tests now we test both kctrl enabled and disabled is it ?

@praveenrewar praveenrewar marked this pull request as draft October 11, 2022 10:13
@praveenrewar
Copy link
Contributor Author

Could you please take a look at the failing tests ? Also please resolve the conflicts.

@shyaamsn I found an issue in kctrl upstream and was working on resolving that. I will create a separate PR to bump kctrl version. Meanwhile I have marked it as a draft PR.

So in package plugin tests now we test both kctrl enabled and disabled is it ?

Yeah, I thought it would be good to have tests for both. But do let me know if it's an overkill (because we are no longer making any changes to the legacy code for package plugin).

@shyaamsn
Copy link
Contributor

Could you please take a look at the failing tests ? Also please resolve the conflicts.

@shyaamsn I found an issue in kctrl upstream and was working on resolving that. I will create a separate PR to bump kctrl version. Meanwhile I have marked it as a draft PR.

So in package plugin tests now we test both kctrl enabled and disabled is it ?

Yeah, I thought it would be good to have tests for both. But do let me know if it's an overkill (because we are no longer making any changes to the legacy code for package plugin).

No having both tests is great. Do we have to enable something to make both the tests run or by default both the tests run ? By default having both tests run is wonderful.

@praveenrewar
Copy link
Contributor Author

Do we have to enable something to make both the tests run or by default both the tests run ?

By default both the tests run :)

@praveenrewar
Copy link
Contributor Author

@shyaamsn @maralavi It seems that bumping kctrl (which results in bumping a bunch of other dependencies) results in this error. I think it's probably due to a method being updated in the newer versions. I will take a good look at it tomorrow but if y'all have any idea about how to fix this then please let me know :)

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3207/20221021171641/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@praveenrewar praveenrewar marked this pull request as ready for review October 26, 2022 21:43
@praveenrewar praveenrewar requested a review from maralavi October 31, 2022 04:32
@maralavi
Copy link
Contributor

Thanks for the changes @praveenrewar

@maralavi maralavi added the ok-to-merge PRs should be labelled with this before merging label Oct 31, 2022
@praveenrewar praveenrewar merged commit 78818e2 into vmware-tanzu:main Nov 1, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable kctrl command tree in package plugin by default
4 participants