Skip to content
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

Migrate dump_attributes command to new tool #566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielpgross
Copy link
Collaborator

@danielpgross danielpgross commented Feb 21, 2025

TL;DR

Migrated command to dump attributes to YAML from deprecated tool version to new one.

What changed?

  • Added new dump_attributes CLI command
  • Migrated DumpAttributesCommand
  • Implemented DataSerializer for attributes that handles both base and extended attributes
  • Base attributes are sorted by ID, while extended attributes maintain their addition order

How to test?

Run the CLI command: bin/product_taxonomy dump_attributes

Sample output:

❯ bin/product_taxonomy dump_attributes
Dumping attributes...
Updated `/Users/danielgross/product-taxonomy/data/attributes.yml`
Completed in 1.07 seconds

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@danielpgross danielpgross marked this pull request as ready for review February 21, 2025 22:01
Comment on lines +11 to +12
base_attributes = ProductTaxonomy::Attribute.all.reject(&:extended?).sort_by(&:id)
extended_attributes = ProductTaxonomy::Attribute.all.select(&:extended?)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numbers are small enough that it's likely immaterial, but could use partition to save processing the list twice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants