GUNDI-4744: InReach Route configs fixer script#394
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a Django management command to fix and standardize route configurations for migrated InReach integrations. The script identifies InReach integrations with "[V1 to V2]" in their names, extracts their current provider keys, and rebuilds their route configurations in a standardized format.
- Added a management command that processes InReach integrations to standardize their route configurations
- Implemented provider key extraction logic to preserve existing configuration values
- Added transaction-based updates with error handling and progress logging
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cdip_admin/integrations/management/commands/fix_migrated_route_configs.py
Show resolved
Hide resolved
cdip_admin/integrations/management/commands/fix_migrated_route_configs.py
Show resolved
Hide resolved
| def extract_provider_key(d): | ||
| for k, v in d.items(): | ||
| if k == "default": | ||
| return v |
Contributor
There was a problem hiding this comment.
I think this is OK for this narrow case to fix the Inreach RouteConfigurations.
Contributor
Author
There was a problem hiding this comment.
Yes, it was designed to work only in this case 😅 I know it is not the fanciest way but it works
chrisdoehring
approved these changes
Sep 24, 2025
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.
This pull request adds a new Django management command to help fix and standardize the route configuration for migrated InReach integrations.
The script locates relevant integrations, extracts the current provider key, and rewrites the route configuration in a consistent format for each integration.
Key changes in this pull request:
New management command for InReach integrations:
fix_migrated_route_configs.py, a management command that:Integrationobjects of type "inreach" with names containing "[V1 to V2]".field_mappingsstructure for each integration and its destinations.Some test execution logs: