Skip to content

Add web_application_options setting to configure the web application (#551)#704

Merged
wbarnha merged 1 commit into
masterfrom
claude/feat-551-web-app-options
Jul 21, 2026
Merged

Add web_application_options setting to configure the web application (#551)#704
wbarnha merged 1 commit into
masterfrom
claude/feat-551-web-app-options

Conversation

@wbarnha

@wbarnha wbarnha commented Jul 19, 2026

Copy link
Copy Markdown
Member

What

The aiohttp web driver always constructed aiohttp.web.Application() with no arguments, so there was no way to configure the embedded web server — e.g. raise client_max_size or install middlewares.

Closes #551.

How

Added a new web_application_options mapping setting. Its contents are forwarded as keyword arguments to the web framework's application object; for the default aiohttp driver they go straight to aiohttp.web.Application(**options):

from aiohttp.web import middleware

@middleware
async def error_middleware(request, handler):
    ...

app = App(..., web_application_options={
    'client_max_size': 1024 ** 2 * 20,
    'middlewares': [error_middleware],
})

Defaults to None (no options), preserving the previous behaviour exactly. The accepted keys depend on the configured web driver.

Changes

  • faust/types/settings/settings.py — new web_application_options setting (params.Dict[Any]) + __init__ parameter, with a documented docstring.
  • faust/web/drivers/aiohttp.pyWeb.__init__ now builds Application(**(app.conf.web_application_options or {})).

Test

  • tests/unit/web/drivers/test_aiohttp.pytest_web_application_options asserts the options are forwarded to Application(...); test_web_application_options__default asserts the no-option default calls Application().
  • tests/functional/test_app.py — added the setting to the config default check (is None) and to the round-trip assert_config_equivalent set/assert flow.

All affected suites pass (138 passed).

🤖 Generated with Claude Code


Generated by Claude Code

…551)

The aiohttp web driver always constructed aiohttp.web.Application() with no
arguments, so there was no way to set things like client_max_size or install
middlewares on the embedded web server.

Add a new web_application_options mapping setting whose contents are
forwarded as keyword arguments to the web framework's application object.
For the default aiohttp driver these go straight to
aiohttp.web.Application(**options).  Defaults to None (empty), preserving
the previous behaviour.

Closes #551.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.15%. Comparing base (3073eb9) to head (0b471c8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #704   +/-   ##
=======================================
  Coverage   94.14%   94.15%           
=======================================
  Files         104      104           
  Lines       11136    11136           
  Branches     1201     1201           
=======================================
+ Hits        10484    10485    +1     
+ Misses        551      550    -1     
  Partials      101      101           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

wbarnha added a commit that referenced this pull request Jul 19, 2026
Per review, the v0.12.0 changelog/release notes should describe only what is
already on master, not work still in open PRs.

- Remove the not-yet-merged items: the offset-commit data-loss fixes
  (#606/#707, #316/#692), the optional OpenTracing/OpenTelemetry extras
  (#685/#686, #688/#681), web_application_options (#704), and the reported-issue
  fix stack (#693-#703, #705). These will be added back as they merge.
- Add a Dependencies section noting the current runtime/client libraries:
  mode-streaming >= 0.4.0, aiokafka >= 0.10.0 (compatible with recent 0.13/0.14
  releases), the new confluent-kafka >= 2.0.0 for faust[ckafka], and the
  faust-cchardet fork replacing unmaintained cchardet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
@wbarnha
wbarnha added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit e5d10c9 Jul 21, 2026
22 checks passed
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.

Could you please extend the setting of the webserver to pass parameters?

1 participant