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
This PR adds a --skip-taxonomy-publish flag to the cm:stacks:import command, following the same pattern as the existing --skip-entries-publish and --skip-assets-publish flags.
Why default: true?
Unlike entries and assets where publishing happens by default, taxonomy publishing defaults to skipped because the taxonomy publish feature is not yet released on the platform. This ensures existing import workflows are not broken and no unexpected publish API calls are made. Once the feature is released, the default can be flipped to false.
Changes
src/commands/cm/stacks/import.ts
Added --skip-taxonomy-publish boolean flag with default: true and a description.
src/types/import-config.ts
Added skipTaxonomyPublish?: boolean to the ImportConfig interface (optional, consistent with skipEntriesPublish and skipAssetsPublish).
src/types/default-config.ts
Added skipTaxonomyPublish?: boolean to the DefaultConfig interface.
src/config/index.ts
Added skipTaxonomyPublish: true to the hardcoded default config object. This is the safety net for programmatic usage (e.g., config loaded from file without the CLI flag).
src/utils/import-config-handler.ts
Added config.skipTaxonomyPublish = importCmdFlags['skip-taxonomy-publish'] ?? true to always assign the flag value into config. Uses ?? true (not a conditional if).
src/import/modules/taxonomies.ts
Gated the taxonomy publish flow behind skipTaxonomyPublish === false in three places:
start() — the publish progress block and processTaxonomyPublishing() call.
initializeTaxonomiesProgress() — skips adding the TAXONOMIES_PUBLISH process to the progress manager.
Uses explicit === false check (not !flag) so that undefined safely defaults to skip, not publish.
test/unit/import/modules/locales.test.ts
Added skipTaxonomyPublish: true to the mockConfig object literal (required because the variable is strictly typed as ImportConfig without an as cast).
test/unit/utils/import-config-handler.test.ts
Added two new test cases:
should set skipTaxonomyPublish to true by default — verifies the ?? true fallback.
should allow skipTaxonomyPublish to be overridden to false — verifies that passing 'skip-taxonomy-publish': false propagates correctly.
Behavior
Scenario
skipTaxonomyPublish value
Result
User does not pass flag
true (default)
Taxonomy publishing skipped
User passes --skip-taxonomy-publish
true
Taxonomy publishing skipped
Config loaded from file (no CLI)
true (from config/index.ts)
Taxonomy publishing skipped
Notes
No changes to the taxonomy publish API implementation in base-class.ts — the publish-taxonomies switch case, the TAXONOMIES_PUBLISH process constants, and the processTaxonomyPublishing() method were already scaffolded.
The flag follows the same naming convention as --skip-entries-publish and --skip-assets-publish.
When the taxonomy publish feature is released, the default on the CLI flag and the hardcoded value in config/index.ts should both be changed to false.
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
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.
Summary
This PR adds a
--skip-taxonomy-publishflag to thecm:stacks:importcommand, following the same pattern as the existing--skip-entries-publishand--skip-assets-publishflags.Why
default: true?Unlike entries and assets where publishing happens by default, taxonomy publishing defaults to skipped because the taxonomy publish feature is not yet released on the platform. This ensures existing import workflows are not broken and no unexpected publish API calls are made. Once the feature is released, the default can be flipped to
false.Changes
src/commands/cm/stacks/import.ts--skip-taxonomy-publishboolean flag withdefault: trueand a description.src/types/import-config.tsskipTaxonomyPublish?: booleanto theImportConfiginterface (optional, consistent withskipEntriesPublishandskipAssetsPublish).src/types/default-config.tsskipTaxonomyPublish?: booleanto theDefaultConfiginterface.src/config/index.tsskipTaxonomyPublish: trueto the hardcoded default config object. This is the safety net for programmatic usage (e.g., config loaded from file without the CLI flag).src/utils/import-config-handler.tsconfig.skipTaxonomyPublish = importCmdFlags['skip-taxonomy-publish'] ?? trueto always assign the flag value into config. Uses?? true(not a conditionalif).src/import/modules/taxonomies.tsskipTaxonomyPublish === falsein three places:start()— the publish progress block andprocessTaxonomyPublishing()call.initializeTaxonomiesProgress()— skips adding theTAXONOMIES_PUBLISHprocess to the progress manager.analyzeTaxonomies()— skips counting publish-eligible taxonomies (env mapper read +countPublishEligibleTaxonomies).=== falsecheck (not!flag) so thatundefinedsafely defaults to skip, not publish.test/unit/import/modules/locales.test.tsskipTaxonomyPublish: trueto themockConfigobject literal (required because the variable is strictly typed asImportConfigwithout anascast).test/unit/utils/import-config-handler.test.tsshould set skipTaxonomyPublish to true by default— verifies the?? truefallback.should allow skipTaxonomyPublish to be overridden to false— verifies that passing'skip-taxonomy-publish': falsepropagates correctly.Behavior
skipTaxonomyPublishvaluetrue(default)--skip-taxonomy-publishtruetrue(fromconfig/index.ts)Notes
base-class.ts— thepublish-taxonomiesswitch case, theTAXONOMIES_PUBLISHprocess constants, and theprocessTaxonomyPublishing()method were already scaffolded.--skip-entries-publishand--skip-assets-publish.defaulton the CLI flag and the hardcoded value inconfig/index.tsshould both be changed tofalse.