Skip to content

Comments

fix: sync setup.py version/python-requires with pyproject.toml, add logging to notifications#29

Merged
AreteDriver merged 1 commit intomainfrom
claude/code-review-improvements-sfsyf
Feb 18, 2026
Merged

fix: sync setup.py version/python-requires with pyproject.toml, add logging to notifications#29
AreteDriver merged 1 commit intomainfrom
claude/code-review-improvements-sfsyf

Conversation

@AreteDriver
Copy link
Owner

  • Update setup.py version from 1.0.0 to 1.5.0 to match pyproject.toml
  • Update python_requires from >=3.8 to >=3.10 to match pyproject.toml
  • Update setup.py classifiers: remove 3.8/3.9, add 3.12
  • Fix Python version references across all docs (README, CONTRIBUTING,
    getting-started, index.rst, TOPICS.md, bug_report template)
  • Add logging to 6 silent except blocks in notifications.py that
    swallowed errors without any diagnostic output

https://claude.ai/code/session_01W1kSjHVKvCByvEBprEyPhN

…ogging to notifications

- Update setup.py version from 1.0.0 to 1.5.0 to match pyproject.toml
- Update python_requires from >=3.8 to >=3.10 to match pyproject.toml
- Update setup.py classifiers: remove 3.8/3.9, add 3.12
- Fix Python version references across all docs (README, CONTRIBUTING,
  getting-started, index.rst, TOPICS.md, bug_report template)
- Add logging to 6 silent except blocks in notifications.py that
  swallowed errors without any diagnostic output

https://claude.ai/code/session_01W1kSjHVKvCByvEBprEyPhN
@gemini-code-assist
Copy link

Summary of Changes

Hello @AreteDriver, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request standardizes the project's declared version and Python compatibility across its configuration and documentation files. It updates setup.py to align with the pyproject.toml's specified version and Python requirements, and propagates these Python version changes throughout the project's README, contributing guidelines, and other documentation. Additionally, it enhances the robustness of the notification system by introducing logging for exceptions that were previously swallowed, ensuring better visibility into potential issues.

Highlights

  • Version Synchronization: Synchronized the project version and Python compatibility requirements in setup.py to match pyproject.toml, updating the version to 1.5.0 and python_requires to >=3.10.
  • Python Version Updates: Updated Python version references across various documentation files and setup.py classifiers to reflect support for Python 3.10+ and 3.12, while removing explicit support for 3.8 and 3.9.
  • Improved Error Handling: Added logging to previously silent exception blocks within src/redops/modules/notifications.py to provide diagnostic output for failed notification attempts.
Changelog
  • .github/ISSUE_TEMPLATE/bug_report.md
    • Updated example Python version from 3.9 to 3.12.
    • Updated example RedOPS version from 1.0.0 to 1.5.0.
  • .github/TOPICS.md
    • Updated Python programming language range from 3.8-3.12 to 3.10-3.12.
  • CONTRIBUTING.md
    • Updated Python prerequisite from 3.8 or higher to 3.10 or higher.
  • README.md
    • Updated Python version badge from 3.8+ to 3.10+.
    • Updated Python installation requirement from 3.8 or higher to 3.10 or higher.
  • docs/getting-started.md
    • Updated Python prerequisite from 3.8 or higher to 3.10 or higher.
  • docs/index.rst
    • Updated Python version badge from 3.8+ to 3.10+.
  • setup.py
    • Updated project version from 1.0.0 to 1.5.0.
    • Updated python_requires from >=3.8 to >=3.10.
    • Removed Python 3.8 and 3.9 from classifiers.
    • Added Python 3.12 to classifiers.
  • src/redops/modules/notifications.py
    • Imported the logging module.
    • Initialized a logger instance.
    • Added logger.warning calls to six except Exception blocks in _send_slack, _send_slack_alert, _send_discord, _send_discord_alert, _send_email, and _send_webhook functions to log exceptions.
Activity
  • No activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/redops/modules/notifications.py 0.00% 14 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the project's version and Python compatibility, ensuring consistency across documentation and setup.py with pyproject.toml. It also improves observability by adding logging to previously silent exception blocks in src/redops/modules/notifications.py. However, a security audit identified two vulnerabilities in src/redops/modules/notifications.py: a high-severity Server-Side Request Forgery (SSRF) due to unvalidated webhook URLs from environment variables, and a medium-severity issue where new logging changes expose full webhook URLs (potentially containing secrets) in logs.

return response.status_code in (200, 201, 202, 204)
except Exception:
except Exception as e:
logger.warning("Failed to send webhook to %s: %s", url, e)

Choose a reason for hiding this comment

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

security-medium medium

The newly added logging statement in the _send_webhook function logs the full webhook URL in case of an error. Webhook URLs often contain secrets, and logging them exposes these secrets in application logs. An attacker with access to the logs could steal these credentials.

Remediation:
Avoid logging the full URL. If the URL must be logged for debugging, parse it and log only the host or parts that do not contain secrets. For example, you could log urlparse(url).netloc.

Suggested change
logger.warning("Failed to send webhook to %s: %s", url, e)
logger.warning("Failed to send webhook to %s: %s", url.split('?')[0].split('/')[-1], e)

Comment on lines +268 to +269
except Exception as e:
logger.warning("Failed to send Slack notification: %s", e)

Choose a reason for hiding this comment

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

medium

To fully leverage the StructuredLogger (if adopted as suggested in the previous comment), the exception details should be passed as a keyword argument to the logging method. This allows the structured logger to include the error details in a more parseable format.

If the standard logging.getLogger is retained, the current format string approach is acceptable, but using keyword arguments is preferred for structured logging.

Suggested change
except Exception as e:
logger.warning("Failed to send Slack notification: %s", e)
except Exception as e:
logger.warning("Failed to send Slack notification", error=str(e))

Comment on lines +296 to +297
except Exception as e:
logger.warning("Failed to send Slack alert: %s", e)

Choose a reason for hiding this comment

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

medium

To fully leverage the StructuredLogger (if adopted as suggested in the previous comment), the exception details should be passed as a keyword argument to the logging method. This allows the structured logger to include the error details in a more parseable format.

If the standard logging.getLogger is retained, the current format string approach is acceptable, but using keyword arguments is preferred for structured logging.

Suggested change
except Exception as e:
logger.warning("Failed to send Slack alert: %s", e)
except Exception as e:
logger.warning("Failed to send Slack alert", error=str(e))

Comment on lines +341 to +342
except Exception as e:
logger.warning("Failed to send Discord notification: %s", e)

Choose a reason for hiding this comment

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

medium

To fully leverage the StructuredLogger (if adopted as suggested in the previous comment), the exception details should be passed as a keyword argument to the logging method. This allows the structured logger to include the error details in a more parseable format.

If the standard logging.getLogger is retained, the current format string approach is acceptable, but using keyword arguments is preferred for structured logging.

Suggested change
except Exception as e:
logger.warning("Failed to send Discord notification: %s", e)
except Exception as e:
logger.warning("Failed to send Discord notification", error=str(e))

Comment on lines +372 to +373
except Exception as e:
logger.warning("Failed to send Discord alert: %s", e)

Choose a reason for hiding this comment

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

medium

To fully leverage the StructuredLogger (if adopted as suggested in the previous comment), the exception details should be passed as a keyword argument to the logging method. This allows the structured logger to include the error details in a more parseable format.

If the standard logging.getLogger is retained, the current format string approach is acceptable, but using keyword arguments is preferred for structured logging.

Suggested change
except Exception as e:
logger.warning("Failed to send Discord alert: %s", e)
except Exception as e:
logger.warning("Failed to send Discord alert", error=str(e))

Comment on lines +396 to +397
except Exception as e:
logger.warning("Failed to send email notification: %s", e)

Choose a reason for hiding this comment

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

medium

To fully leverage the StructuredLogger (if adopted as suggested in the previous comment), the exception details should be passed as a keyword argument to the logging method. This allows the structured logger to include the error details in a more parseable format.

If the standard logging.getLogger is retained, the current format string approach is acceptable, but using keyword arguments is preferred for structured logging.

Suggested change
except Exception as e:
logger.warning("Failed to send email notification: %s", e)
except Exception as e:
logger.warning("Failed to send email notification", error=str(e))

@AreteDriver AreteDriver merged commit 2b46094 into main Feb 18, 2026
15 of 17 checks passed
@AreteDriver AreteDriver deleted the claude/code-review-improvements-sfsyf branch February 18, 2026 11:43
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.

2 participants