-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add a new struct to replace ArrayOrString struct #4858
Comments
@ywluogg I think, in the end, it's all an implementation detail. What we can do, if we want to "take" our time and split the work into multiple PRs, is to create the new struct as we see it fit, write tests for it. And then switch ArrayOrString with it, and finally remove ArrayOrString. This would be the best of both world, creating the new struct but with the intent and plan of replacing |
We can have a list of PRs. Here is what I am thinking:
|
I had a conversation with @vinamra28 about this plan. It looks great except the last PR - removing legacy |
Thanks @pritidesai for bringing up this. We should definitely take the dependent projects into consideration. So to help the dependent projects to transition away from this legacy struct, a new struct will be needed while the legacy one is maintained. Is that right? |
@chuangw6 yes the legacy one needs to be maintained for some time along with the new one. Also dependent projects(atleast CLI) can start their migration once this is out as CLI project vendors the pipelines project. |
Thanks @vinamra28! If a new struct is created that embeds the legacy Changing these two types means many places that use |
Chiming here a tad: if the shape of the api doesn't change aka:
It's similar to "duck typing", if it quacks it's a duck. The go struct and internal representation of our type can change without breaking the api, and thus without breaking older clients. My assumption is that we would have that new struct be compatible with Note: the cli could be defining it's own set of struct representing the API (it would be even more true if the cli was written in another language). From |
Combining all are considered above, let's have a more defined new struct here to make sure we understand the compatibility of the old struct in the same way.
|
/reopen accidentally closed the issue... |
Update on this issue: synced offline with @pritidesai @vdemeester that we agree that the changes wouldn't break any of the existing APIs but will introduce breakages in library. We will go with renaming the old struct, as we already added objectType in ArrayOrString@ |
/assign chuangw6 |
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue tektoncd#4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
This commit fixes issue #4858. With the implementation of Tep75, ArrayOrString contains object type and it would be confusing if still use the same name. This commit renames it to ParamValues and type alias ResultValues to ParamValues. Also use type alias to make sure dependant libraries can still use ArrayOrString and NewArrayOrString.
Closed by #5304 |
With implementation of TEP 075 and 076 going on, especially introducing json objects into params and results, it worths discussion about whether we want a new struct to replace ArrayOrString, as the implementation of json objects will happen in ArrayOrString, but the name doesn't really reflect what it actually represents. With this discussion, we are exploring two options here to reduce library breakages, and have a better structure.
@vdemeester @pritidesai I'm trying follow up on the discussion we have about this topic in WG. I think based on the above pros and cons comparisons, I'm still leaning toward changing the name of the struct, rather than introducing a new struct.
Pinging @chuangw6 @Yongxuanzhang as well.
The text was updated successfully, but these errors were encountered: