-
Notifications
You must be signed in to change notification settings - Fork 18
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
[Merged by Bors] - fix: update voiceflow dtos (PL-844) #743
Conversation
lib/controllers/test/interface.ts
Outdated
@@ -12,14 +13,14 @@ export const TestFunctionRequestBodyDTO = z | |||
inputVars: z.record( | |||
z | |||
.object({ | |||
type: z.literal(FunctionVariableType.STRING), | |||
type: z.literal(VariableDatatype.TEXT), |
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.
so the actual raw values here are different, "string"
would break if we are matching against "text"
.
To my knowledge, the FE still sends "string"
We need to allow both otherwise the function testing would break:
creator-app request code
general-runtime/lib/controllers/test/index.ts
Lines 135 to 141 in bf2877c
try { | |
await TestFunctionRequestBodyDTO.parseAsync(req.body); | |
} catch (err) { | |
throw new BadRequestException({ | |
message: err instanceof z.ZodError ? formatZodError(err) : err.message, | |
}); | |
} |
d67e7b6
to
4d527f7
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @DecathectZero and the rest of your teammates on Graphite |
3e2c0ea
to
5c90141
Compare
Quality Gate passedIssues Measures |
bors r+ |
This PR is blocked by: voiceflow/creator-app#7928 Is this a pure PR? Nah, I cheated a bit and tossed in classification DTOs here: https://github.com/voiceflow/general-runtime/blob/2208a027011298632bc1eaa360da115c124f73a0/lib/controllers/test/interface.ts#L47-L79 If I wanted to abide by even better prinicples, ^ that should be a separate PR. derived verbatim from https://github.com/voiceflow/general-runtime/pull/736/files But I made a critical bug fix that would've broken our functions testing: <img width="1695" alt="Screenshot 2024-04-02 at 10 45 39 PM" src="https://github.com/voiceflow/general-runtime/assets/5643574/7b4d0539-4db5-4659-94bd-e473d8f78013"> This code is approved and validated from my end. Co-authored-by: Tyler Han <tylerhan97@gmail.com>
Pull request successfully merged into master. Build succeeded: |
We don't actually use `FunctionCompiledVariableDeclarationDTO` or any of it's downstream stuff anywhere in creator-app I believe. We use it purely for types. We should be careful when modifying DTOs But we should patch this because the moment someone uses it all functions will break unless we run a migration. All functions today still use `type: "string"` Related PR: voiceflow/general-runtime#743 Co-authored-by: Tyler Han <tylerhan97@gmail.com>
This PR is blocked by:
https://github.com/voiceflow/creator-app/pull/7928
Is this a pure PR? Nah, I cheated a bit and tossed in classification DTOs here:
general-runtime/lib/controllers/test/interface.ts
Lines 47 to 79 in 2208a02
If I wanted to abide by even better prinicples, ^ that should be a separate PR.
derived verbatim from https://github.com/voiceflow/general-runtime/pull/736/files
But I made a critical bug fix that would've broken our functions testing:
This code is approved and validated from my end.