Repository navigation
Conversation
Every comparison with NaN is false, so --target-coverage NaN passed the range check and then read as "unset" in applySizing, silently sizing with --coverage. Add requireFinite and apply it to --coverage, --target-coverage, --min-pool-size and --min-savings-pct, before any API call. Closes #2136 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 52 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 88 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rejects NaN and +/-Inf for
--coverage,--target-coverage,--min-pool-sizeand--min-savings-pctin the flag validators (onerequireFinite(name, v)helper), before any API call. Explicit--target-coverage 0stays valid (documented disabled); ranges are unchanged.Root cause: every ordered comparison with NaN is false, so
--target-coverage NaNpassed the<0 || >100check, thenapplySizing/fetchExistingCoveragereadTargetCoverage > 0as "unset" and silently sized with--coverage(default 80).--coverage NaNreachesrecfilter.ApplyCoverage(sizing.go:23), producing NaN HourlyCommitment/costs for SP recs and an arch-dependentint(NaN*count)for RI recs.--min-pool-size NaNpassed the whole-number check;--min-savings-pcthad no validation.Evidence (offline)
TestValidateNumericFlagsRejectNonFinitedrives the real flags viarootCmd.ParseFlagsthen the validators; it never callsrunTool, so no AWS client is built. Cases: NaN, nan, +/-Inf per flag, 1e999 (rejected by the flag parser), explicit 0 and valid values.Pre-fix (validators.go stashed): all 9 non-finite cases fail; post-fix pass.
go vet ./..., build andgo test ./cmd(463s) pass; pre-commit hooks (incl. gocyclo) pass.Not in this PR
--min-savings-pct: fix(cmd): --min-savings-pct has no range validation #2161.Closes #2136
🤖 Generated with Claude Code