fix(orchestrator): makes the bodyParser limit configurable.#2802
fix(orchestrator): makes the bodyParser limit configurable.#2802lholmquist wants to merge 6 commits intoredhat-developer:mainfrom
Conversation
Code Review by Qodo
1.
|
Changed Packages
|
Review Summary by QodoMake bodyParser content length limit configurable
WalkthroughsDescription• Makes bodyParser content length limit configurable via config • Allows workflows to exceed default 100kb limit • Applies limit to both JSON and text request parsers • Includes configuration example with 10mb default suggestion Diagramflowchart LR
config["Config: orchestrator.contentLengthLimit"]
jsonParser["express.json with limit"]
textParser["express.text with limit"]
config -- "applies to" --> jsonParser
config -- "applies to" --> textParser
File Changes1. workspaces/orchestrator/plugins/orchestrator-backend/src/service/router.ts
|
PatAKnight
left a comment
There was a problem hiding this comment.
I would add some docs to this as well. I don't know where the current product docs live for the orchestrator plugin but having a small blurb here can give us something to point to for the docs team to ingest.
| const contentLengthLimit = config.getOptionalString( | ||
| 'orchestrator.contentLengthLimit', | ||
| ); | ||
| router.use(express.json({ limit: contentLengthLimit })); |
There was a problem hiding this comment.
| router.use(express.json({ limit: contentLengthLimit })); | |
| router.use(express.json()); |
It looks like the QODO review is complaining about having the limit added globally as well as the /workflows endpoint. I agree with the suggestion to drop the limit globally and just have the one on the endpoints that best need the larger limits.
There was a problem hiding this comment.
So i decided to ask cursor about that /workflows endpoint and it doesn't look like it is actually being used. In fact, if you try to go to it, it will return a 404. The endpoint to actually interact with workflows is /v2/workflows/.... i should probably remove the limit config from that /workflows endpoint and it should be kept on the global one
A customer was having an issue where the workflows content length was over the 100kb limit. This adds a configurable value to make the content lenght larger fixes: https://redhat.atlassian.net/browse/RHDHSUPP-351
29258ad to
ab88f22
Compare
|
|
@PatAKnight I added a comment on the router, which i think we can point the docs to at, https://github.com/redhat-developer/rhdh-plugins/pull/2802/changes#diff-b34e43c026bf84e8d06cc07eceed2806b08b96206b3c033d493ec8a7b1ce3ceeR208-R215 Also see my comment about the |



Hey, I just made a Pull Request!
A customer was having an issue where the workflows content length was over the 100kb limit. This adds a configurable value to make the content lenght larger
fixes: https://redhat.atlassian.net/browse/RHDHSUPP-351
✔️ Checklist