Add flask in Python workers documentation - #33074
Merged
Merged
Conversation
hoodmane
requested review from
a team,
GregBrimble,
MattieTK,
WalshyDev,
irvinebroque,
korinne and
vy-ton
as code owners
August 27, 2026 23:55
Contributor
Review
👉 Fix in your agent 👈Fix the following review findings in PR #33074 (https://github.com/cloudflare/cloudflare-docs/pull/33074).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.
---
## Code Review
### Warnings (3)
#### CR-4a1d346ca57e · Incorrect framework reference in prose
- **File:** `src/content/docs/workers/languages/python/packages/flask.mdx` line 105
- **Issue:** The sentence reads 'This ensures every request reaches your FastAPI Worker first' in a page documenting Flask. This appears to be a copy-paste error from the FastAPI docs.
- **Fix:** Change 'FastAPI Worker' to 'Flask Worker'.
#### CR-430c4dede8ec · Missing component import
- **File:** `src/content/docs/workers/languages/python/packages/fastapi.mdx` line 28
- **Issue:** The changed line introduces `<Steps>`, but only `Render` and `WranglerConfig` are imported from `~/components` at line 11.
- **Fix:** Add `Steps` to the import statement, e.g. `import { Render, Steps, WranglerConfig } from "~/components";`.
#### CR-886a53abc4f3 · JS Headers object passed as Starlette headers
- **File:** `src/content/docs/workers/languages/python/packages/fastapi.mdx` line 167
- **Issue:** `headers=resp.headers` passes the JavaScript `Headers` object returned by `env.ASSETS.fetch()` directly to FastAPI/Starlette's `Response`. Starlette expects a Python mapping with `.items()`, which a JS `Headers` proxy may not provide.
- **Fix:** Convert the headers to a Python dict first: `headers = dict(resp.headers); return Response(content=body, status_code=resp.status, headers=headers)`.
---
## Conventions
### Warnings (1)
#### CV-991536dee0f0 · Scope accuracy
- **File:** PR-level finding
- **Issue:** The PR adds two new pages (src/content/docs/workers/framework-guides/apis/flask.mdx, src/content/docs/workers/languages/python/packages/flask.mdx) and substantially modifies the FastAPI page (+30/-10), but the description only lists dependent workers-py PRs to merge and never mentions the new Flask pages or the FastAPI changes.
- **Fix:** Describe the actual documentation changes, e.g. that new Flask framework and package guides are added and the FastAPI page is updated to link to them.
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (3)
ConventionsWarnings (1)
Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
hoodmane
commented
Aug 27, 2026
hoodmane
force-pushed
the
hoodmane/flask-docs
branch
from
August 27, 2026 23:56
287574f to
aad1ee9
Compare
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://hoodmane-flask-docs.previews.developers.cloudflare.com (commit 8c13e3d)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
hoodmane
commented
Aug 27, 2026
Contributor
ryanking13
approved these changes
Aug 28, 2026
Comment on lines
+163
to
+165
| `run_sync` bridges both asynchronous asset operations into Flask's synchronous | ||
| handler. API routes take priority, and unmatched paths are served from | ||
| `./public/`. |
Contributor
There was a problem hiding this comment.
I prefer not to expose pyodide FFIs in cloudflare docs if possible, maybe let's replace it with asyncio.run or asyncio.run_until_complete.
Contributor
Author
There was a problem hiding this comment.
I still think those are confusing because they are not normally reentrant.
dom96
approved these changes
Aug 28, 2026
hoodmane
force-pushed
the
hoodmane/flask-docs
branch
from
August 28, 2026 18:54
aad1ee9 to
8c13e3d
Compare
hoodmane
force-pushed
the
hoodmane/flask-docs
branch
from
August 28, 2026 18:54
aad1ee9 to
8c13e3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First we should merge the following workers-py PRs to make this correct: