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

CS-43464 #1241

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
eee14f5
Feat: Audit fix command integration with Import
antonyagustine Dec 22, 2023
7055073
Version bum
antonyagustine Jan 3, 2024
7443ce2
Merge branch 'development' into feat/CS-43223
antonyagustine Jan 3, 2024
b4f00fa
Import minor version bump
antonyagustine Jan 3, 2024
c9c53eb
Skip audit-fix on seed command
antonyagustine Jan 3, 2024
ce32a52
Feat: Audit fix command integration with Import
antonyagustine Jan 3, 2024
5acd500
Merge branch 'feat/CS-43223' into feat/CS-43173
antonyagustine Jan 3, 2024
61176df
Fix: Missing return statement added
antonyagustine Jan 8, 2024
4c3de39
axios version bump
cs-raj Jan 8, 2024
5223355
Log correction
antonyagustine Jan 8, 2024
8903916
removed axios from import
cs-raj Jan 8, 2024
b32032c
Merge pull request #1230 from contentstack/fix/CS-43366
cs-raj Jan 8, 2024
c85c95f
Merge branch 'development' into feat/CS-43223
antonyagustine Jan 8, 2024
8929f71
fix: create, update , create-update entry migration script
aman19K Jan 8, 2024
2763ddf
fix: logger instance
aman19K Jan 8, 2024
97f39de
Merge branch 'development' into fix/CS-43247
aman19K Jan 8, 2024
4ff4518
UI text corrections
antonyagustine Jan 8, 2024
dc1dddb
Merge branch 'feat/CS-43223' of https://github.com/contentstack/cli i…
antonyagustine Jan 8, 2024
0a273ad
Merge branch 'feat/CS-43223' into feat/CS-43173
antonyagustine Jan 8, 2024
505254a
Merge pull request #1228 from contentstack/feat/CS-43173
antonyagustine Jan 9, 2024
c227748
Merge pull request #1227 from contentstack/feat/CS-43223
antonyagustine Jan 9, 2024
8c5a08f
fix: update entry migration doc url
aman19K Jan 9, 2024
d5f874a
version bump
aman19K Jan 9, 2024
dfb7480
Merge branch 'development' into fix/CS-43247
aman19K Jan 9, 2024
7afd151
fix: windows command path
aman19K Jan 9, 2024
f29b61f
Merge pull request #1231 from contentstack/fix/CS-43247
aman19K Jan 9, 2024
c96af3b
Merge pull request #1232 from contentstack/development
aman19K Jan 9, 2024
941166c
early access header ui text updates
shafeeqd959 Jan 9, 2024
193d341
Merge pull request #1236 from contentstack/fix/CS-43316
shafeeqd959 Jan 9, 2024
8f2954f
update license
aman19K Jan 9, 2024
3bb5e34
Merge pull request #1237 from contentstack/refactor/license
aman19K Jan 9, 2024
e941cb9
UI text change
antonyagustine Jan 11, 2024
d906b23
UI text change
antonyagustine Jan 11, 2024
f02e024
Merge pull request #1240 from contentstack/refactor/ui-text-change
antonyagustine Jan 11, 2024
b306d3a
added the env name for which we want to keep the env file creation op…
cs-raj Jan 11, 2024
471dd30
Merge branch 'development' into fix/CS-43464
cs-raj Jan 11, 2024
12bf880
fix: updated license & readme file
aman19K Jan 11, 2024
7de94e2
Merge pull request #1242 from contentstack/fix/sre-issues
aman19K Jan 11, 2024
983449d
Merge pull request #1234 from contentstack/staging
aman19K Jan 12, 2024
044d062
fix: publish audit before import plugin
aman19K Jan 12, 2024
4445913
Merge pull request #1243 from contentstack/fix/audit-publish-dependency
aman19K Jan 12, 2024
e87f8aa
Merge pull request #1244 from contentstack/main
aman19K Jan 12, 2024
562bded
Merge branch 'staging' into stag-to-dev
aman19K Jan 12, 2024
7baf7e4
Merge pull request #1246 from contentstack/stag-to-dev
aman19K Jan 12, 2024
ffd599d
updated Ui text
cs-raj Jan 16, 2024
420f951
Merge branch 'development' into fix/CS-43464
cs-raj Jan 16, 2024
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
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ jobs:
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-export/package.json
- name: Installing dependencies of audit
id: audit-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_audit == 'true'}}
working-directory: ./packages/contentstack-audit
run: npm install
- name: Compiling audit
if: ${{ steps.audit-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-audit
run: npm run prepack
- name: Publishing audit
uses: JS-DevTools/[email protected]
if: ${{ steps.audit-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-audit/package.json
access: public
- name: Installing dependencies of import
id: import-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_import == 'true'}}
Expand Down Expand Up @@ -249,22 +265,6 @@ jobs:
if: ${{env.release_releaseAll == 'true' || env.release_plugins_core == 'true'}}
working-directory: ./packages/contentstack
run: npm install
- name: Installing dependencies of audit
id: audit-installation
if: ${{env.release_releaseAll == 'true' || env.release_plugins_audit == 'true'}}
working-directory: ./packages/contentstack-audit
run: npm install
- name: Compiling audit
if: ${{ steps.audit-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack-audit
run: npm run prepack
- name: Publishing audit
uses: JS-DevTools/[email protected]
if: ${{ steps.audit-installation.conclusion == 'success' }}
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-audit/package.json
access: public
- name: Compiling core
if: ${{ steps.core-installation.conclusion == 'success' }}
working-directory: ./packages/contentstack
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Contentstack
Copyright (c) 2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $ csdx --help
```

## Namespaces
**auth**: To perform [authentication-related](/packages/auth) activities
**auth**: To perform [authentication-related](/packages/contentstack-auth) activities

**cm**: To perform content management activities such as [bulk publish](/packages/contentstack-bulk-publish), [import](/packages/contentstack-import), and [export](/packages/contentstack-export), [export-to-csv] (/packages/contentstack-export-to-csv), [seed] (/packages/contentstack-seed)

Expand Down
40 changes: 20 additions & 20 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-audit/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Contentstack
Copyright (c) 2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion packages/contentstack-audit/src/audit-base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
* @param {string} command - The `command` parameter is a string that represents the current command
* being executed.
*/
async start(command: CommandNames): Promise<void> {
async start(command: CommandNames): Promise<boolean> {
this.currentCommand = command;
await this.promptQueue();
await this.createBackUp();
Expand Down Expand Up @@ -69,6 +69,8 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
rmSync(this.sharedConfig.basePath, { recursive: true });
}
}

return !isEmpty(missingCtRefs) || !isEmpty(missingGfRefs) || !isEmpty(missingEntryRefs);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/contentstack-audit/src/base-command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import merge from 'lodash/merge';
import isEmpty from 'lodash/isEmpty';
import { existsSync, readFileSync } from 'fs';
import { Command } from '@contentstack/cli-command';
import { Flags, FlagInput, Interfaces, cliux, ux, PrintOptions } from '@contentstack/cli-utilities';
Expand Down Expand Up @@ -57,7 +58,7 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {

this.sharedConfig = Object.assign(this.sharedConfig, { flags: this.flags });

if (this.flags['external-config']?.config) {
if (!isEmpty(this.flags['external-config']?.config)) {
this.sharedConfig = Object.assign(this.sharedConfig, this.flags['external-config']?.config);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export default class AuditFix extends AuditBaseCommand {
* The `run` function is an asynchronous function that performs an audit on different modules
* (content-types, global-fields, entries) and generates a report.
*/
async run(): Promise<void | ConfigType> {
async run(): Promise<void | { config: ConfigType; hasFix: boolean }> {
try {
await this.start('cm:stacks:audit:fix');
const hasFix = await this.start('cm:stacks:audit:fix');

if (this.flags['external-config']?.returnConfig) {
return this.sharedConfig;
if (this.flags['external-config']?.returnResponse) {
return { config: this.sharedConfig, hasFix };
}
} catch (error) {
this.log(error instanceof Error ? error.message : error, 'error');
Expand Down
5 changes: 4 additions & 1 deletion packages/contentstack-audit/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export default {};
import Audit from "./commands/cm/stacks/audit";
import AuditFix from "./commands/cm/stacks/audit/fix";

export { Audit, AuditFix };
2 changes: 1 addition & 1 deletion packages/contentstack-audit/src/modules/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class ContentType {
let canWrite = true;

if (!this.inMemoryFix && this.fix) {
if (!this.config.flags['copy-dir']) {
if (!this.config.flags['copy-dir'] && !this.config.flags['external-config']?.skipConfirm) {
canWrite = this.config.flags.yes ?? (await ux.confirm(commonMsg.FIX_CONFIRMATION));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-audit/src/modules/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default class Entries {
let canWrite = true;

if (this.fix) {
if (!this.config.flags['copy-dir']) {
if (!this.config.flags['copy-dir'] && !this.config.flags['external-config']?.skipConfirm) {
canWrite = this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Contentstack
Copyright (c) 2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Contentstack
Copyright (c) 2024 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/src/bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class Bootstrap {

if (this.options.livePreviewEnabled) {
cliux.print(
'Important: set management token and app host in the environment file before running the application',
'Note: Before running the app, please configure a preview token, preview host, and app host in the environment file',
{
color: 'yellow',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function continueBootstrapCommand() {
const { shouldContinue } = await inquirer.prompt({
type: 'list',
name: 'shouldContinue',
message: `Do you still want to complete the bootstrap command with Live Preview Disabled?`,
message: `To continue with the Bootstrap command without Live Preview, please select Yes.`,
choices: ['yes', 'no'],
loop: false,
});
Expand Down
Loading