🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Provide a helper method to `Router` for better includes (#1223)
Currently we have to write this code:
To include urls from one router to another.
I propose changing the API to be:
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Provide a helper method to `Router` for better includes (#1223)
Currently we have to write this code:
router = Router(
prefix='api/',
urls=[
path(
model_simple_urls.router.prefix,
include(
(model_simple_urls.router.urls, 'model_simple'),
namespace='model_simple',
),
),
],
)
To include urls from one router to another.
I propose changing the API to be:
router = Router(
prefix='api/',
urls=[
path(
*model_simple_urls.router.to_include(namespace='model_simple'),
),
],
)
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Add `--skip-validation` optional flag to `dmr_export_schema` CLI command (#1225)
django-modern-rest/dmr/management/commands/dmr_export_schema.py
Lines 62 to 69 in ea7d1d0
Currently a call to
We need to add a new CLI flag for this. With
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Add `--skip-validation` optional flag to `dmr_export_schema` CLI command (#1225)
django-modern-rest/dmr/management/commands/dmr_export_schema.py
Lines 62 to 69 in ea7d1d0
Currently a call to
.convert() here does not have skip_validation= flag. Which is very important, without it and with [openapi] extra, schemas with some small violations won't be able to export.We need to add a new CLI flag for this. With
False as default.#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Fix `OpenAPIFormat.IRI` value (#1226)
See the spec https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-7.3.5
It must be
django-modern-rest/dmr/openapi/objects/enums.py
Lines 33 to 34 in ea7d1d0
We also must mark these enums as
#bug #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Fix `OpenAPIFormat.IRI` value (#1226)
See the spec https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-7.3.5
It must be
'iri', not 'iri-reference':django-modern-rest/dmr/openapi/objects/enums.py
Lines 33 to 34 in ea7d1d0
We also must mark these enums as
@enums.unique#bug #good_first_issue #help_wanted #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Fix missing (#1232)
We currently miss these fields from
django-modern-rest/dmr/openapi/objects/schema.py
Lines 17 to 18 in 03e7b14
•
"$ref" — References another schema by URI.
•
"$anchor" — Defines a plain-name fragment anchor within a schema resource.
•
"$comment" — A developer comment; has no effect on validation.
•
"$schema" — Declares which JSON Schema dialect the schema is written against.
It would require a CHANGELOG entry and a test case, since we don't use them as of right now.
#feature #good_first_issue #help_wanted #openapi #django_modern_rest
sent via relator
📝 Fix missing (#1232)
We currently miss these fields from
Schema type definition:django-modern-rest/dmr/openapi/objects/schema.py
Lines 17 to 18 in 03e7b14
•
$ref — https://json-schema.org/draft/2020-12/json-schema-core#section-8.2.3.1"$ref" — References another schema by URI.
•
$anchor — https://json-schema.org/draft/2020-12/json-schema-core#section-8.2.2"$anchor" — Defines a plain-name fragment anchor within a schema resource.
•
$comment — https://json-schema.org/draft/2020-12/json-schema-core#section-8.3"$comment" — A developer comment; has no effect on validation.
•
$schema — https://json-schema.org/draft/2020-12/json-schema-core#section-8.1.1"$schema" — Declares which JSON Schema dialect the schema is written against.
It would require a CHANGELOG entry and a test case, since we don't use them as of right now.
#feature #good_first_issue #help_wanted #openapi #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Improve `Token` customizations coverage (#1191)
I added several customization options to both
• token views
django-modern-rest/dmr/security/token/views.py
Lines 54 to 61 in 36a8567
• token auth
django-modern-rest/dmr/security/token/auth/base.py
Lines 84 to 88 in 36a8567
There are several integration tests that cover this:
django-modern-rest/django_test_app/server/apps/token_auth/views/obtain.py
Lines 46 to 57 in 36a8567
But, it not enough. What we need is more unit tests:
• Test all auth classes: async and sync types for headers / cookies / query
• Test all views: async and sync
• Test all options
• Test both positive and negative cases
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Improve `Token` customizations coverage (#1191)
I added several customization options to both
• token views
django-modern-rest/dmr/security/token/views.py
Lines 54 to 61 in 36a8567
• token auth
django-modern-rest/dmr/security/token/auth/base.py
Lines 84 to 88 in 36a8567
There are several integration tests that cover this:
django-modern-rest/django_test_app/server/apps/token_auth/views/obtain.py
Lines 46 to 57 in 36a8567
But, it not enough. What we need is more unit tests:
• Test all auth classes: async and sync types for headers / cookies / query
• Test all views: async and sync
• Test all options
• Test both positive and negative cases
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
🤯3
🚀 New issue to ag2ai/faststream by @IvanKirpichnikov
📝 Feature: Add `RedisBatchStreamMessage` annotated alias (#3004)
Add to
#enhancement #good_first_issue #redis #faststream #ag2ai
sent via relator
📝 Feature: Add `RedisBatchStreamMessage` annotated alias (#3004)
Add to
faststream/redis/annotations.py the alias for RedisBatchStreamMessage is similar to the aliases for RedisMessage, RedisChannelMessage, etc.#enhancement #good_first_issue #redis #faststream #ag2ai
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Remove `tomli` from`additional_dependencies` in pre-commit (#1255)
We don't need it, since we run py3.11+ with
django-modern-rest/.pre-commit-config.yaml
Lines 61 to 62 in d1f2b6c
#good_first_issue #help_wanted #ci #django_modern_rest
sent via relator
📝 Remove `tomli` from`additional_dependencies` in pre-commit (#1255)
We don't need it, since we run py3.11+ with
tomllib:django-modern-rest/.pre-commit-config.yaml
Lines 61 to 62 in d1f2b6c
#good_first_issue #help_wanted #ci #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Support `ty` for type-checking (#1257)
Very interesting
Things to do:
• Install specific
• Enable its strict mode
• Type-check
• Fix all real problems found by it
• Ignore all false-positives
• Add a changelog entry
• Update list of support type-checkers in README.md
If it produces way to many errors for one specific problem: disable it in config instead.
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Support `ty` for type-checking (#1257)
Very interesting
Things to do:
• Install specific
ty version• Enable its strict mode
• Type-check
dmr/ and typesafety/ directories• Fix all real problems found by it
• Ignore all false-positives
• Add a changelog entry
• Update list of support type-checkers in README.md
If it produces way to many errors for one specific problem: disable it in config instead.
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Add `Router.to_urlpatterns` method (#1262)
The main idea is that we can refactor this:
into this:
It should return
It also should be a default way in the docs.
You would also need to update
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Add `Router.to_urlpatterns` method (#1262)
The main idea is that we can refactor this:
>>> from django.urls import include, path
>>> from dmr.routing import Router
>>> router = Router(
... 'api/',
... [
... path('user/', UserController.as_view(), name='users'),
... ],
... )
>>> urlpatterns = [
... path(router.prefix, include((router.urls, 'my_app'), namespace='api')),
... ]
into this:
>>> from django.urls import include, path
>>> from dmr.routing import Router
>>> router = Router(
... 'api/',
... [
... path('user/', UserController.as_view(), name='users'),
... ],
... )
>>> urlpatterns = [
... path(*router.to_urlpatterns(namespace='api')),
... ]
It should return
tuple of (prefix, urlpatterns) properly typed.It also should be a default way in the docs.
You would also need to update
routing.rst docs to show that these two operations are basically the same. See how we do it with Router.include in the same file.#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Support `django-stubs@6.1` (#1263)
We need to bump the package version and fix any potential problems found by mypy.
#good_first_issue #help_wanted #dependencies #django_modern_rest
sent via relator
📝 Support `django-stubs@6.1` (#1263)
We need to bump the package version and fix any potential problems found by mypy.
#good_first_issue #help_wanted #dependencies #django_modern_rest
sent via relator
🚀 New issue to ag2ai/faststream by @Lancetnik
📝 Feature: `StreamSub(declare=False)` to opt out of Redis Stream creation (#3013)
Is your feature request related to a problem? Please describe.
FastStream creates the Redis Stream for you whenever a subscriber uses a consumer group —
faststream/faststream/redis/subscriber/usecases/stream_subscriber.py
Lines 133 to 138 in 2e36197
That is a fine default, but it means a typo in a stream name silently provisions a new empty stream instead of failing, and a service that is only supposed to consume a stream provisioned elsewhere has no way to say so. Every other broker in FastStream already has this opt-out —
Describe the solution you'd like
A
Feature code example
Semantics
Redis only offers the "check, do not create" form, so
The existing
Implementation notes
1. Add
faststream/faststream/redis/schemas/stream_sub.py
Lines 44 to 69 in 2e36197
— plus an
2. Pass
3.
4. Tests go in
Out of scope: publishing.
Additional context
Prior art to copy the naming and docstring style from:
#enhancement #good_first_issue #redis #faststream #ag2ai
sent via relator
📝 Feature: `StreamSub(declare=False)` to opt out of Redis Stream creation (#3013)
Is your feature request related to a problem? Please describe.
FastStream creates the Redis Stream for you whenever a subscriber uses a consumer group —
mkstream=True is hardcoded and there is no way to turn it off:faststream/faststream/redis/subscriber/usecases/stream_subscriber.py
Lines 133 to 138 in 2e36197
That is a fine default, but it means a typo in a stream name silently provisions a new empty stream instead of failing, and a service that is only supposed to consume a stream provisioned elsewhere has no way to say so. Every other broker in FastStream already has this opt-out —
RabbitQueue(declare=False), RabbitExchange(declare=False), JStream(declare=False), KvWatch(declare=False), ObjWatch(declare=False). Redis is the only one missing it. The same knob is being added to Kafka in #1827.Describe the solution you'd like
A
declare: bool = True argument on StreamSub, passed through as mkstream=not declare. Default behaviour does not change.Feature code example
from faststream import FastStream
from faststream.redis import RedisBroker, StreamSub
broker = RedisBroker()
app = FastStream(broker)
# unchanged default — stream is created if missing
@broker.subscriber(stream=StreamSub("orders", group="g", consumer="c"))
async def owned(msg: str) -> None: ...
# provisioned elsewhere — fail fast instead of creating an empty stream
@broker.subscriber(
stream=StreamSub("external-events", group="g", consumer="c", declare=False)
)
async def consumed(msg: str) -> None: ...
Semantics
Redis only offers the "check, do not create" form, so
declare=False fails when the stream is absent — the same as RabbitMQ's declare=False (AMQP passive=True), and unlike NATS' variant which just skips creation. Verified against redis:alpine:mkstream=False -> ResponseError: The XGROUP subcommand requires the key to exist.
Note that for CREATE you may want to use the MKSTREAM option to
create an empty stream automatically.
exists after mkstream=False: 0
mkstream=True -> exists after: 1
The existing
except ResponseError only swallows "already exists", so this error propagates as-is today — which is the wanted behaviour. Wrapping it in a FastStream error with a message pointing at declare=False would be a nice touch, not a requirement.Implementation notes
1. Add
declare: bool = True to StreamSub.__init__ and to __slots__ —faststream/faststream/redis/schemas/stream_sub.py
Lines 44 to 69 in 2e36197
— plus an
Args: entry in the class docstring.2. Pass
mkstream=not stream.declare at the xgroup_create call linked above.3.
declare only has an effect on the consumer-group path — that xgroup_create runs only when group and consumer are both set. Without a group the subscriber uses XREAD, which never creates anything. StreamSub already emits RuntimeWarning for argument combinations that have no effect (no_ack with a group, polling_interval with last_id != ">"); declare=False without a group deserves the same treatment.4. Tests go in
tests/brokers/redis/ — one real-broker case asserting the stream is not created and the error surfaces, one asserting the default still creates it.Out of scope: publishing.
XADD always creates the stream and Redis exposes no flag to prevent it, so there is no publisher-side equivalent.Additional context
Prior art to copy the naming and docstring style from:
RabbitQueue.declare and JStream.declare.#enhancement #good_first_issue #redis #faststream #ag2ai
sent via relator
🚀 New issue to ag2ai/faststream by @kumaranvpl
📝 Ability to configure topic params in confluent create_topics (#1827)
Current state: every topic FastStream creates is created with
faststream/faststream/confluent/helpers/admin.py
Lines 52 to 55 in 2e36197
The only knob users have is the broker-wide
Request: introduce a
Scope
1.
2.
Proposed semantics of
Interaction with the broker-level flag:
Consistency across brokers:
AioKafka is out of scope. FastStream never creates topics for
Both return nothing. Topic creation on that path is entirely the Kafka server's
Implementation notes
•
• Normalise
•
faststream/faststream/confluent/helpers/client.py
Lines 292 to 294 in 2e36197
•
Related: #2679 (closed in favour of this), #1486, #1658, #2451.
#good_first_issue #confluent #kafka #faststream #ag2ai
sent via relator
📝 Ability to configure topic params in confluent create_topics (#1827)
Current state: every topic FastStream creates is created with
num_partitions=1, replication_factor=1, hardcoded:faststream/faststream/confluent/helpers/admin.py
Lines 52 to 55 in 2e36197
The only knob users have is the broker-wide
allow_auto_create_topics flag — all topics of a broker are created, or none of them are. There is no way to configure a single topic, nor to opt a single topic out of creation.Request: introduce a
Topic schema object accepted by subscriber() / publisher() alongside plain strings, carrying per-topic settings:from faststream.confluent import KafkaBroker, Topic
broker = KafkaBroker()
@broker.subscriber(
Topic("topic-name", num_partitions=3),
Topic("topic-name2", num_partitions=1, replication_factor=2),
Topic("externally-managed", declare=False),
"topic-without-settings",
)
async def handler(msg: str) -> None: ...
Scope
1.
num_partitions / replication_factor per topic — the original ask, from https://github.com/airtai/faststream/discussions/1821. Today both are pinned to 1, which makes FastStream-created topics unusable in any real deployment.2.
declare: bool = True — opt a single topic out of creation while auto-creation stays the default for everything else. This subsumes #2679: the global default is not changing, because a broker-wide switch is the wrong granularity — a service typically owns some of its topics and consumes others that are provisioned by a different team or by IaC.Proposed semantics of
declare=False: skip the create_topics call for that topic and nothing else — do not probe the cluster for existence, do not fail if the topic is missing. This matches what allow_auto_create_topics=False does today (a warning, then let the consumer proceed) and matches NATS' JStream(declare=False). Note this deliberately differs from RabbitMQ's RabbitQueue(declare=False), which maps to AMQP passive=True and does raise when the queue is absent — Kafka has no cheap equivalent of a passive declare.Interaction with the broker-level flag:
allow_auto_create_topics=False on the broker keeps winning over everything — it stays the "create nothing at all" switch. declare only narrows creation further when the broker-level flag is on.Consistency across brokers:
declare is the established name for this in FastStream — RabbitQueue(declare=...), JStream(declare=...), KvWatch(declare=...), ObjWatch(declare=...). Topic should use the same name rather than inventing a Kafka-specific one.AioKafka is out of scope. FastStream never creates topics for
faststream.kafka — there is no AdminClient.create_topics call on that path, and aiokafka (0.13.0) does not support an allow_auto_create_topics consumer option at all:$ grep -rn "auto_create\|auto\.create" .venv/lib/python3.11/site-packages/aiokafka/
$ grep -rn "auto_create" faststream/kafka/
Both return nothing. Topic creation on that path is entirely the Kafka server's
auto.create.topics.enable, which FastStream cannot influence. Topic may still be accepted there later for symmetry, but declare would be a no-op, so it should not block this issue.Implementation notes
•
create_subscriber() / create_publisher() signatures must accept str | Topic — *topics: str is what currently trips mypy on the branch in progress.• Normalise
str → Topic(name) at registration time, as RabbitMQ does with str → RabbitQueue.•
AsyncConfluentConsumer.topics_to_create should filter on declare —faststream/faststream/confluent/helpers/client.py
Lines 292 to 294 in 2e36197
•
Topic needs __hash__ / __eq__ consistent with each other, since topics end up as dict keys (see #2796 for the RabbitMQ precedent).Related: #2679 (closed in favour of this), #1486, #1658, #2451.
#good_first_issue #confluent #kafka #faststream #ag2ai
sent via relator
🚀 New issue to faststream-community/zMQTT by @borisalekseev
📝 Add Last Will support to the public MQTTClient API (#45)
Problem
cannot be configured through the public high-level client API.
Currently:
•
•
•
As a result, users and frameworks built on the public
including FastStream, cannot configure an MQTT Last Will without depending on
private implementation details.
Proposed API
For MQTT 3.1.1, the same
Scope
• Export
• Add
• Add the same argument to
• Store the configured Will and pass it to every
the client.
• Preserve the same Will configuration when the client reconnects after an
established connection is lost.
• Reject MQTT 5.0 Will properties on MQTT 3.1.1 with a clear error consistent
with other version-specific options.
• Keep the current behavior unchanged when
Tests
The tests should exercise the public client path rather than only the existing
packet codec:
• MQTT 3.1.1: construct
• MQTT 5.0: verify the same fields together with
• Simulate
Tests should test public behaviour with real broker instead internals testing and avoid monkey patching.
#enhancement #good_first_issue #faststream #zmqtt
sent via relator
📝 Add Last Will support to the public MQTTClient API (#45)
Problem
zmqtt already implements MQTT Last Will at the packet/codec level, but itcannot be configured through the public high-level client API.
Currently:
•
Will and WillProperties are only available through private zmqtt._internal modules;•
MQTTClient and create_client() do not accept a will= argument;•
MQTTClient._connect() builds every CONNECT packet without a Will.As a result, users and frameworks built on the public
zmqtt.MQTTClient API,including FastStream, cannot configure an MQTT Last Will without depending on
private implementation details.
Proposed API
from zmqtt import MQTTClient, QoS, Will, WillProperties
will = Will(
topic="devices/device-42/status",
payload=b"offline",
qos=QoS.AT_LEAST_ONCE,
retain=True,
properties=WillProperties(
will_delay_interval=10,
content_type="text/plain",
),
)
client = MQTTClient(
"broker.example.com",
version="5.0",
will=will,
)
For MQTT 3.1.1, the same
Will type should be usable withoutWillProperties.Scope
• Export
Will and WillProperties from the top-level zmqtt package.• Add
will: Will | None = None to MQTTClient.• Add the same argument to
create_client() and all of its typed overloads.• Store the configured Will and pass it to every
Connect packet created bythe client.
• Preserve the same Will configuration when the client reconnects after an
established connection is lost.
• Reject MQTT 5.0 Will properties on MQTT 3.1.1 with a clear error consistent
with other version-specific options.
• Keep the current behavior unchanged when
will=None.Tests
The tests should exercise the public client path rather than only the existing
packet codec:
• MQTT 3.1.1: construct
MQTTClient(..., will=...), decode the emitted CONNECT, and verify the Will topic, payload, QoS, and retain flag.• MQTT 5.0: verify the same fields together with
WillProperties.• Simulate
will receiving of second client when the first reconnected unexpectedlyTests should test public behaviour with real broker instead internals testing and avoid monkey patching.
#enhancement #good_first_issue #faststream #zmqtt
sent via relator
🔥3
🚀 New issue to ag2ai/faststream by @IvanKirpichnikov
📝 Bug: Uncorrect typehint for `partition_assignment_strategy` parameter in `faststream.kafka` (#3019)
Now:
Need:
#bug #good_first_issue #aiokafka #faststream #ag2ai
sent via relator
📝 Bug: Uncorrect typehint for `partition_assignment_strategy` parameter in `faststream.kafka` (#3019)
Now:
partition_assignment_strategy: Sequence["AbstractPartitionAssignor"]Need:
partition_assignment_strategy: Sequence["type[AbstractPartitionAssignor]"]#bug #good_first_issue #aiokafka #faststream #ag2ai
sent via relator
😁2
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Support conditional files models (#1275)
We already have conditional
Docs: https://django-modern-rest.readthedocs.io/en/latest/pages/negotiation.html#using-different-schemes-for-different-content-types
But, we don't test conditional
See this TODO:
django-modern-rest/dmr/components.py
Lines 884 to 900 in e0c2546
Supporting it might require some additional work.
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator
📝 Support conditional files models (#1275)
We already have conditional
Body models. Which we fully test and support.Docs: https://django-modern-rest.readthedocs.io/en/latest/pages/negotiation.html#using-different-schemes-for-different-content-types
But, we don't test conditional
FileMetadata[] components.See this TODO:
django-modern-rest/dmr/components.py
Lines 884 to 900 in e0c2546
Supporting it might require some additional work.
#feature #good_first_issue #help_wanted #django_modern_rest
sent via relator