Report the http(s):// gRPC endpoint deprecation as a DeprecationWarning, not a UserWarning on every client
Maintainer thường phản hồi trong vòng 7 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- grpc, python
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
Bắt đầu từ GrpcEndpoint._set_scheme trong dapr/conf/helpers.py, hàm này gọi warn() mà không có category hay stacklevel. Sau đó đọc các test phân tích endpoint hiện có trong tests/conf/ và tests/clients/. Hoàn thành khi thông báo trở thành DeprecationWarning với stacklevel trỏ tới nơi gọi (hoặc chỉ phát ra một lần cho mỗi tiến trình), kết quả phân tích http/https không thay đổi, và các test assertWarns mới cùng với uv run pytest tests -m "not e2e" đều pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 274
- Fork
- 157
- Merge trung bình
- 9 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dapr/python-sdk
-
SDK Alignment of Workflow ExamplesCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởdapr-ext-workflow good first issue kind/enhancement P2
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 72/100
dapr/python-sdk#853 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
-
[WORKFLOW SDK FEATURE REQUEST] Retry WaitForInstanceCompletion/Start on a server-sent CANCELLEDĐang mởdapr-ext-workflow kind/enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
dapr/python-sdk#1246 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
[BUG] subscribe_with_handler stops silently: async task can die or be collected, sync retry path exits, handler errors reconnect the streamCó thể đã có người làm @CasperGN đã nhận 20 ngày trước. Đang mởkind/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 65/100
dapr/python-sdk#1233 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
[BUG] Configuration subscription stops permanently after the daprd sidecar restartsCó thể đã có người làm @CasperGN đã nhận 17 ngày trước. Đang mởkind/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
dapr/python-sdk#1232 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
[WORKFLOW SDK BUG] Workflow constructors reject Unix-domain socket DAPR_GRPC_ENDPOINTCó thể đã có người làm @Kayvan-Zahiri đã nhận 23 ngày trước. Đang mởdapr-ext-workflow kind/enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
dapr/python-sdk#1213 ·
Maintainer thường phản hồi trong vòng 7 ngày
Tất cả issue của dapr/python-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aws-samples/sample-per-model-bedrock#243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FuRongJun-1999/dsh-memory#404 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PennyLaneAI/catalyst#3337 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workflow.schedule stops when a cron deadline passes before sleepCó thể đã có người làm @HuaTNA đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày