Skip to content

[🐞 BUG]: results referenced before assignment in PRReviewSystem.process_pull_request #53

Description

@mishrajyoti1405-tech

Description πŸ“

In PRReviewSystem.process_pull_request(), the variable results is passed to
_send_discord_notification() before it is defined. This may raise an
UnboundLocalError when this code path is executed.

Link πŸ”—

https://github.com/ruxailab/disgitbot/blob/main/pr_review/main.py

Steps to Reproduce πŸ”„

  1. Trigger the PR review automation for a pull request.
  2. Execution reaches the Discord notification step.
  3. results is referenced before being assigned.

Screenshots πŸ“Έ

Not applicable (code-level issue).

Expected Behavior πŸ€”

The results object should be defined before being passed to
_send_discord_notification() so that the notification can be sent safely.

Actual Behavior 😱

The code references the results variable before it is assigned, which can
raise an UnboundLocalError at runtime.

Environment 🌍

  • Project file: pr_review/main.py
  • Git branch: main
  • OS: Windows

Additional Information ℹ️

Happy to open a PR with a fix if this change is acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions