-
Notifications
You must be signed in to change notification settings - Fork 14
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
Decouple the Target association with the Context object by introducing ContextType #112
Conversation
a1735dc
to
204945b
Compare
204945b
to
7fb7ba8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to remove the constants TargetTAE
and targetTAE
since they are not in any official release? Looking at the code, I realize this will complicate things. However, I think it is important so that we make sure we adapt the code to handle having different contextTypes than Targets; that way, if we need to add another new contextType, we will be ready and not need to also add it as a new target. But this implies completely removing the use of context.Target
in the code.
The above will probably complicate this PR a lot. Given the time frame, we should discuss doing it in two phases:
- continue as you did by introducing contextType but continuing to use Target by making sure the two are in sync
- and after, remove all uses of context.Target.
Nit: perhaps for consistency, in test cases (e.g. clientconfig_test/context_additionalmetadata_test/context_test) where the use of the Target: field is not consequential, we should be consistent and update them to specify the equivalent ContextType instead. |
887b0c5
to
4fc0de8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of nits on the latest version
1f89b66
to
4159f36
Compare
* Add ContextType to the Context object * Deprecate existing APIs using Target and implement alternative functions * Add/Update Unit tests and Compatibility tests
4159f36
to
cb6d0aa
Compare
Rebased the PR on top of 6cabd02 commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the changes and revisions as well.
We can probably use a little more documentation (here or in TZC) to clarify the Context Type introduction. |
Yes agreed. I will be adding more documentation around the Context Type as part of the follow-up PR. |
What this PR does / why we need it
Background:
global
which does not make sense as a Context-Type value and the code assumes that value cannot be a value of a Context-Type.Change:
ContextType
within theContext
object and Deprecating the existingTarget
field.Target
field will be kept and set correctly to support CLI and plugins using the previous version of Tanzu Plugin Runtime.Which issue(s) this PR fixes
Fixes #116
Describe testing done for PR
Test Cases that I am trying to cover:
Unit Test Cases:
Compatibility Test Cases:
Release note
Additional information
Special notes for your reviewer