Skip to content

Demo: aido review - #64

Open
dvirdung wants to merge 1 commit into
mainfrom
demo/v132-review
Open

Demo: aido review#64
dvirdung wants to merge 1 commit into
mainfrom
demo/v132-review

Conversation

@dvirdung

@dvirdung dvirdung commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Sample order-processing code with a deliberate mix of patterns (mutable default arg, bare except, string-built SQL, magic numbers, missing validation) to showcase aido review — consolidated review + applyable inline suggestions.

Comment aido review to see it in action. Part of the Aido demo set.

@dvirdung dvirdung added the demo label Jul 21, 2026
@dvirdung

Copy link
Copy Markdown
Contributor Author

aido review

@github-actions

Copy link
Copy Markdown

🤖 Hi @dvirdung, I’ve queued your aido review request. Follow progress here: https://github.com/aido-dev/aido/actions/runs/29812281083

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR introduces several common Python anti-patterns and security vulnerabilities, including a mutable default argument, SQL injection, and a bare except clause. Addressing these issues will significantly improve the code's robustness, security, and maintainability.

Recommendation: Request changes

Faceted Notes:

  • Security: Critical SQL injection vulnerability; bare except masks errors and potential security issues.
  • Correctness: Mutable default argument leads to unexpected state; missing input validation for order dictionary keys.
  • Maintainability: Use of "magic numbers" reduces readability and makes updates difficult; bare except hinders debugging.
  • QA/Testing: Bare except swallows all errors, making testing for specific failure modes difficult; lack of input validation can lead to runtime errors.

Response generated using gemini-2.5-flash

Comment thread demo/review_demo.py
total = total * 0.8
if total > 1000:
total = total - 50 # magic number
return total

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [HIGH] Mutable default argument coupons=[]. This list will be shared across all calls to apply_discount, leading to unexpected behavior.

Suggested change
return total
def apply_discount(total, tier, coupons=None):
if coupons is None:
coupons = []
coupons.append("applied") # mutable default arg bug

@dvirdung dvirdung changed the title Demo: aido review (v1.3.2) Demo: aido review Jul 22, 2026
dvirdung added a commit that referenced this pull request Jul 27, 2026
Surface real Aido output above the fold so a visitor can judge quality
without installing. Adds a per-command demo-PR gallery (#64-69), two
collapsed real-output samples (review bug-catching, explain walkthrough),
a 60-second start, and points the Demo PRs badge at the new section.

GIF hero slot is scaffolded but commented out until the recording lands
(docs/media/ + shot list), so nothing renders broken in the meantime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant