Skip to content

feat: migrate Tier 2 resources to map_existing_resources#529

Merged
michael-richey merged 1 commit intomrichey/map-existing-resources-tier1from
mrichey/map-existing-resources-tier2
Apr 20, 2026
Merged

feat: migrate Tier 2 resources to map_existing_resources#529
michael-richey merged 1 commit intomrichey/map-existing-resources-tier1from
mrichey/map-existing-resources-tier2

Conversation

@michael-richey
Copy link
Copy Markdown
Collaborator

Summary

  • Migrate 3 complex Tier 2 resources that override map_existing_resources() with custom logic
  • All resources now use _existing_resources_map as the standardized dict name

Migrated resources

Resource Key Override reason
roles attributes.name Custom fetch via get_destination_roles_mapping(); removed N+1 re-fetch from pre_resource_action_hook
security_monitoring_rules name Custom fetch via get_destination_rules(); removed side-effect dest fetch from get_resources()
team_memberships team_id:user_id (callable) Custom multi-step fetch; O(1) dict lookup replaces O(n) list scan

Notable improvements

  • roles: Eliminated per-resource API re-fetch in pre_resource_action_hook (was O(n) calls where n = number of roles)
  • team_memberships: Composite key dict lookup replaces _get_existing_team_membership() linear scan

Stack

  • PR 1: Infrastructure + opt-out flags
  • PR 2: Tier 1 resources migration
  • PR 3 (this): Tier 2 resources migration

Test plan

  • All 68 new tests pass (zero RED remaining)
  • 226 existing unit tests pass with zero regressions

🤖 Generated with Claude Code

@michael-richey michael-richey requested a review from a team as a code owner April 17, 2026 20:22
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier1 branch from b473ca6 to 9618178 Compare April 17, 2026 20:48
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier2 branch 2 times, most recently from 8cda408 to a5e6ec6 Compare April 17, 2026 20:55
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier1 branch from 9618178 to 8de4dc4 Compare April 17, 2026 20:55
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier1 branch from 8de4dc4 to 159d33c Compare April 20, 2026 13:25
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier2 branch 2 times, most recently from 468316e to c93fa20 Compare April 20, 2026 13:45
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier1 branch from 159d33c to ad69f8e Compare April 20, 2026 13:45
Migrate 3 complex resources that override map_existing_resources()
with custom fetch/mapping logic while using the standardized
_existing_resources_map dict.

Migrated resources:
- roles: override with get_destination_roles_mapping(), removed
  redundant re-fetch from pre_resource_action_hook (N+1 perf fix)
- security_monitoring_rules: override with get_destination_rules(),
  removed side-effect dest fetch from get_resources()
- team_memberships: override with composite team_id:user_id key,
  O(1) dict lookup replaces O(n) list scan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier1 branch from ad69f8e to aef178a Compare April 20, 2026 14:08
@michael-richey michael-richey force-pushed the mrichey/map-existing-resources-tier2 branch from c93fa20 to 09fc70a Compare April 20, 2026 14:08
@michael-richey michael-richey merged commit 9a35c56 into mrichey/map-existing-resources-tier1 Apr 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants