Uh oh!
There was an error while loading. Please reload this page.
feat(import): publish taxonomies after import - #124
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Uh oh!
There was an error while loading. Please reload this page.
Summary
This change extends stack import so the taxonomies module not only imports taxonomy JSON via the existing
import-taxonomyflow, but also publishes taxonomies when export data includespublish_detailsand the destination stack has a usable environment UID mapping. Publishing is integrated as a nested progress step (same UX pattern as entries publish), uses Management SDKtaxonomy().publishat API version3.2, and respects branch whenbranchNameis configured.Motivation
Exports can carry taxonomy publish intent (
publish_details). Previously import recreated taxonomies/terms but did not replay publish to target environments. Aligning import with that metadata reduces manual republishing after migration.User-visible behavior
Analyze
publish_details,locale, and at least one environment UID that maps throughuid-mapping.json).Import phase
import-taxonomy.Publish phase (only if
publishJobCount > 0)When publish is skipped
publish_details/locale, or mapper empty / missing: no publish phase (or jobs filtered out); optional warn when mapper is empty so operators know to import environments first.Technical design
backupDir/mapper/environments/uid-mapping.json: source stack env UID → destination stack env UID.publish_details,locale, and for analyze count at least one mapped env; jobs collected deduped by taxonomy UID.environments: destination UIDs;locales:[String(taxonomy.locale)];items:[{ uid: taxonomy.uid }].publish-taxonomiesinmakeAPICall:(stack as any).taxonomy().publish(apiData, '3.2', publishParams)withpublishParams = { branch }whenimportConfig.branchNameis set.environments,locales, oritems(after serialization).PROCESS_NAMES.TAXONOMIES_PUBLISH+PROCESS_STATUSmessages;initializeTaxonomiesProgressregisters import + optional publish totals.Files touched (typical)
cli-plugins/packages/contentstack-import/src/import/modules/taxonomies.ts— orchestration, mapper read, job build,serializePublishTaxonomies, section comments / JSDoc cleanup.cli-plugins/packages/contentstack-import/src/import/modules/base-class.ts—ApiModuleType, guard,publish-taxonomiescase.cli-plugins/packages/contentstack-import/src/utils/constants.ts—TAXONOMIES_PUBLISH+ status strings.cli-plugins/packages/contentstack-import/test/unit/import/modules/taxonomies.test.ts— publish serialization and nested progress behavior as applicable.cli-plugins/packages/contentstack-import/test/unit/import/modules/base-class.test.ts— publish branch / version / empty payload behavior.Test plan
pnpm exec mocha … taxonomies.test.ts(or package test script)base-classunit tests forpublish-taxonomiespublish_details; confirm published state in destination environments