feat(cli): add datasync:options-container + datasync:resync-stale recovery commands - #6
Merged
Merged
Conversation
added 3 commits
May 26, 2026 13:01
…overy commands datasync:options-container restores the options_container attribute on the destination from the source by SKU. Pairs with #4 — once PR #5 lands, this is the one-shot recovery for installs already affected. datasync:resync-stale is a discovery-only catch-up tool for the gap in #1. Compares destination vs source catalog_product_entity.updated_at per SKU and reports stale products with per-product status + image-count diff. Sync wiring deliberately deferred pending the live-side reconciler proposed in #1. Both follow the existing DatasyncStock pattern (connectToLive via .env.local, dry-run flag, batched destination writes).
…un read
- Adds the apply path (was previously discovery-only): reuses
datasync/adapter_openmage + datasync/engine with on_duplicate=merge and an
entity_ids filter, batched in configurable chunks (--batch-size, default 50).
Same engine path as datasync:incremental, just bypassing the live tracker.
- Fixes a real bug introduced in the previous version: $dryRun was referenced
but never assigned from $input->getOption('dry-run'), so APPLY mode always
ran regardless of the flag. Now correctly defaults to dry-run preview unless
--dry-run is omitted.
Safe to pair with PR #5 (value-level merge) — re-syncing a stale product no
longer churns option_type_ids, so the dependent-options config restored by the
companion CLI in maho-module-dependentoptions stays valid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two recovery / diagnostic CLI commands. Both follow the existing
DatasyncStockpattern (connectToLive()via.env.local, dry-run flag, batched destination writes).datasync:options-containerRestores the
options_containerattribute on the destination from the source by SKU — pairs with #4. Once PR #5 (the empty-overwrite guard) lands, this is the one-shot recovery for installs already affected.options_container--overwrite)updateAttributescalls--dry-runreports counts per value before any writedatasync:resync-staleDiscovery-only catch-up tool for the gap described in #1. Compares destination vs source
catalog_product_entity.updated_atper SKU and reports products where source is newer than destination by more than--thresholddays.datasync_entity_registryBoth safe to drop into a maho-datasync install; no schema or core changes.