-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: added free tier support, imporve overall coverage. #239
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduce AWS Lambda Free Tier support across the calculator and UI, and improve test coverage for conversions, tiered pricing, and edge cases.
- Add include_free_tier parameter and apply free tier logic for requests and compute GB-seconds.
- Enhance UI to surface Free Tier information and add extensive tests for free tier scenarios and previously uncovered branches.
- Minor test updates to disable free tier where exact pricing is expected.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_free_tier.py | New tests validating free tier behavior for requests and compute, including edge cases and step content. |
| tests/test_edge_cases.py | Ensures long-duration test ignores free tier to validate actual pricing. |
| tests/test_coverage_gaps.py | Adds coverage for unit conversions, tiered cost edge cases, overflow pricing, and invalid inputs. |
| site/app/routes/demo.tsx | Displays a banner when free tier is enabled. |
| aws-lambda-calculator/src/aws_lambda_calculator/models.py | Adds include_free_tier to CalculationRequest for validation and schema. |
| aws-lambda-calculator/src/aws_lambda_calculator/calculator.py | Implements free tier logic for compute and requests; threads include_free_tier through calculate and helpers. |
Comments suppressed due to low confidence (1)
aws-lambda-calculator/src/aws_lambda_calculator/calculator.py:197
- The docstring is outdated: the function now accepts include_free_tier and returns a tuple (total_compute_gb_sec, monthly_compute_charges), but @return documents only a single value and include_free_tier is undocumented. Update the docstring to include the new parameter and correct the return description.
) -> tuple[float, float]:
"""
@brief Calculate the monthly compute charges based on requests per month, duration of each request in ms, and memory in GB.
@param requests_per_month: The number of requests per month.
@param duration_of_each_request_in_ms: The duration of each request in milliseconds.
@param memory_in_gb: The amount of memory allocated in GB.
@return: The monthly compute charges.
"""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|



PR Type
Enhancement, Tests
Description
Added AWS Lambda free tier support with configurable toggle
Updated pricing calculation functions to apply free tier deductions
calc_monthly_compute_charges()now deducts free compute GB-secondscalc_monthly_request_charges()now deducts free requestsAdded comprehensive test coverage for free tier functionality
Enhanced UI with free tier information banner in demo page
Diagram Walkthrough
File Walkthrough
calculator.py
Implement free tier deduction in pricing calculationsaws-lambda-calculator/src/aws_lambda_calculator/calculator.py
include_free_tierparameter tocalc_monthly_compute_charges()function
per month
include_free_tierparameter tocalc_monthly_request_charges()function
per month
calculate()function to accept and pass throughinclude_free_tierparameter (defaults to True)models.py
Add free tier toggle to request modelaws-lambda-calculator/src/aws_lambda_calculator/models.py
include_free_tierfield toCalculationRequestmodelTrueto enable free tier by defaultdemo.tsx
Add free tier information banner to demo UIsite/app/routes/demo.tsx
month
include_free_tierform datavalue
test_free_tier.py
Add comprehensive free tier test coveragetests/test_free_tier.py
lines)
exceeding compute limits
arm64)
calculations
test_coverage_gaps.py
Add coverage gap tests for calculator functionstests/test_coverage_gaps.py
needed)
overflow
test_edge_cases.py
Update edge case test for free tier parametertests/test_edge_cases.py
test_very_long_duration()to explicitly disable free tierinclude_free_tier=Falseparameter to test actual pricing withoutfree tier benefits