feat: migrate Tier 2 resources to map_existing_resources#538
Merged
michael-richey merged 2 commits intomainfrom Apr 21, 2026
Merged
feat: migrate Tier 2 resources to map_existing_resources#538michael-richey merged 2 commits intomainfrom
michael-richey merged 2 commits intomainfrom
Conversation
- Migrate roles, security_monitoring_rules, team_memberships, logs_metrics to map_existing_resources pattern - Fix transitive dependency handling in resources_handler.py so map_existing_resources is called for all resource types including transitively-pulled-in ones - Fix roles: allow built-in roles through sync to establish source→dest ID mapping (managed-role guard in create_resource prevents any API calls) - Fix users: correct role ID translation in update_user_roles; add isinstance guard for dict-typed DeepDiff values_changed entries - Add monitor pre-check in TestCli sync/migrate tests to handle async deletion side-effects from preceding resource tests - Remove redundant map_existing_resources override from team_memberships - Black formatting Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Re-recorded cassettes after Tier 2 map_existing_resources migration and related fixes. All TestCli and resource tests pass. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
3 tasks
heyronhay
approved these changes
Apr 21, 2026
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
roles,security_monitoring_rules,team_memberships,logs_metricsto themap_existing_resourcespattern (matching Tier 1 from feat: migrate Tier 1 resources to map_existing_resources #528)resources_handler.pysomap_existing_resourcesis called for resource types pulled in transitively (e.g. roles as a dep of users)connect_idcan translate source→destination role IDs. The existingmanagedcheck increate_resourceprevents any actual API calls — it just creates the mapping.users.pyupdate_user_roleswhere DeepDiffvalues_changedcould produce a dict object asnew_valueinstead of a string ID_wait_for_no_destination_monitorspre-check in TestCli sync/migrate tests to handle async deletion side-effects from preceding resource testsNote on built-in roles
If you have existing source state from before this change (where built-in roles were filtered and never imported), run
importagain beforesyncto create the correct source→destination ID mapping.Test plan
RECORD=true tox -e py39)tox -e ruff,blackpasses🤖 Generated with Claude Code