Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove false log that file was modified, but no patch found for bitbucket server #1469

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

gryphon-ops
Copy link
Contributor

@gryphon-ops gryphon-ops commented Jan 20, 2025

PR Type

Bug fix


Description

  • Fixed a false log issue in Bitbucket Server provider.

  • Updated load_large_diff function call to suppress warnings.


Changes walkthrough 📝

Relevant files
Bug fix
bitbucket_server_provider.py
Fix false log and suppress warnings in diff handling         

pr_agent/git_providers/bitbucket_server_provider.py

  • Updated load_large_diff function call to include show_warning=False.
  • Addressed false log issue when no patch is found.
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any question about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🏅 Score: 95
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add patch generation validation check

    Add error handling to verify the patch generation was successful before appending to
    diff_files, as a failed patch generation could lead to incomplete or incorrect diff
    information.

    pr_agent/git_providers/bitbucket_server_provider.py [237-241]

     patch = load_large_diff(file_path, new_file_content_str, original_file_content_str, show_warning=False)
    +if patch is not None:
    +    diff_files.append(
    +        FilePatchInfo(
    +            original_file_content_str,
     
    -diff_files.append(
    -    FilePatchInfo(
    -        original_file_content_str,
    -
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a potential bug by adding a crucial null check for the patch generation result, preventing the addition of invalid diff information that could cause downstream issues in the application.

    8
    • Author self-review: I have reviewed the PR code suggestions, and addressed the relevant ones.

    @mrT23
    Copy link
    Collaborator

    mrT23 commented Jan 23, 2025

    thanks, indeed a false log

    @mrT23 mrT23 merged commit b5f52c5 into qodo-ai:main Jan 23, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants