Skip to content

Continue product migration doc (4.6) #2181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Oct 18, 2023

Question Answer
JIRA Ticket N/A
Versions 4.6
Edition Commerce
  • Add product_variant ibexa/product-catalog#1050
  • Add product_asset ibexa/product-catalog#1051
  • Re-order "Product catalog" section's sub-sections
    • Link "Product catalog" examples with each others (see below)
    • Normalize section titles (plural)
  • Fix create_attribute_group.yaml indent

Link examples with each others

On a ibexa/commerce:4.6.x-dev clean install, the following migration files can be chained in this order:

  • create_attribute_group.yaml
  • update_attribute.yaml # Always OK as criteria found nothing to work on
  • create_product_type.yaml
  • create_product_variant.yaml
  • create_customer_group.yaml
  • create_product_price.yaml
  • create_product_asset.yaml

TODO

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@adriendupuis adriendupuis mentioned this pull request Oct 19, 2023
1 task
@adriendupuis
Copy link
Contributor Author

I have script to automatically test that the examples works. This is also to test that they are working that I chained the examples by using what they create in cascade. This is while trying to add deletion migration files to be able to run the test several times on the same DB that I found out the bug with variant product codes IBX-6840.

#!/usr/bin/env zsh

DXP_DIR=~/www/ddev-ibexa-tmp
DOC_DIR=~/www/developer-documentation

set +x

cd $DXP_DIR

files=(
  create_attribute_group.yaml
  update_attribute.yaml # Always OK as criteria found nothing to work on
  create_product_type.yaml
  create_product_variant.yaml
  create_customer_group.yaml
  create_product_price.yaml
  create_product_asset.yaml

  #delete_product.yaml
  #delete_product_type.yaml
  #delete_attribute_group.yaml
)

# image file for create_product_asset.yaml
curl -o top_hat_58cm_black.jpg "https://upload.wikimedia.org/wikipedia/commons/c/c6/Museo_del_Bicentenario_-_Galera_de_Roberto_M._Ortiz.jpg"

for file in "${files[@]}"; do
  cp -v $DOC_DIR/code_samples/data_migration/examples/$file ./src/Migrations/Ibexa/migrations/
done

function join_by {
  local d=${1-} f=${2-}
  if shift 2; then
    printf %s "$f" "${@/#/$d}"
  fi
}
in="('$(join_by "', '" $files)')"
ddev mysql -v -e "DELETE FROM ibexa_migrations WHERE name IN $in;"

for file in "${files[@]}"; do
  ddev php bin/console ibexa:migrations:migrate -v --file=$file
done

@adriendupuis adriendupuis marked this pull request as ready for review October 19, 2023 13:37
@adriendupuis adriendupuis requested a review from adamwojs October 19, 2023 13:37
@adriendupuis adriendupuis changed the title Continue product migration Continue product migration doc (4.6) Oct 19, 2023
@adriendupuis adriendupuis requested a review from dabrt November 8, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants