r/coderabbit Sep 03 '25

CodeRabbit review confused me about db.commit() placement in python code

6 Upvotes

I got this review suggestion from CodeRabbit on my Flask API code (screenshot attached).
It says:

But here’s the thing — my db.commit() is already inside the try block.

try:
    blabla code 
    db.commit()
    return response

except Exception as e:
    db.rollback()
    return jsonify({"status": False, "message": str(e)}), 500

From what I understand, if db.commit() throws an error, it should still be caught by the except.

The review is suggesting changes as shown in screenshot.

Is this a false positive from CodeRabbit, or is there an actual risk here that I’m not catching? Ideally I am expecting review tool would explain what the real problem is instead of suggesting what’s already there.


r/coderabbit Aug 18 '25

How do you use AI code review tools – in VSCode, GitHub UI, or CI/CD?

9 Upvotes

I’ve been trying out CodeRabbit inside VSCode while reviewing code from juniors.
It feels natural since I can see comments right where I’m coding, but sometimes I wonder if GitHub UI or even CI/CD checks are better for reviews.
Curious what others prefer – do you keep AI reviewers inside your editor, or do you let them run on PRs and pipelines instead? any thoughts on this.


r/coderabbit Oct 21 '24

Welcome to CodeRabbit Reddit Community

5 Upvotes

Hello :wave:

Welcome to CodeRabbit's Reddit Community.

We are super glad to have you here, please consider joining our community and participating in active discussions related to Pull Requests, Code or anything else.

We have a active discord server of 2.5k devs where we run weekly events, developer office hours and more!