Report the http(s):// gRPC endpoint deprecation as a DeprecationWarning, not a UserWarning on every client
Maintainer antworten meist innerhalb von 7 Tagen
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 85/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- grpc, python
- Bereich
- developer-experience
Rechercherichtung
Beginne bei GrpcEndpoint._set_scheme in dapr/conf/helpers.py, das warn() ohne Kategorie und ohne stacklevel aufruft. Lies danach die vorhandenen Tests zum Endpunkt-Parsing unter tests/conf/ und tests/clients/. Fertig ist, wenn die Meldung zu einer DeprecationWarning wird, mit einem stacklevel, das auf den Aufrufer zeigt (oder die Warnung wird einmal pro Prozess ausgelöst), die Parsing-Ergebnisse für http/https unverändert bleiben und die neuen assertWarns-Tests sowie uv run pytest tests -m "not e2e" erfolgreich durchlaufen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
Setting DAPR_GRPC_ENDPOINT to an https:// (or http://) URL, for example https://grpc.example.com:443, prints this every time a gRPC endpoint is parsed:
dapr/conf/helpers.py:43: UserWarning: http and https schemes are deprecated for grpc, use myhost?tls=false or myhost?tls=true instead
The sidecar endpoint proposal says SDKs "will continue to accept the old behaviour of DAPR_GRPC_ENDPOINT with the scheme value https to signal to use TLS". The format is supported, so a UserWarning (shown by default, and with no category) is too loud. Because GrpcEndpoint is built for every DaprClient, workflow client and worker, an app that creates several clients logs the same line many times.
The warning comes from GrpcEndpoint._set_scheme in dapr/conf/helpers.py, which calls warn(...) with no category and no stacklevel.
Proposed change
Keep accepting http:// and https:// exactly as today. Only change how the deprecation is reported:
- Emit it as a
DeprecationWarning(hidden by default, visible under-W defaultor in pytest), not aUserWarning. - Pass a
stacklevelthat points at the caller rather than athelpers.py, or emit it at most once per process. - Keep the message, and add the equivalent form for the URL given, e.g.
use grpc.example.com:443?tls=true.
Acceptance criteria
https://host:443andhttp://host:80parse to the same hostname, port and TLS settings as today.- Parsing them raises a
DeprecationWarning, not aUserWarning. Add a test withassertWarns(DeprecationWarning)and one showing that noUserWarningis raised. - Building several clients against the same
https://endpoint doesn't repeat the warning, if you choose the once-per-process approach. - Per the proposal,
https://host?tls=falsestill errors. Add a test if one doesn't exist. - Tests live with the existing endpoint parsing tests under
tests/conf/andtests/clients/.uv run ruff check,uv run ruff formatanduv run pytest tests -m "not e2e"pass.
Pointers for a first contribution
- Code:
dapr/conf/helpers.py, theGrpcEndpoint._set_schememethod. - Python docs:
warnings.warn(category,stacklevel). - Setup: see
CONTRIBUTING.md;uv sync --frozen --all-packages --group devinstalls everything.
- Vorherrschende Sprache
- Python
- Sterne
- 274
- Forks
- 157
- Ø Merge
- 8 T. 20 Std.
- Gemergte PRs (30 T.)
- 31
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus dapr/python-sdk
-
SDK Alignment of Workflow ExamplesEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offendapr-ext-workflow good first issue kind/enhancement P2
Schwierigkeit 2/5 1-2 Tage Anfängerfreundlichkeit 72/100
dapr/python-sdk#853 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 7 Tagen
-
DAPR_* environment variables are snapshotted at import time, so loading config after import silently dials localhostEvtl. vergeben @CasperGN hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
dapr/python-sdk#1259 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 7 Tagen
-
[WORKFLOW SDK FEATURE REQUEST] Retry WaitForInstanceCompletion/Start on a server-sent CANCELLEDOffendapr-ext-workflow kind/enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
dapr/python-sdk#1246 ·
Maintainer antworten meist innerhalb von 7 Tagen
-
[BUG] subscribe_with_handler stops silently: async task can die or be collected, sync retry path exits, handler errors reconnect the streamEvtl. vergeben @CasperGN hat das vor 20 Tagen übernommen. Offenkind/bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 65/100
dapr/python-sdk#1233 ·
Maintainer antworten meist innerhalb von 7 Tagen
-
[BUG] Configuration subscription stops permanently after the daprd sidecar restartsEvtl. vergeben @CasperGN hat das vor 17 Tagen übernommen. Offenkind/bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
dapr/python-sdk#1232 ·
Maintainer antworten meist innerhalb von 7 Tagen
Alle Issues in dapr/python-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
WingedGuardian/GENesis-AGI#3375 ·
Maintainer antworten meist innerhalb von 1 Tag
-
curriculum documentation quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
githubnext/gh-aw-workshop#4601 ·
Maintainer antworten meist innerhalb von 1 Tag
-
approved Good First Issue scope: docs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
hiero-ledger/hiero-sdk-python#2730 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag