- Notifications
You must be signed in to change notification settings - Fork927
chore: switch to generated types#1394
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
That way the renderer only takes `string` for example when rendering thename field instead of `string | number` when the interface has somefields that are strings and some fields are numbers.This will be necessary when switching to generated types since some ofthe fields are numbers (like the owner count on a template).
fbf0d4c
tob98aeb6
CompareIn some places the organization ID is part of the URL but not part ofthe request so I separated out the ID into a separate argument in therelevant API functions.Otherwise this was a straightforward replacement where I mostly onlyneeded to change some of the interface names (User instead ofUserResponse for example) and add a few missing but required properties.Arguably `parameter_values` could be made optional but I am just passingin an empty array for now mostly just to make it obvious that we couldpass stuff there if we need to.I kind of winged the template form; I am not sure what the differencebetween a template and template version is or why the latter comesbefore the former so the form just returns all the data required tocreate both.
codecovbot commentedMay 11, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## main #1394 +/- ##==========================================+ Coverage 67.01% 67.03% +0.01%========================================== Files 287 288 +1 Lines 18850 19083 +233 Branches 241 241 ==========================================+ Hits 12633 12792 +159- Misses 4931 4985 +54- Partials 1286 1306 +20
Continue to review full report at Codecov.
|
Except for UserAgent which seems to be purely frontend andReconnectingPTYRequest which is not in codersdk so I am just leaving itfor now.
This was implemented in2d3dc43.
Uh oh!
There was an error while loading.Please reload this page.
b98aeb6
to1de1986
CompareThis reverts commitf5d1b62.This will be added in a separate PR.
I don't have time to properly review right now but I wanted to mention that I think more fields on |
code-asher commentedMay 11, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Looks like you are right. Fortunately it is pretty easy, we just need to add I am not sure what the best way to tackle this is (not sure if I have to read the code to find what is optional or if everything without a |
nice! seems like |
code-asher commentedMay 11, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
All right the request interfaces are looking good. @Kira-Pilot I see |
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.
I'm still learning but this looks good to me!
@code-asher yay thanks! The empty string for schedule makes sense to me. |
@Kira-Pilot we run it manually. On save is a bit excessive since it does takesome time. But CI will have a failing step if you changed something and |
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.
Super appreciate this!
* Make column renderer use the same type as its keyThat way the renderer only takes `string` for example when rendering thename field instead of `string | number` when the interface has somefields that are strings and some fields are numbers.This will be necessary when switching to generated types since some ofthe fields are numbers (like the owner count on a template).* Switch fully to generated typesIn some places the organization ID is part of the URL but not part ofthe request so I separated out the ID into a separate argument in therelevant API functions.Otherwise this was a straightforward replacement where I mostly onlyneeded to change some of the interface names (User instead ofUserResponse for example) and add a few missing but required properties.I kind of winged the template form; I am not sure what the differencebetween a template and template version is or why the latter comesbefore the former so the form just returns all the data required tocreate both.* Delete handwritten typesExcept for UserAgent which seems to be purely frontend andReconnectingPTYRequest which is not in codersdk so I am just leaving itfor now.* Remove implemented omitempty as a future ideaThis was implemented in2d3dc43.* Add missing optionalities to generated request interfaces
Uh oh!
There was an error while loading.Please reload this page.
Closes#1210. More information can be found in the commits!