Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prevents issue #9921, Add URL validation to Celery class initialization, and update docs#9973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lichfiet wants to merge9 commits intocelery:main
base:main
Choose a base branch
Loading
fromlichfiet:main

Conversation

@lichfiet
Copy link

Description

This pull request aims to help with the issue encountered in issue#9921, which uses Kombu's URL parser to pre-parse the URL when initializing the main Celery class.

Kartstig reacted with hooray emoji
@auvipyauvipy requested review fromauvipy andCopilot and removed request forauvipyOctober 29, 2025 08:59
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds broker URL validation to catch malformed URLs early with helpful error messages. The validation is performed during Celery app initialization and provides guidance to users about proper URL encoding.

  • Validates broker URLs at app initialization using kombu'sparse_url function
  • Provides clear error messages when special characters are not properly percent-encoded
  • Documents the requirement for percent-encoding special characters in credentials

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

FileDescription
celery/app/base.pyAdds_validate_broker_url() method and calls it during__init__ to validate broker URLs early
docs/userguide/configuration.rstAdds warning section documenting the requirement to percent-encode special characters in broker URLs
t/unit/app/test_app.pyAdds three test cases covering invalid URLs, properly encoded URLs, and None broker URLs

@codecov
Copy link

codecovbot commentedOct 29, 2025
edited
Loading

Codecov Report

❌ Patch coverage is77.77778% with2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.68%. Comparing base (929412e) to head (f1adfa7).

Files with missing linesPatch %Lines
celery/app/base.py77.77%2 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #9973      +/-   ##==========================================- Coverage   78.68%   78.68%   -0.01%==========================================  Files         153      153                Lines       19313    19322       +9       Branches     2214     2215       +1     ==========================================+ Hits        15197    15204       +7- Misses       3817     3819       +2  Partials      299      299
FlagCoverage Δ
unittests78.66% <77.77%> (-0.01%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

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

@lichfiet
Copy link
Author

@auvipy changes were made, thanks for letting me contribute. Let me know if you see anything else needing updated.

auvipy reacted with heart emoji


..warning::

Special characters in usernames and passwords must be percent-encoded.
Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, this is not a Celery specific issue, it's true for all URIs. Some parsers may tolerate a subset of special characters in the userinfo, but everything except for unreserved (ALPHA / DIGIT / "-" / "." / "_" / "~") and sub-delim ("!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=") ought to be percent encoded.

auvipy reacted with thumbs up emoji
Trevor Lichfieldand others added8 commitsNovember 14, 2025 02:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Implement copilot suggestions to make the error less verbose. The fact that the host should be valid is implicit.Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Include docs suggestion for the before, to give users a better visualization of the encodingCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Isabelle COWAN-BERGMAN <Izzette@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@auvipyauvipyAwaiting requested review from auvipy

+1 more reviewer

@IzzetteIzzetteIzzette left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.6.x

Development

Successfully merging this pull request may close these issues.

3 participants

@lichfiet@auvipy@Izzette

[8]ページ先頭

©2009-2025 Movatter.jp