Skip to content

[DX-2277],Prevent marketplace apps recreation by default #1869

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

Draft
wants to merge 10 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,8 @@ fileignoreconfig:
checksum: e345a745f027c76081df71e4fe9872c1f4adac076689b036e195b84041807b59
- filename: packages/contentstack-launch/src/util/create-git-meta.ts
checksum: 8cbd32dbbd2989c7c082f8a0b7615916125d211bce25531e9a882b8ebd5674af
- filename: package-lock.json
checksum: 69c8b74543f9734af3c6253917c69db95aa5cb86a394a811cf0035b1f381cc41
- filename: pnpm-lock.yaml
checksum: 172a6756c4e5e39b64a29085ab95ab03645641495da0464df52cc4769d9d4c44
version: ""
15 changes: 6 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.14.0 darwin-arm64 node-v22.14.0
@contentstack/cli-cm-clone/1.14.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.14.0",
"version": "1.14.1",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.16.0",
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.21.1 darwin-arm64 node-v23.6.0
@contentstack/cli-cm-import/1.22.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.21.1",
"version": "1.22.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
12 changes: 8 additions & 4 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default class ImportCommand extends Command {
module: flags.string({
required: false,
char: 'm',
description: '[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
description:
'[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'backup-dir': flags.string({
Expand All @@ -80,11 +81,13 @@ export default class ImportCommand extends Command {
}),
branch: flags.string({
char: 'B',
description: 'The name of the branch where you want to import your content. If you don\'t mention the branch name, then by default the content will be imported to the main branch.',
description:
"The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
parse: printFlagDeprecation(['-B'], ['--branch']),
}),
'import-webhook-status': flags.string({
description: '[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
description:
'[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
options: ['disable', 'current'],
required: false,
default: 'disable',
Expand All @@ -96,6 +99,7 @@ export default class ImportCommand extends Command {
}),
'skip-app-recreation': flags.boolean({
description: '(optional) Skips the recreation of private apps if they already exist.',
parse: printFlagDeprecation(['--skip-app-recreation']),
}),
'replace-existing': flags.boolean({
required: false,
Expand Down Expand Up @@ -156,7 +160,7 @@ export default class ImportCommand extends Command {
.branch()
.query()
.find()
.then(({ items }: any) => items)
.then(({ items }: any) => items);
if (branches.length) {
flags.branch = 'main';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default class ImportMarketplaceApps {
if (canCreatePrivateApp) {
log(this.importConfig, 'Starting developer hub private apps re-creation', 'success');
for (let app of privateApps) {
if (this.importConfig.skipPrivateAppRecreationIfExist && (await this.isPrivateAppExistInDeveloperHub(app))) {
if (await this.isPrivateAppExistInDeveloperHub(app)) {
// NOTE Found app already exist in the same org
this.appUidMapping[app.uid] = app.uid;
cliux.print(`App '${app.manifest.name}' already exist. skipping app recreation.!`, { color: 'yellow' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config = merge.recursive(config, externalConfig);
}

config.contentDir = sanitizePath(importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()));
config.contentDir = sanitizePath(
importCmdFlags['data'] || importCmdFlags['data-dir'] || config.data || (await askContentDir()),
);
const pattern = /[*$%#<>{}!&?]/g;
if (pattern.test(config.contentDir)) {
cliux.print(`\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
Expand Down Expand Up @@ -75,7 +77,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config.skipAudit = importCmdFlags['skip-audit'];
config.forceStopMarketplaceAppsPrompt = importCmdFlags.yes;
config.importWebhookStatus = importCmdFlags['import-webhook-status'];
config.skipPrivateAppRecreationIfExist = importCmdFlags['skip-app-recreation'];
config.skipPrivateAppRecreationIfExist = !importCmdFlags['skip-app-recreation'];

if (importCmdFlags['branch']) {
config.branchName = importCmdFlags['branch'];
Expand All @@ -89,7 +91,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
if (importCmdFlags['backup-dir']) {
config.useBackedupDir = importCmdFlags['backup-dir'];
}

if (importCmdFlags['skip-assets-publish']) {
config.skipAssetsPublish = importCmdFlags['skip-assets-publish'];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.11.0",
"version": "1.11.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-utilities": "~1.11.0",
"@contentstack/management": "~1.20.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli/1.40.0 darwin-arm64 node-v23.6.0
@contentstack/cli/1.40.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@contentstack/cli-cm-clone": "~1.14.0",
"@contentstack/cli-cm-export": "~1.16.0",
"@contentstack/cli-cm-export-to-csv": "~1.8.0",
"@contentstack/cli-cm-import": "~1.21.1",
"@contentstack/cli-cm-import": "~1.22.0",
"@contentstack/cli-cm-import-setup": "1.2.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.0",
"@contentstack/cli-cm-seed": "~1.11.0",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.