Skip to content

Refactor to reduce duplicate code#6

Open
SaketOH wants to merge 1 commit into
devfrom
improvement/raw_message_single_function
Open

Refactor to reduce duplicate code#6
SaketOH wants to merge 1 commit into
devfrom
improvement/raw_message_single_function

Conversation

@SaketOH

@SaketOH SaketOH commented Jun 19, 2024

Copy link
Copy Markdown
Contributor

User description

Summary

What?

Why?

Testing Scope

  • [ ]
  • [ ]

Dependant PRs

Documentation links


Description

  • Refactored the AWS SQS message polling logic to reduce code duplication by merging poll_message_from_queue and poll_raw_message_from_queue into a single function.
  • Introduced a new boolean parameter is_raw_message_enabled to switch between raw message processing and standard message processing within the unified function.
  • Removed the now redundant poll_raw_message_from_queue function.
  • Updated error handling and logging for message integrity checks and Redis message retrieval.
  • Incremented the project version to 0.1.18 to reflect the changes made.

Changes walkthrough

Relevant files
Enhancement
main.py
Refactor message polling to handle raw messages                               

src/pubsublib/aws/main.py

  • Combined poll_message_from_queue and poll_raw_message_from_queue into
    a single function with a flag to handle raw messages.
  • Removed duplicate code by consolidating message polling logic.
  • Added a new parameter is_raw_message_enabled to toggle between raw
    message handling and default behavior.
  • Improved error handling and logging for message integrity verification
    and Redis message retrieval.
  • +21/-76 
    Configuration changes
    pyproject.toml
    Project version bump                                                                                     

    pyproject.toml

    • Bumped the project version from 0.1.17 to 0.1.18.
    +1/-1     

    🔍 Secrets Detected:
    /src/pubsublib/aws/main.py
    TypeLine Number
    Hex High Entropy String335
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    @codeant-ai codeant-ai Bot added enhancement New feature or request bug_fix labels Jun 19, 2024
    @raj-nt raj-nt changed the base branch from main to dev November 27, 2025 14:51
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    bug_fix enhancement New feature or request

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant