Skip to content

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

disabled: The client doesn’t send the CLIENT MAINT_NOTIFICATIONS ON ... command as part of the handshake. The feature isn’t used by the client.

enabled: The client forcefully sends the CLIENT MAINT_NOTIFICATIONS ON ... command to the server. If the server responds with an error, the connection is interrupted and an error is raised.

auto: The client tries to send the CLIENT MAINT_NOTIFICATIONS ON ... command to the server. If the server returns an error, the client should continue without the push notifications.

Copy link

jit-ci bot commented Sep 26, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@petyaslavova petyaslavova added the maintenance Maintenance (CI, Releases, etc) label Sep 26, 2025
Copy link
Contributor

@Copilot 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 a new "auto" option to the MaintNotificationsConfig.enabled parameter, expanding the configuration from a simple boolean to support three modes: disabled (False), enabled (True), and auto ("auto"). The auto mode allows the client to attempt maintenance notifications but gracefully continue if the server doesn't support them, rather than failing the connection.

Key changes:

  • Updated the enabled parameter type to accept boolean or "auto" string literal
  • Modified connection handshake logic to handle auto mode with graceful fallback
  • Added comprehensive test coverage for the new handshake behaviors

Reviewed Changes

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

File Description
redis/maint_notifications.py Updates MaintNotificationsConfig.enabled type and default value to support "auto" mode
redis/connection.py Implements auto mode logic in handshake with graceful error handling for unsupported servers
tests/test_maint_notifications.py Updates default value test to reflect new "auto" default
tests/test_maint_notifications_handling.py Adds comprehensive test coverage for handshake scenarios and refactors test structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@petyaslavova petyaslavova merged commit b102c3b into master Sep 26, 2025
72 of 73 checks passed
@petyaslavova petyaslavova deleted the ps_add_maint_notifications_auto_enabled_support branch September 26, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants