diff --git a/Core/Executor/ContentManager.php b/Core/Executor/ContentManager.php index ab732d9c..86268796 100644 --- a/Core/Executor/ContentManager.php +++ b/Core/Executor/ContentManager.php @@ -363,7 +363,9 @@ protected function matchContents($action, $step) $limit = isset($step->dsl['match_limit']) ? $this->referenceResolver->resolveReference($step->dsl['match_limit']) : 0; $sort = isset($step->dsl['match_sort']) ? $this->referenceResolver->resolveReference($step->dsl['match_sort']) : array(); - return $this->contentMatcher->match($match, $sort, $offset, $limit); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->contentMatcher->match($match, $sort, $offset, $limit, $tolerateMisses); } /** diff --git a/Core/Executor/ContentTypeGroupManager.php b/Core/Executor/ContentTypeGroupManager.php index 1eda18ca..259e7ea7 100644 --- a/Core/Executor/ContentTypeGroupManager.php +++ b/Core/Executor/ContentTypeGroupManager.php @@ -114,7 +114,9 @@ protected function matchContentTypeGroups($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->contentTypeGroupMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->contentTypeGroupMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/ContentTypeManager.php b/Core/Executor/ContentTypeManager.php index 2ae9fdbf..f9b04e84 100644 --- a/Core/Executor/ContentTypeManager.php +++ b/Core/Executor/ContentTypeManager.php @@ -349,7 +349,9 @@ protected function matchContentTypes($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($match); - return $this->contentTypeMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->contentTypeMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/ContentVersionManager.php b/Core/Executor/ContentVersionManager.php index 13960101..2ee08034 100644 --- a/Core/Executor/ContentVersionManager.php +++ b/Core/Executor/ContentVersionManager.php @@ -126,7 +126,9 @@ protected function matchVersions($action, $step) $offset = isset($step->dsl['match_offset']) ? $this->referenceResolver->resolveReference($step->dsl['match_offset']) : 0; $limit = isset($step->dsl['match_limit']) ? $this->referenceResolver->resolveReference($step->dsl['match_limit']) : 0; - return $this->versionMatcher->match($match, $matchVersions, $sort, $offset, $limit); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->versionMatcher->match($match, $matchVersions, $sort, $offset, $limit, $tolerateMisses); } /** diff --git a/Core/Executor/LanguageManager.php b/Core/Executor/LanguageManager.php index 9c6e8811..62fd036b 100644 --- a/Core/Executor/LanguageManager.php +++ b/Core/Executor/LanguageManager.php @@ -144,7 +144,9 @@ protected function matchLanguages($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->languageMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->languageMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/LocationManager.php b/Core/Executor/LocationManager.php index 87dea969..852af4e2 100644 --- a/Core/Executor/LocationManager.php +++ b/Core/Executor/LocationManager.php @@ -287,7 +287,9 @@ protected function matchLocations($action, $step) $limit = isset($step->dsl['match_limit']) ? $this->referenceResolver->resolveReference($step->dsl['match_limit']) : 0; $sort = isset($step->dsl['match_sort']) ? $this->referenceResolver->resolveReference($step->dsl['match_sort']) : array(); - return $this->locationMatcher->match($match, $sort, $offset, $limit); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->locationMatcher->match($match, $sort, $offset, $limit, $tolerateMisses); } /** diff --git a/Core/Executor/ObjectStateGroupManager.php b/Core/Executor/ObjectStateGroupManager.php index 14d37049..9b9b08ea 100644 --- a/Core/Executor/ObjectStateGroupManager.php +++ b/Core/Executor/ObjectStateGroupManager.php @@ -152,7 +152,9 @@ protected function matchObjectStateGroups($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->objectStateGroupMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->objectStateGroupMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/ObjectStateManager.php b/Core/Executor/ObjectStateManager.php index bb5c3125..dfb0f49e 100644 --- a/Core/Executor/ObjectStateManager.php +++ b/Core/Executor/ObjectStateManager.php @@ -170,7 +170,9 @@ protected function matchObjectStates($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->objectStateMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->objectStateMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/RoleManager.php b/Core/Executor/RoleManager.php index 06162420..b5c4ef7d 100644 --- a/Core/Executor/RoleManager.php +++ b/Core/Executor/RoleManager.php @@ -172,7 +172,9 @@ protected function matchRoles($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($match); - return $this->roleMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->roleMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/SectionManager.php b/Core/Executor/SectionManager.php index 33211136..2824c9a6 100644 --- a/Core/Executor/SectionManager.php +++ b/Core/Executor/SectionManager.php @@ -129,7 +129,9 @@ protected function matchSections($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->sectionMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->sectionMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/TagManager.php b/Core/Executor/TagManager.php index 2601a831..1723dd0b 100644 --- a/Core/Executor/TagManager.php +++ b/Core/Executor/TagManager.php @@ -190,7 +190,9 @@ protected function matchTags($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($step->dsl['match']); - return $this->tagMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->tagMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/UserGroupManager.php b/Core/Executor/UserGroupManager.php index 850c9514..6362822a 100644 --- a/Core/Executor/UserGroupManager.php +++ b/Core/Executor/UserGroupManager.php @@ -199,7 +199,9 @@ protected function matchUserGroups($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($match); - return $this->userGroupMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->userGroupMatcher->match($match, $tolerateMisses); } /** diff --git a/Core/Executor/UserManager.php b/Core/Executor/UserManager.php index 887acef1..62b7abba 100644 --- a/Core/Executor/UserManager.php +++ b/Core/Executor/UserManager.php @@ -218,7 +218,9 @@ protected function matchUsers($action, $step) // convert the references passed in the match $match = $this->resolveReferencesRecursively($match); - return $this->userMatcher->match($match); + $tolerateMisses = isset($step->dsl['match_tolerate_misses']) ? $this->referenceResolver->resolveReference($step->dsl['match_tolerate_misses']) : false; + + return $this->userMatcher->match($match, $tolerateMisses); } /** diff --git a/Resources/doc/DSL/ContentTypeGroups.yml b/Resources/doc/DSL/ContentTypeGroups.yml index b008794f..d0a71920 100644 --- a/Resources/doc/DSL/ContentTypeGroups.yml +++ b/Resources/doc/DSL/ContentTypeGroups.yml @@ -32,6 +32,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier identifier: xyz # Identifier/name of new content type group modification_date: 123 # Optional, custom modification date for the content type group (timestamp) references: # Optional @@ -69,6 +70,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars diff --git a/Resources/doc/DSL/ContentTypes.yml b/Resources/doc/DSL/ContentTypes.yml index 8f5365ba..e369f3e5 100644 --- a/Resources/doc/DSL/ContentTypes.yml +++ b/Resources/doc/DSL/ContentTypes.yml @@ -151,6 +151,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier content_type_group: x # Id or identifier of a new group we want to put the new content type into (this will not remove it from the current group) remove_content_type_group: x # Id or identifier of a group we want to remove this content type from default_always_available: true|false # Optional @@ -227,6 +228,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars diff --git a/Resources/doc/DSL/ContentVersions.yml b/Resources/doc/DSL/ContentVersions.yml index 3939dd40..505ea057 100644 --- a/Resources/doc/DSL/ContentVersions.yml +++ b/Resources/doc/DSL/ContentVersions.yml @@ -2,6 +2,7 @@ type: content_version mode: delete match: # Same as for Content update/delete/load actions + match_tolerate_misses: false # Same too match_versions: # NB: the migration will not fail if there are no matching versions found for the currently matched Contents status: string|array # accepted values: draft, archived, published @@ -24,6 +25,7 @@ type: content_version mode: load match: # Same as for Content update/delete/load actions + match_tolerate_misses: false # Same too match_versions: # NB: the migration will not fail if there are no matching versions found for the currently matched Contents status: string|array # accepted values: draft, archived, published diff --git a/Resources/doc/DSL/Contents.yml b/Resources/doc/DSL/Contents.yml index 6973ab30..d5e87ad7 100644 --- a/Resources/doc/DSL/Contents.yml +++ b/Resources/doc/DSL/Contents.yml @@ -157,6 +157,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier attributes: # the list of attribute identifier value pairs. For the format to use, see above attribute1: value1 attribute2: value2 @@ -259,6 +260,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change if: # Optional. If set, the migration step will be skipped unless the condition is matched @@ -315,6 +317,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional diff --git a/Resources/doc/DSL/Languages.yml b/Resources/doc/DSL/Languages.yml index e7267db5..3025b175 100644 --- a/Resources/doc/DSL/Languages.yml +++ b/Resources/doc/DSL/Languages.yml @@ -35,6 +35,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or code name: something enabled: true|false # The list in references tells the manager to store specific values for later use by other steps in the current migration. @@ -72,6 +73,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or code name: something enabled: true|false # The list in references tells the manager to store specific values for later use by other steps in the current migration. @@ -109,8 +111,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' - name: something - enabled: true|false + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or code # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional diff --git a/Resources/doc/DSL/Locations.yml b/Resources/doc/DSL/Locations.yml index cbab53d3..e3797983 100644 --- a/Resources/doc/DSL/Locations.yml +++ b/Resources/doc/DSL/Locations.yml @@ -118,6 +118,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: depth|is_main|node_id|path|ptiority|visibility, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no location matching, when matching by id or identifier parent_location: x # Optional The parent location to move the subtree to. Cannot be set at the same time than swap_with_location # When a non numeric string is used, it is assumed to be a location remote id is_hidden: true|false # Optional, Set the visibility of the location @@ -199,6 +200,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: depth|is_main|node_id|path|ptiority|visibility, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no location matching, when matching by id or identifier # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional @@ -278,6 +280,7 @@ match_limit: 0 # optional match_sort: # optional. If set, it has to be an array - { sort_field: depth|is_main|node_id|path|ptiority|visibility, sort_order: ASC|DESC } + match_tolerate_misses: false # optional. Do not fail the execution if there is no location matching, when matching by id or identifier # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional diff --git a/Resources/doc/DSL/Loops.yml b/Resources/doc/DSL/Loops.yml index 5804e23c..b9236745 100644 --- a/Resources/doc/DSL/Loops.yml +++ b/Resources/doc/DSL/Loops.yml @@ -1,6 +1,6 @@ # Loop steps allow to execute multiple times in a row (a sequence of) other steps. # Nested loops are supported. -# NB: step execution events are triggered only for the outhermost loop step +# NB: step execution events are triggered only for the outermost loop step - type: loop diff --git a/Resources/doc/DSL/ObjectStatesAndGoups.yml b/Resources/doc/DSL/ObjectStatesAndGoups.yml index 6e36a3d4..c4c7808b 100644 --- a/Resources/doc/DSL/ObjectStatesAndGoups.yml +++ b/Resources/doc/DSL/ObjectStatesAndGoups.yml @@ -39,6 +39,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier identifier: x # Optional String: new identifier of the object state group names: # Optional: array of names keyed by language code. languageCodeA: name @@ -83,6 +84,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars @@ -111,6 +113,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' +match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars @@ -162,6 +165,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier identifier: x # Optional String: new identifier of the object state names: # Optional: array of names keyed by language code. languageCodeA: name @@ -205,6 +209,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars @@ -233,6 +238,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars diff --git a/Resources/doc/DSL/RolesAndPolicies.yml b/Resources/doc/DSL/RolesAndPolicies.yml index fe74ea94..4a639542 100644 --- a/Resources/doc/DSL/RolesAndPolicies.yml +++ b/Resources/doc/DSL/RolesAndPolicies.yml @@ -109,6 +109,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier new_name: # Optional (note: this field might be renamed in the future) assign: # Optional - @@ -169,6 +170,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars @@ -197,6 +199,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' not: # matches elements NOT satisfying the wrapped condition _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id or identifier references: # Optional. See above for allowed values expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change # 'one': only one element should be matched; reference values will be scalars diff --git a/Resources/doc/DSL/Trash.yml b/Resources/doc/DSL/Trash.yml index 154908a7..7bad5dbf 100644 --- a/Resources/doc/DSL/Trash.yml +++ b/Resources/doc/DSL/Trash.yml @@ -11,7 +11,7 @@ type: trash mode: recover match: - xxx # See the conditions for content/update + xxx # See the conditions for content/update. NB: the migration will not fail if nothing is matched references: # Optional - identifier: referenceId # A string used to identify the reference @@ -30,7 +30,7 @@ type: trash mode: delete match: - xxx # See the conditions for content/update + xxx # See the conditions for content/update. NB: the migration will not fail if nothing is matched references: # Optional - identifier: referenceId # A string used to identify the reference diff --git a/Resources/doc/DSL/UsersAndGroups.yml b/Resources/doc/DSL/UsersAndGroups.yml index dd9853fd..db4871ab 100644 --- a/Resources/doc/DSL/UsersAndGroups.yml +++ b/Resources/doc/DSL/UsersAndGroups.yml @@ -76,6 +76,7 @@ # first_name: "faker: firstName" # last_name: "faker: lastName" + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login email: xyz # Optional. NB: can only be set if the match definition latches a single user password: xyz # Optional. NB: The given password string is the plaintext version; it will be automatically hashed in the cms. PLEASE DON'T LET CLEARTEXT PASSWORDS BE STORED IN YOUR SOURCE CODE VERSIONING SYSTEMS enabled: true|false # Optional @@ -117,9 +118,8 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' - _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' - # NB: if you need more complex matching conditions to select a set of users, see user/update above - + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login references: # Optional - identifier: referenceId # A string used to identify the reference @@ -149,6 +149,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' - _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, email or login references: # Optional - identifier: referenceId # A string used to identify the reference @@ -201,6 +202,7 @@ # NB: if you need more complex matching conditions to select a set of usergroups, see user/update above + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id name: xyz # Optional. Can only be used when the group to be updated is single description: xyz # Optional parent_group_id: x # Optional, the new parent user group ID or group's remote_id @@ -245,6 +247,7 @@ # NB: if you need more complex matching conditions to select a set of usergroups, see user/update above + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional @@ -279,6 +282,7 @@ _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' - _condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or' + match_tolerate_misses: false # optional. Do not fail the execution if there is no item matching, when matching by id, remote_id or parent id # The list in references tells the manager to store specific values for later use by other steps in the current migration. # NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step! references: # Optional diff --git a/WHATSNEW.md b/WHATSNEW.md index 68d62810..878e5374 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -1,6 +1,10 @@ Version 5.13.0 ============== +* Improved: a single value for a content field of type ezcountry can be specified as a string instead of an array (issue #190) + +* New: taught the `kaliop:migration:status` command to sort migrations by execution date using `--sort-by` (issue #224) + * New: taught the SQL migration step, when specified in yaml format, to resolve references embedded in the sql statement (issue #199), eg: @@ -9,7 +13,7 @@ Version 5.13.0 resolve_references: true mysql: "UPDATE emp SET job='sailor' WHERE ename='[reference:example_reference]'" -* New migration step: `sql/query`, which can be used to run SELECT queries on the database. +* New migration step: `sql/query`, which can be used to run SELECT queries on the database (issue #199). Unlike the existing `sql/exec` step (previously known simply as `sql`), this step allows to set reference values with the selected data. Ex: @@ -39,17 +43,6 @@ Version 5.13.0 action takes place. Up until now, for `update` steps, only a subset of the validation was enforced before the action, and the rest was validated afterwards -* New: taught the `kaliop:migration:status` command to sort migrations by execution date using `--sort-by` (issue #224) - -* New: taught the test-execution command `teststack.sh` two new actions: `console` and `dbconsole`, as well as a few new - options: `-r runtests`, `cleanup ez-cache` and `cleanup ez-logs` - -* Improved: a single value for a content field of type ezcountry can be specified as a string instead of an array (issue #190) - -* Improved: made console command `kaliop:migration:migrate` survive the case of migrations registered in the database - as 'to do' but without a definition file on disk anymore - a warning message is echoed before other migrations are run - in this case - * Improved: using the `not` element in matching clauses would not work for most types of steps, when the element not-to-be-matched was not present in the repository. Notable exceptions being Content and Locations matches. This case now works. @@ -62,16 +55,36 @@ Version 5.13.0 not: identifier: philosophers_stone +* New: most load/update/delete steps support the optional `match_tolerate_misses` element (issue #235). + When setting it to true, the migration will not abort if there are no items in the repository matching the specified + conditions. + Example of a migration that would previously always fail: update non-existing content type 'philosophers_stone' + + - + type: content_type + mode: update + match: + identifier: philosophers_stone + # make this step successful in case we have not found the stone yet... + match_tolerate_misses: true + +* BC change: when matching users by email in steps `user/update`, `user/delete`, `user/load` the migration will now + be halted if there is no matching user found. This can be worked around by usage of `match_tolerate_misses: true` + +* Improved: made console command `kaliop:migration:migrate` survive the case of migrations registered in the database + as 'to do' but without a definition file on disk anymore - a warning message is echoed before other migrations are run + in this case + * Fixed: setting references using jmespath syntax in migration steps `migration_definition/generate` +* New: taught the test-execution command `teststack.sh` two new actions: `console` and `dbconsole`, as well as a few new + options: `-r runtests`, `cleanup ez-cache` and `cleanup ez-logs` + * Fixed: regressions when running the test-execution command `teststack.sh` with the `-u` option or `resetdb` action * BC change: some options for the test-execution command `teststack.sh` have been renamed, see `teststack.sh -h` for the new list -* BC change: when matching users by email in steps `user/update`, `user/delete`, `user/load` the migration will now - be halted if there is no matching user found - * BC change: the `references_type` and `references_allow_empty` step elements have been replaced by a new element: `expect`. The `references_type` and `references_allow_empty` step elements are still handled correctly, but considered deprecated; equivalence matrix: