fix: key detectors by config ID to support multiple resources of same type#21
Merged
fix: key detectors by config ID to support multiple resources of same type#21
Conversation
4119d0a to
fe067eb
Compare
… type aurora-postgresql and aurora-mysql both have type 'aurora', causing the second to overwrite the first in the detectors map. Fix by keying all maps (invSources, eolProviders, detectors) by config ID instead of resource type. Before: 4 detectors (aurora collision) After: 5 detectors (aurora-postgresql + aurora-mysql) Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d98f0-cc82-75bf-b664-e3a63eef6ee9
fe067eb to
9cc95e3
Compare
Kiran01bm
approved these changes
Apr 17, 2026
nandiheath
approved these changes
Apr 17, 2026
nandiheath
left a comment
There was a problem hiding this comment.
Looks good! 🤖 Automated review passed — no blockers found.
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.
Problem
aurora-postgresqlandaurora-mysqlboth havetype: aurorainconfig/resources.yaml. The detectors map was keyed by resource type, so the second entry overwrote the first — only 4 detectors were initialized instead of 5.Fix
Key
invSources,eolProviders, anddetectorsmaps by config ID (e.g.,aurora-mysql) instead of resource type (e.g.,aurora). Update the orchestrator's default resource list to use config IDs. Remove the now-unnecessary type verification check inListResources.Changes
cmd/server/main.go— key maps byresourceCfg.IDinstead ofresourceCfg.Typepkg/workflow/orchestrator/workflow.go— default fan-out uses config IDspkg/inventory/wiz/generic.go— remove type check inListResources(source knows its own type)pkg/inventory/wiz/generic_test.go— remove obsolete testResult
Before:
✓ Total detectors initialized: 4(aurora collision)After:
✓ Total detectors initialized: 5(aurora-postgresql + aurora-mysql)