You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform: Please specify the version of Terraform you are using. terraform_version: 1.5.7
terraform provider: Please specify the version of the provider you are using.
commercetools: 1.11.2
Describe the bug
Removing an item from an enum in a type results in an error
│ Error: The given keys must be equal to the existing enum keys.
│
│ with module.commercetools-config-sdmy.commercetools_type.delivery_manager_address,
│ on .terraform/modules/commercetools-config-sdmy/address.tf line 1, in resource "commercetools_type" "delivery_manager_address":
│ 1: resource "commercetools_type" "delivery_manager_address" {
While the plan output showed it wanting to remove the item (also note the ordering):
# module.commercetools-config-sdmy.commercetools_type.delivery_manager_address will be updated in-place
~ resource "commercetools_type" "delivery_manager_address" {
id = "46deb58a-b08a-4edc-8c86-9df51054580e"
name = {
"en" = "Custom Address with Delivery Manager attributes"
}
# (4 unchanged attributes hidden)
~ field {
name = "carrierCode"
# (3 unchanged attributes hidden)
~ type {
name = "Enum"
~ value {
~ key = "TODO" -> "DPD"
~ label = "To Do" -> "Express delivery by Dynamic Parcel Distribution"
}
~ value {
~ key = "DPD" -> "HERMESPOS"
~ label = "Express delivery by Dynamic Parcel Distribution" -> "Express delivery by Hermes"
}
~ value {
~ key = "HERMESPOS" -> "DHL"
~ label = "Express delivery by Hermes" -> "Express delivery by DHL"
}
~ value {
~ key = "DHL" -> "EVRI"
~ label = "Express delivery by DHL" -> "Express delivery by Evri"
}
~ value {
~ key = "EVRI" -> "YODEL"
~ label = "Express delivery by Evri" -> "Express delivery by Yodel"
}
- value {
- key = "YODEL" -> null
- label = "Express delivery by Yodel" -> null
}
}
}
# (2 unchanged blocks hidden)
}
To Reproduce
Steps to reproduce the behavior.
Have a commercetools type defined for address
resource "commercetools_type" "delivery_manager_address" {
key = "delivery-manager-address"
name = {
en = "Custom Address with Delivery Manager attributes"
}
resource_type_ids = ["address"]
field {
name = "carrierCode"
label = {
en = "Carrier Code"
}
type {
name = "Enum"
value {
key = "TODO"
label = "To Do"
}
value {
key = "foo"
label = "foo delivery"
}
value {
key = "bar"
label = "bar delivery"
}
}
}
then try to remove the TODO item
Expected behavior
The enum should be updated to only contain the foo and bar carrierCodes
I don't think we want to cause a replace of the whole resource when a change happens here, as that would accidentally throw away all the previously stored data. So only thing I can do is add a better error message here
Hi @demeyerthom, thanks for looking into this! I was afraid it would be a commercetools limitation, implementing cascading logic would be a big ask. We'll have to learn to live with the TODO enum value, unfortunate but not a big deal. :)
I left one comment on the PR, other than that I'm fine with closing the issue.
Version information
terraform: Please specify the version of Terraform you are using.
terraform_version: 1.5.7
terraform provider: Please specify the version of the provider you are using.
commercetools: 1.11.2
Describe the bug
Removing an item from an enum in a type results in an error
While the plan output showed it wanting to remove the item (also note the ordering):
To Reproduce
Steps to reproduce the behavior.
Have a commercetools type defined for address
then try to remove the
TODO
itemExpected behavior
The enum should be updated to only contain the
foo
andbar
carrierCodesAdditional context
https://github.com/frasers-group/ec-fx-mach-config/actions/runs/13414512251/job/37472017464 -- the failing run
https://github.com/frasers-group/ec-fx-components/pull/5599 -- the code
The text was updated successfully, but these errors were encountered: