Commit db43793
authored
chore: Adds support for plan modifier on replication_specs changed (#3083)
* feat: Index copying of replication specs
* feat: Index copying of region_configs
* naive implementation, always CopyUnknowns but has errors
* feat: Support detecting ISS to set empty `Id`
* test: Add failing test case for an unknown object with fields that should be kept unknown
* feat: Enhance CopyUnknowns to respect keepUnknown for object attributes that are unknown
* feat: Update CopyUnknowns to respect keepUnknown for region configurations
* feat: Enhance handling of unknowns in replication specs with dynamic keepUnknown logic for changed replication specs
* chore: update mock data
* refactor: move clusterUseISS to plan_modifier
* fix: patch_payload forceUpdateAttr must include the attribute
* feat: Enhance sharding configuration handling with improved unknowns management and error diagnostics
* feat: Improve unknowns handling in replication specs with dynamic keepUnknowns logic
* chore: safeguard conversion to PATCH by never using "" in Id or ZoneId
* feat: Refactor unknowns handling in sharding configuration and remove unused clusterUseISS function
* feat: Add zone name matching logic to enhance unknowns handling in replication specs
* chore: update MacT tests
* refactor: write doc and use the same concepts everywhere and determineKeepUnknowns
* refactor: update Update method to use config instead of plan to avoid sending `UseStateForUnknown` values
* feat: Implement FindChanges function to detect differences between source and destination TFModels
* feat: Add AttributeChanges struct and methods for tracking attribute modifications
* refactor: Rename config variable to configModel to avoid shadowing config import
* refactor: Enhance determineKeepUnknowns logic to incorporate attribute changes and clean up unused functions
* refactor: Use AttributeChanges instead of Patchpayload
* refactor: Use vars to simplify the logic of which fields to keep unknown
* test: Add unit tests for KeepUnknown method in AttributeChanges
* refactor: Simplify leafChanges logic and add ListLenChanges method for better list change detection
* refactor: External_id should not be set if the size of replication specs changes
* refactor: Add ListIndexChanged and NestedListLenChanges methods for improved change detection
* refactor: Enhance handling of unknowns in replication specs and simplify related logic by using AttributeChanges
* chore: update mocked data
* chore: revert stylistic changes
* doc: Add some comments to describe changes
* refactor: Simplify patch options for replication specs in Update method
* chore: minor comment [ci skip]
* refactor: move fields with no dependencies to the top
* feat: add minimize level configuration for replication specs
* fix minimize level logic
* fix: change default minimize level to always for bug investigation
* merge plan modifier changes cleanup
* fix: tenant upgrade unknown for flex for mongo_db_major_version
* refactor: optimize variable declarations and improve comments in schema functions
* fix: add mongo_db_major_version to keepUnknownFlexUpgrade for tenant upgrade (goes from "" --> x.x)
* refactor: remove unnecessary handling of flex upgrade in useStateForUnknowns function1 parent 07dbc9c commit db43793
File tree
13 files changed
+1009
-106
lines changed- internal
- common
- schemafunc
- update
- service
- advancedclustertpf
- advancedcluster/testdata
- TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate
- TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel
- TestAccMockableAdvancedCluster_symmetricShardedOldSchema
- TestAccMockableAdvancedCluster_tenantUpgrade
13 files changed
+1009
-106
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
0 commit comments