KiritoXDone opened a new pull request, #990:
URL: https://github.com/apache/burr/pull/990
Add a Cloudflare Python Workers deployment guide using the counter
application from the merged Vercel example (#605).
Closes #989. Related to #390.
## Changes
- Add `examples/deployment/cloudflare/` with the Python Workers entrypoint,
dependencies, configuration, and local/cloud deployment instructions.
- Expose `POST /api/counter`, accepting `{"number": 5}` and returning the
serialized Burr State.
- Reuse the Vercel counter graph, omitting its artificial sleep for the
Workers runtime. Each request starts a new counter.
## How I tested this
Installed from a clean directory with no existing dependencies or lock
files. Ran the same 15 HTTP smoke checks locally and on Cloudflare, covering
successful counts, invalid input, unsupported methods, and unknown routes. No
automated test files are added in this PR.
Hosted example:
```bash
curl -X POST
https://burr-counter-test-20261020.kiritoxd.workers.dev/api/counter \
-H "Content-Type: application/json" \
-d '{"number": 5}'
```
Response:
```json
{"counter": 5, "counter_limit": 5, "__SEQUENCE_ID": 5, "__PRIOR_STEP":
"result"}
```
Existing checks run locally:
- Python tests on Python 3.12: 704 passed, 2 skipped, using the main CI
job's selection (excluding `tests/integrations/persisters` and
`tests/integrations/test_bip0042_bedrock.py`).
- Example validation: 46 passed.
- Pre-commit: all changed files passed.
## Notes
- Burr core is unchanged.
- The full-repository Black check has two pre-existing failures in the
image-telephone examples; see the [base commit's
job](https://github.com/apache/burr/actions/runs/39230340090/job/117986499793).
- Tooling disclosure: this contribution and submission text were prepared
with OpenAI Codex assistance.
@andreahlert, could you review this deployment example?
## Checklist
- [x] PR has an informative and human-readable title (this will be pulled
into the release notes)
- [x] Changes are limited to a single goal (no scope creep)
- [x] Code passed the pre-commit check & code is left cleaner/nicer than
when first encountered. (Changed files pass; repository-wide failures are noted
above.)
- [x] Any _change_ in functionality is tested. (Local and hosted HTTP smoke
checks, as described above.)
- [ ] New functions are documented (with a description, list of inputs, and
expected output). (The Worker handler and response helper have docstrings; the
reused Vercel `counter` action has no docstring.)
- [ ] Placeholder code is flagged / future TODOs are captured in comments.
(N/A: no placeholder code or TODOs were added.)
- [x] Project documentation has been updated if adding/changing
functionality.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]