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 generate_release command to new tool #543

Merged

Conversation

danielpgross
Copy link
Collaborator

@danielpgross danielpgross commented Jan 29, 2025

TL;DR

Migrated generate_release command from old tool version. It takes ~40s to run for all locales on my machine.

What changed?

  • Added a new GenerateReleaseCommand that orchestrates the release process
  • Introduced a new CLI command release with options for version and locales
  • Enhanced error handling in the base Command class
  • Added helper methods for version file path and locale detection
  • Updated the distribution generation to use consistent version file paths

How to test?

  1. Run product_taxonomy release --version=YYYY-MM
  2. Verify that:
    • Distribution files are generated
    • Documentation is updated
    • VERSION file contains the new version
    • Git tag is created
    • README badge is updated with the new version
  3. Run with --locales=all to test multi-locale generation

Sample command output:

❯ bin/product_taxonomy release --version=2025-01 --locales=all
Generating release for version: 2025-01
Generating distribution files...
Version: 2025-01
Locales: bg-BG, cs, da, de, el, en, es, fi, fr, hr-HR, hu, id-ID, it, ja, ko, lt-LT, nb, nl, pl, pt-BR, pt-PT, ro-RO, ru, sk-SK, sl-SI, sv, th, tr, vi, zh-CN, zh-TW
Validating localizations
Generating files for bg-BG
Generating files for cs
Generating files for da
Generating files for de
Generating files for el
Generating files for en
Generating files for es
Generating files for fi
Generating files for fr
Generating files for hr-HR
Generating files for hu
Generating files for id-ID
Generating files for it
Generating files for ja
Generating files for ko
Generating files for lt-LT
Generating files for nb
Generating files for nl
Generating files for pl
Generating files for pt-BR
Generating files for pt-PT
Generating files for ro-RO
Generating files for ru
Generating files for sk-SK
Generating files for sl-SI
Generating files for sv
Generating files for th
Generating files for tr
Generating files for vi
Generating files for zh-CN
Generating files for zh-TW
Generating integration mappings for google/2021-09-21
Generating integration mappings for shopify/2022-02
Generating integration mappings for shopify/2024-07
Generating integration mappings for shopify/2024-10
Generating documentation files...
Version: 2025-01
Generating sibling groups...
Generating category search index...
Generating attributes...
Generating mappings...
Generating attributes with categories...
Generating attribute with categories search index...
Generating release folder...
Generating index.html...
Generating attributes.html...
Updating VERSION file...
Creating git tag...
Updating README.md...
Completed in 38.7 seconds

Copy link
Collaborator Author

danielpgross commented Jan 29, 2025

@danielpgross danielpgross force-pushed the 01-29-migrate_generate_release_command_to_new_tool branch from 3b0c9b1 to 6334f1a Compare January 29, 2025 16:26
@danielpgross danielpgross marked this pull request as ready for review January 29, 2025 16:31
Comment on lines +63 to +67
def version_file_path
File.expand_path("../VERSION", ProductTaxonomy.data_path)
end

def locales_defined_in_data_path
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these be instance var cached given they're doing file io?

@danielpgross danielpgross changed the base branch from 01-28-add_validation_to_localized_and_localizationsvalidator_ to graphite-base/543 January 29, 2025 22:47
@danielpgross danielpgross force-pushed the 01-29-migrate_generate_release_command_to_new_tool branch from 6334f1a to 7469224 Compare January 29, 2025 22:48
@danielpgross danielpgross changed the base branch from graphite-base/543 to main January 29, 2025 22:49
@danielpgross danielpgross force-pushed the 01-29-migrate_generate_release_command_to_new_tool branch from 7469224 to efa01d4 Compare January 29, 2025 22:49
@danielpgross danielpgross merged commit 5756ade into main Jan 29, 2025
6 checks passed
Copy link
Collaborator Author

Merge activity

  • Jan 29, 5:54 PM EST: A user merged this pull request with Graphite.

@danielpgross danielpgross deleted the 01-29-migrate_generate_release_command_to_new_tool branch January 29, 2025 22:54
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