Skip to content

Add Cloudflare Workers configuration#1

Open
cloudflare-workers-and-pages[bot] wants to merge 1 commit intomainfrom
cloudflare/workers-autoconfig
Open

Add Cloudflare Workers configuration#1
cloudflare-workers-and-pages[bot] wants to merge 1 commit intomainfrom
cloudflare/workers-autoconfig

Conversation

@cloudflare-workers-and-pages
Copy link
Copy Markdown

@cloudflare-workers-and-pages cloudflare-workers-and-pages bot commented Apr 15, 2026

This PR configures your project for Cloudflare Workers deployment using Wrangler autoconfig.

Merging this PR commits the configuration to your repository, enabling faster deployments and version controlled settings.

Detected settings:

  • Framework: static

  • Deploy command: npx wrangler deploy

  • Version (non-production deploy) command: npx wrangler versions upload

Note: For this PR, we used these detected settings to generate a working preview. When merged, we'll override your build and deploy commands if they don't match what's currently configured, ensuring successful deployments for your setup.

Next steps after merging:
Your Worker configuration lives in wrangler.jsonc. You can now:


View build details · Join the discussion for questions or feedback

Summary by Sourcery

Deployment:

  • Добавлен файл конфигурации Wrangler (wrangler.jsonc) для определения настроек деплоймента Cloudflare Workers.
Original summary in English

Summary by Sourcery

Deployment:

  • Add Wrangler configuration file (wrangler.jsonc) to define Cloudflare Workers deployment settings.

@cloudflare-workers-and-pages
Copy link
Copy Markdown
Author

cloudflare-workers-and-pages bot commented Apr 15, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
marksman 2e3e928 Commit Preview URL

Branch Preview URL
Apr 15 2026, 05:41 PM

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 15, 2026

Руководство для ревьюера (сворачивается для небольших PR)

Руководство для ревьюера

Настраивает репозиторий для деплоя Cloudflare Workers с помощью Wrangler, добавляя конфигурационный файл сервиса wrangler.jsonc и обновляя .gitignore для артефактов, связанных с Workers.

Изменения на уровне файлов

Изменение Подробности Файлы
Добавить конфигурацию Cloudflare Workers Wrangler для статического Worker-сайта и команд деплоя.
  • Добавить wrangler.jsonc, определяющий конфигурацию сервиса Worker для статических ресурсов.
  • Настроить команды деплоя и версионирования (непродакшн) на использование npx wrangler deploy и npx wrangler versions upload.
  • Установить базовые метаданные, такие как имя сервиса, совместимость или маршрутизацию, сгенерированные Wrangler autoconfig.
wrangler.jsonc
Скорректировать правила игнорирования git с учётом артефактов инструментов Cloudflare Workers.
  • Игнорировать локальные файлы конфигурации/кэша Wrangler или артефакты сборки, создаваемые при деплое или предпросмотре Workers.
  • Убедиться, что существующие правила игнорирования остаются неизменными, добавив к ним паттерны, специфичные для Workers.
.gitignore

Подсказки и команды

Взаимодействие с Sourcery

  • Запустить новое ревью: Оставьте комментарий @sourcery-ai review в pull request.
  • Продолжить обсуждения: Отвечайте напрямую на комментарии ревью от Sourcery.
  • Создать GitHub-issue из комментария ревью: Попросите Sourcery создать
    issue из комментария ревью, ответив на него. Также вы можете ответить на
    комментарий ревью с @sourcery-ai issue, чтобы создать issue на его основе.
  • Сгенерировать заголовок pull request: Напишите @sourcery-ai в любом месте
    заголовка pull request, чтобы сгенерировать заголовок в любой момент. Также вы можете
    оставить комментарий @sourcery-ai title в pull request, чтобы (пере)сгенерировать заголовок в любой момент.
  • Сгенерировать краткое описание pull request: Напишите @sourcery-ai summary в любом месте
    тела pull request, чтобы сгенерировать описание PR в любой момент ровно там, где вы хотите. Также вы можете
    оставить комментарий @sourcery-ai summary в pull request, чтобы (пере)сгенерировать краткое описание в любой момент.
  • Сгенерировать руководство для ревьюера: Оставьте комментарий @sourcery-ai guide в pull request,
    чтобы (пере)сгенерировать руководство для ревьюера в любой момент.
  • Разрешить все комментарии Sourcery: Оставьте комментарий @sourcery-ai resolve в pull request,
    чтобы отметить все комментарии Sourcery как разрешённые. Полезно, если вы уже
    учли все комментарии и больше не хотите их видеть.
  • Отклонить все ревью Sourcery: Оставьте комментарий @sourcery-ai dismiss в pull request,
    чтобы отклонить все существующие ревью Sourcery. Особенно полезно, если вы
    хотите начать с нуля с новым ревью — не забудьте оставить комментарий
    @sourcery-ai review, чтобы запустить новое ревью!

Настройка под себя

Перейдите в свою панель управления, чтобы:

  • Включать или отключать функции ревью, такие как сгенерированное Sourcery
    краткое описание pull request, руководство для ревьюера и другие.
  • Изменить язык ревью.
  • Добавлять, удалять или редактировать собственные инструкции для ревью.
  • Настроить другие параметры ревью.

Получение помощи

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures the repository for Cloudflare Workers deployment via Wrangler by adding a wrangler.jsonc service configuration file and updating .gitignore for Workers-related artifacts.

File-Level Changes

Change Details Files
Add Cloudflare Workers Wrangler configuration for a static-site Worker and deployment commands.
  • Introduce wrangler.jsonc defining a static asset Worker service configuration.
  • Configure deploy and version (non-production) commands to use npx wrangler deploy and npx wrangler versions upload.
  • Set basic metadata such as service name, compatibility or routing as generated by Wrangler autoconfig.
wrangler.jsonc
Adjust git ignore rules to accommodate Cloudflare Workers tooling artifacts.
  • Ignore Wrangler local configuration/cache files or build artifacts produced during Workers deployment or preview.
  • Ensure existing ignore rules remain intact while appending Workers-specific patterns.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Привет — я посмотрел(а) ваши изменения, и они выглядят отлично!


Sourcery бесплатен для open source-проектов — если вам нравятся наши обзоры, пожалуйста, поделитесь ими ✨
Помогите мне стать полезнее! Пожалуйста, ставьте 👍 или 👎 под каждым комментарием, и я буду использовать ваш отзыв, чтобы улучшать обзоры.
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 15, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • .gitignore - No issues
  • wrangler.jsonc - No issues

This PR adds Cloudflare Workers deployment configuration:

  • .gitignore: Adds wrangler-related ignore patterns (.wrangler, .dev.vars*) with exceptions for example files
  • wrangler.jsonc: Configures static site deployment pointing to the static/ directory

The configuration looks correct - the static directory exists with content, and the wrangler schema is properly defined.


Reviewed by minimax-m2.5 · 101,005 tokens

Comment thread wrangler.jsonc
Comment on lines +4 to +14
"compatibility_date": "2026-04-15",
"observability": {
"enabled": true
},
"assets": {
"directory": "static"
},
"compatibility_flags": [
"nodejs_compat"
]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The wrangler.jsonc configures a static-only deployment, but the frontend requires a Python backend. The backend will not be deployed, causing all API calls to fail.
Severity: CRITICAL

Suggested Fix

Update wrangler.jsonc to support a Python Worker deployment. This includes adding the python_workers compatibility flag, defining a main module to run the FastAPI application, and ensuring a pyproject.toml or requirements.txt file is present to install Python dependencies. This will ensure the backend is deployed alongside the frontend assets.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: wrangler.jsonc#L1-L14

Potential issue: The `wrangler.jsonc` file is configured to deploy only static assets
from the `static` directory. However, the application's frontend (`index.html`) relies
on a Python FastAPI backend (`server.py`) for all its core functionality, making API
calls to relative paths like `/api/bookmarks`. The current Wrangler configuration lacks
the necessary settings to deploy a Python worker, such as the `python_workers`
compatibility flag. As a result, deploying with this configuration will only serve the
static frontend, and all backend API calls will fail with 404 errors, rendering the
application completely non-functional.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants