Skip to content

Conversation

@dirkmoors
Copy link

No description provided.

Copy link

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

This PR adds support for the amqps (secure AMQP over TLS/SSL) protocol to Flower's broker monitoring functionality. The changes ensure that when using amqps:// broker URLs, Flower correctly uses HTTPS for the RabbitMQ Management API with the appropriate default port (15671 instead of 15672).

Key changes:

  • Extended transport protocol checks to include both 'amqp' and 'amqps' in broker and task API views
  • Added scheme detection to automatically select the correct HTTP scheme (https for amqps, http for amqp) and default management API port (15671 for amqps, 15672 for amqp)

Reviewed changes

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

File Description
flower/views/broker.py Updated broker transport check to support 'amqps' alongside 'amqp'
flower/utils/broker.py Added scheme attribute to BrokerBase; implemented conditional logic for default port (15671 vs 15672) and HTTP scheme (https vs http) based on broker protocol
flower/api/tasks.py Updated transport check in queue length API to support 'amqps' alongside 'amqp'

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

Comment on lines +50 to +51
http_scheme = 'https' if self.scheme == 'amqps' else 'http'
http_api = f"{http_scheme}://{self.username}:{self.password}@{self.host}:{self.port}/api/{self.vhost}"
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The new logic for determining the http_scheme (https for amqps, http for amqp) lacks test coverage. Consider adding tests that verify the generated http_api URL uses the correct scheme: https://... for amqps:// broker URLs and http://... for amqp:// broker URLs.

Copilot uses AI. Check for mistakes.

self.host = self.host or 'localhost'
self.port = self.port or 15672
self.port = self.port or (15671 if self.scheme == 'amqps' else 15672)
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The default port logic for amqps (15671) differs from amqp (15672), but the existing test in tests/unit/utils/test_broker.py at line 35-42 (test_url_defaults_rabbitmq) expects both amqp:// and amqps:// to use port 15672. This test will fail with these changes and should be updated to verify that amqps:// defaults to port 15671 while amqp:// defaults to 15672.

Copilot uses AI. Check for mistakes.
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.

1 participant