Skip to content

Add flask in Python workers documentation - #33074

Merged
hoodmane merged 1 commit into
productionfrom
hoodmane/flask-docs
Aug 28, 2026
Merged

Add flask in Python workers documentation#33074
hoodmane merged 1 commit into
productionfrom
hoodmane/flask-docs

Conversation

@hoodmane

@hoodmane hoodmane commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

First we should merge the following workers-py PRs to make this correct:

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 4 warnings found in commit 8c13e3d.

👉 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 Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (3)
File Issue
workers/languages/python/packages/flask.mdx line 105 Incorrect framework reference in prose — 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'.
workers/languages/python/packages/fastapi.mdx line 28 Missing component import — 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";.
workers/languages/python/packages/fastapi.mdx line 167 JS Headers object passed as Starlette headersheaders=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)
File Issue
PR Scope accuracy — 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.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@github-actions github-actions Bot added product:workers Related to Workers product size/m labels Aug 27, 2026
Comment thread src/content/docs/workers/languages/python/packages/flask.mdx
@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/product-owners, @cloudflare/wrangler, @MattieTK, @cloudflare/dev-plat-leads, @vy-ton, @cloudflare/workers-runtime-1

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://hoodmane-flask-docs.previews.developers.cloudflare.com (commit 8c13e3d)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b6078995.previews.developers.cloudflare.com 8c13e3d 2026-08-28T19:09:23.434Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6e8c1c3a.previews.developers.cloudflare.com aad1ee9 2026-08-28T00:04:43.913Z Visit the dashboard ↗

Comment thread src/content/docs/workers/languages/python/packages/flask.mdx
Comment thread src/content/docs/workers/languages/python/packages/fastapi.mdx Outdated
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/`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think those are confusing because they are not normally reentrant.

Comment thread src/content/docs/workers/languages/python/packages/flask.mdx Outdated
Comment thread src/content/docs/workers/languages/python/packages/fastapi.mdx
Comment thread src/content/docs/workers/languages/python/packages/flask.mdx Outdated
Comment thread src/content/docs/workers/framework-guides/apis/flask.mdx
@hoodmane
hoodmane force-pushed the hoodmane/flask-docs branch from aad1ee9 to 8c13e3d Compare August 28, 2026 18:54
@hoodmane
hoodmane force-pushed the hoodmane/flask-docs branch from aad1ee9 to 8c13e3d Compare August 28, 2026 18:54
@hoodmane
hoodmane merged commit ad2c5e1 into production Aug 28, 2026
15 of 21 checks passed
@hoodmane
hoodmane deleted the hoodmane/flask-docs branch August 28, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants