-
Notifications
You must be signed in to change notification settings - Fork 63
fix: Resolve conditions variable type error in backup selections #170
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
- Fix conditions variable type from optional(map(any)) to proper nested object structure - Update selection_by_conditions example to use conditions instead of selection_tags - Add comprehensive test case for conditions variable validation - Resolves issue #169 where conditions caused "attribute types must all match" error The conditions variable now properly supports the AWS Backup API structure: - string_equals: map of key-value pairs for exact matches - string_not_equals: map of key-value pairs for exclusions - string_like: map of key-value pairs for pattern matching - string_not_like: map of key-value pairs for pattern exclusions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
bugbot run |
- Update selection_conditions variable to use structured object type - Update backup_selections.conditions to use structured object type - Ensures consistent type definition across all conditions variables - Addresses PR review feedback about type inconsistency
|
Thanks for the great feedback! 🎯 I've addressed the type inconsistency by updating all conditions variables to use the same structured object type: Changes Made1. ✅ Fixed variable
2. ✅ Fixed variable
3. ✅ Already fixed
ResultNow all three conditions variables use the exact same type definition, providing:
The changes maintain backward compatibility while providing much better user experience and type safety. |
|
bugbot run |
|
📝 Breaking Change Documentation Added I've updated the PR description to properly document this as a breaking change with: 🔍 What's documented:
🎯 Key points for users:
📚 Documentation follows project patterns:
This ensures users understand the change and can migrate smoothly if needed! |
|
bugbot run |
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.
✅ BugBot reviewed your changes and found no bugs!
Was this report helpful? Give feedback by reacting with 👍 or 👎
Summary
optional(map(any))to proper nested object structureType Definition Changes
This PR updates the type definition for all
conditionsvariables frommap(any)to a structured object type for better type safety and AWS API compliance.Variables affected:
plans.selections.conditionsselection_conditionsbackup_selections.conditionsBefore:
After:
Migration Impact
✅ Most users need no changes - If you were using conditions successfully, your code should continue working unchanged.
✅ Fixes broken use cases - Users experiencing "attribute types must all match" errors will now have working code.
Migration Example
If you have existing conditions code like:
No changes needed - this will continue to work.
Changes Made
1. Fixed Variable Type Definition (variables.tf)
Updated all conditions variables to use consistent structured object types that match the AWS Backup API specification.
2. Updated Example (examples/selection_by_conditions/main.tf)
Changed from using
selection_tagsto properly demonstratingconditions:3. Added Comprehensive Tests
/test/fixtures/terraform/conditions/test fixtureTestConditionsVariableTypestest caseProblem Solved
Before: Users trying to use conditions would get:
After: Users can now use the conditions structure as intended:
Benefits
Test Plan
Closes
Closes #169