Skip to content

Implement missing _delete() method of filesystem.Channel#2470

Open
WojciechMigda wants to merge 13 commits intocelery:mainfrom
WojciechMigda:transport-filesystem-channel-delete
Open

Implement missing _delete() method of filesystem.Channel#2470
WojciechMigda wants to merge 13 commits intocelery:mainfrom
WojciechMigda:transport-filesystem-channel-delete

Conversation

@WojciechMigda
Copy link

As of now, Channel class of filesystem transport does not have a _delete method. It prevents queues from being removed from an associated exchange. This PR intents to remedy that.

Copy link
Contributor

Copilot AI 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

Implements the missing filesystem transport Channel._delete() behavior so that deleting a queue also removes its binding from the exchange’s persisted routing table (control files), preventing bindings from leaking across test cases and runs.

Changes:

  • Add Channel._delete() to update control_folder/<exchange>.exchange when queues are deleted.
  • Expand filesystem transport unit tests to validate exchange-table updates after Queue.delete().
  • Isolate tests via per-test temporary control_folder and explicit cleanup of temp folders/bindings.

Reviewed changes

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

File Description
kombu/transport/filesystem.py Adds _delete() to remove bindings from the persisted exchange routing table file.
t/unit/transport/test_filesystem.py Adds assertions around binding-table contents and improves test isolation/cleanup for filesystem transport.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@WojciechMigda
Copy link
Author

I'll take care of this.

WojciechMigda and others added 4 commits March 1, 2026 22:07
Duplicated temporary folder removal code was extracted
to WithJanitorMixin class.

Safe queue deletion was taken care of by creating managed_consumer function,
decorated with contextlib.contextmanager.
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.21%. Comparing base (f94ccd4) to head (c1a35d5).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
kombu/transport/filesystem.py 78.26% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2470      +/-   ##
==========================================
- Coverage   82.23%   82.21%   -0.02%     
==========================================
  Files          79       79              
  Lines       10080    10103      +23     
  Branches     1151     1154       +3     
==========================================
+ Hits         8289     8306      +17     
- Misses       1589     1591       +2     
- Partials      202      206       +4     

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

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

would you mind improving the test coverage, Please?

Copy link
Contributor

Copilot AI 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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

auvipy and others added 4 commits March 3, 2026 12:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@WojciechMigda
Copy link
Author

would you mind improving the test coverage, Please?

Sure thing.

@auvipy auvipy added this to the 5.7.0 milestone Mar 3, 2026
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.

3 participants