Repository navigation
Conversation
Slice A, steps A2 and A3 of #1746. - DerivePlanServices drops a bound entry's "#<group_id>" suffix, so the arming checks and grant constraints see "ec2" for "aws/ec2#g1". - resolveService keeps only a bound group's own identities from the strict read, before the plan match, suppression and account checks that still apply. A matching recommendation that was not selected is never bought and never enters the frozen baseline. - Bound identities the strict read didn't show are returned as Result.MissingBound and logged at warn with plan and service. Some missing: the rest are sized. All missing: the empty result takes the existing ErrNoMatch grace path. - On a bound plan, planServiceOf matches a baselined identity to the enabled group that bound it, so targetMet judges each group against its own coverage, including groups that differ only in payment. A key no group bound is not judged. Unmarked plans keep today's first-entry match (a regression test covers the payment-split case). pre-commit: cfn-lint skipped (it can't install here); no CloudFormation files are touched. Part of #1746 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slice A, step A5 of #1746. When the stored or the new plan carries the bound_groups marker, these writes to an armed plan also count as escalations, so the execute:purchases grant's constraints are checked again: - a new effective group id; - a bound set that isn't a subset of the old one, including bound to unbound (an empty set means filter re-match); - a group cap raised or removed (a nil group cap is unbounded, unlike capCents(nil)); - a group's term or normalized payment changing; - a disabled group re-enabled; - the bound_groups marker removed. The provider and service sets can't show any of these. Unmarked plans keep today's rules exactly; a guard test pins that term-only and payment-only edits don't escalate. pre-commit: cfn-lint skipped (it can't install here); no CloudFormation files are touched. Part of #1746 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #1746. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Part of #1746 (slice A). This is the first of two stacked PRs; the second, A6a and A6b (show bound groups and
bound_countin plan responses), follows when a slot frees.Builds on #1774 (bound plan validation, merged).
What
A2+A3: resolve a bound group from its selected recommendations (
internal/planstep).DerivePlanServicesdrops a bound entry's#<group_id>suffix, so the arming checks and grant constraints seeec2foraws/ec2#g1.resolveServicekeeps only the group's own bound identities from the strict read, before the existing plan-match, suppression and account checks. A matching recommendation that wasn't selected is never bought and never enters the frozen baseline.Result.MissingBoundand are logged at warn level. If some are missing, the rest are sized; if all are missing, the existingErrNoMatchgrace path runs.planServiceOfmatches a baselined identity to the enabled group that bound it, sotargetMetjudges each group against its own coverage, including groups that differ only in payment. Unmarked plans keep today's first-entry match, with a regression test for the payment split.A5: re-check the arming grant when a bound plan's groups widen (
internal/api). When the stored or new plan carries thebound_groupsmarker, these writes to an armed plan count as escalations, so theexecute:purchasesgrant constraints are checked again:Unmarked plans keep today's rules exactly, and a guard test pins that.
Tests
Unit tests for each rule above, including the unmarked-plan guards. The two feature commits ran every pre-commit hook available when they were written (cfn-lint was skipped by name before #1781; no CloudFormation is touched). The third commit (a gocritic
rangeValCopyfix found after the rebase) ran every hook.Verification
Local, macOS, on the branch rebased onto main 71b5e29:
go build ./...OK.go test -p 2oninternal/planstep,internal/api,internal/purchaseandinternal/config: all pass.golangci-lintv2.10.1 on./...: 0 issues.This touches no money-moving call: A2+A3 narrow which recommendations a bound group may size, and A5 only adds escalation cases to the existing grant re-check. Integration suites run in CI.
🤖 Generated with Claude Code