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

🤖 Fix: Checkout inventory validation and add tests #700

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sentry-autofix[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Gideon Lapshun

Fixes FLASK-1GX

  • Fixes a bug where inventory count was not being properly accessed during checkout.
  • Adds comprehensive unit tests for the checkout process, including scenarios for sufficient inventory, insufficient inventory, missing inventory records, and type conversion of inventory quantities.
  • Modifies the checkout function to correctly validate inventory levels and handle cases where inventory records are missing.
  • Adds a test fixture for setting up a test database with inventory data.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 6946.

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
empower ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 9:42am

Copy link

sentry-io bot commented Feb 27, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: flask/src/db.py

Function Unhandled Issue
get_inventory DatabaseConnectionError: get_inventory checkout
Event Count: 8
📄 File: flask/src/main.py (Click to Expand)
Function Unhandled Issue
checkout Exception: Not enough inventory for product checkout
Event Count: 3.1k
checkout DatabaseConnectionError: get_inventory checkout
Event Count: 8
---

Did you find this useful? React with a 👍 or 👎

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.56%. Comparing base (63e4f96) to head (21eab51).

✅ All tests successful. No failed tests found.

❌ Your project check has failed because the head coverage (30.56%) is below the target coverage (35.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
+ Coverage   30.10%   30.56%   +0.45%     
==========================================
  Files          38       38              
  Lines         940      926      -14     
  Branches      113      113              
==========================================
  Hits          283      283              
+ Misses        640      626      -14     
  Partials       17       17              
Flag Coverage Δ *Carryforward flag
api 6.84% <ø> (+0.24%) ⬆️ Carriedforward from 63e4f96
frontend 47.06% <ø> (ø) Carriedforward from 63e4f96

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
checkout_module 6.84% <ø> (+0.24%) ⬆️
product_component 43.30% <ø> (ø)
Files with missing lines Coverage Δ
flask/src/db.py 0.00% <ø> (ø)
flask/src/main.py 0.00% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants