Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cb7dcc1
feat: added rate limit support in entries & assets bulk publish
aman19K Aug 30, 2024
eff430e
formatting
aman19K Aug 30, 2024
a82ea75
Merge pull request #1535 from contentstack/feat/DX-1238-bulk-publish-…
aman19K Aug 30, 2024
d080f64
implementation get and remove rate limit commands
harshithad0703 Sep 3, 2024
870c6fe
resolved the conversations, updated structure of rate limit, removed …
harshithad0703 Sep 4, 2024
db2bdac
removed authentication for remove command
harshithad0703 Sep 4, 2024
106c115
removed isAuthenticated from import
harshithad0703 Sep 4, 2024
01a4e13
handle delete directly with config handler
harshithad0703 Sep 4, 2024
c52b22e
formated get limit, removed message handler
harshithad0703 Sep 4, 2024
1b2cd56
Merge pull request #1543 from contentstack/feat/dx-1201-get-rate-limit
harshithad0703 Sep 4, 2024
f2384ce
added set rate limit command
harshithad0703 Sep 2, 2024
56b9cc9
Merge branch 'feat/config-rate-limit' into feat/DX-1112-rate-limit-se…
harshithad0703 Sep 4, 2024
58eab0c
_flags -> flag, remove console log, limit-name is optional, file rename
harshithad0703 Sep 4, 2024
e615e30
updates the limit name fetched from org plan
harshithad0703 Sep 6, 2024
e083e9b
remove console.log
harshithad0703 Sep 6, 2024
e60ce66
update the limits passed through limit-name flag
harshithad0703 Sep 6, 2024
c312864
added common utilities and other minor changes
harshithad0703 Sep 6, 2024
b9b0ff3
added check for limit names, utilize values and comma separated value…
harshithad0703 Sep 9, 2024
3872fc3
feat: set default rate limit using hook
aman19K Sep 9, 2024
83da4e5
formatting
aman19K Sep 9, 2024
335df23
Merge pull request #1551 from contentstack/feat/DX-1348
aman19K Sep 9, 2024
3b1cc14
refactored code
harshithad0703 Sep 9, 2024
74072a0
Merge pull request #1544 from contentstack/feat/DX-1112-rate-limit-se…
harshithad0703 Sep 10, 2024
e3810b2
Merge branch 'feat/config-rate-limit' into feat/bulk-publish-rate-limit
aman19K Sep 10, 2024
ce3eee1
Merge pull request #1553 from contentstack/feat/bulk-publish-rate-limit
aman19K Sep 10, 2024
5756494
Merge branch 'development' into feat/config-rate-limit
harshithad0703 Sep 12, 2024
5d96b83
added test cases for set rate limit command
harshithad0703 Sep 11, 2024
31e0f8e
added get and remove rate limit command test cases and updated set co…
harshithad0703 Sep 11, 2024
5d09a81
setup repo
harshithad0703 Sep 12, 2024
4071f25
added clius succes message after handling rate limit
harshithad0703 Sep 12, 2024
0512ee4
improved coverage and updated readme
harshithad0703 Sep 13, 2024
486b743
Merge pull request #1565 from contentstack/test/dx-1203-test-cases-ra…
harshithad0703 Sep 13, 2024
802547d
passing host in config and get limit value from org
harshithad0703 Sep 19, 2024
f82132e
Merge pull request #1571 from contentstack/fix/dx-1472-set-rate-limit…
harshithad0703 Sep 19, 2024
5ea5fb6
added abbreviation for config rate limits
harshithad0703 Sep 20, 2024
aa33566
Merge pull request #1574 from contentstack/feat/dx-1444-abbreviation-…
harshithad0703 Sep 20, 2024
6feb2be
Merge branch 'development' into fix/merge-conflicts
harshithad0703 Sep 20, 2024
8e50604
Merge pull request #1577 from contentstack/fix/merge-conflicts
harshithad0703 Sep 20, 2024
8ab0c4b
fix: update rate limits accordingly
harshithad0703 Oct 4, 2024
5c8c6d0
Merge pull request #1605 from contentstack/fix/dx-1540-set-limits-acc…
harshithad0703 Oct 4, 2024
0ad1796
version bump
harshithad0703 Oct 8, 2024
fc65108
Merge pull request #1608 from contentstack/fix/rate-limit-version-nump
harshithad0703 Oct 8, 2024
0496641
Merge remote-tracking branch 'origin/development' into fix/rate-limit…
harshithad0703 Oct 8, 2024
ca9ecb9
update pnpm lock
harshithad0703 Oct 8, 2024
fe34c46
Merge pull request #1610 from contentstack/fix/rate-limit-merge-confl…
harshithad0703 Oct 9, 2024
78e5b91
fixed the failing check
harshithad0703 Oct 9, 2024
6c300a6
Merge branch 'development' into fix/merge-conflict-rate-limit
harshithad0703 Oct 9, 2024
826df4a
updated pnpm and package-lock
harshithad0703 Oct 9, 2024
71fb918
Merge pull request #1614 from contentstack/fix/merge-conflict-rate-limit
harshithad0703 Oct 9, 2024
8d3927a
Merge branch 'development' into feat/config-rate-limit
harshithad0703 Oct 9, 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
125 changes: 72 additions & 53 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-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@contentstack/cli-auth": "~1.3.22",
"@contentstack/cli-config": "~1.7.3",
"@contentstack/cli-config": "~1.8.0",
"@contentstack/cli-dev-dependencies": "~1.2.4",
"@oclif/plugin-help": "^5.1.19",
"@oclif/test": "^2.5.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bulk-publish/1.4.9 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-bulk-publish/1.5.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bulk-publish",
"description": "Contentstack CLI plugin for bulk publish actions",
"version": "1.4.9",
"version": "1.5.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { performBulkPublish, publishAsset, initializeLogger } = require('../consu
const retryFailedLogs = require('../util/retryfailed');
const { validateFile } = require('../util/fs');
const { isEmpty } = require('../util');
const { fetchBulkPublishLimit } = require('../util/common-utility');

const queue = getQueue();
let logFileName;
Expand All @@ -14,7 +15,7 @@ let filePath;

/* eslint-disable no-param-reassign */

async function getAssets(stack, folder, bulkPublish, environments, locale, apiVersion, skip = 0) {
async function getAssets(stack, folder, bulkPublish, environments, locale, apiVersion, bulkPublishLimit, skip = 0) {
return new Promise((resolve, reject) => {
let queryParams = {
folder: folder,
Expand All @@ -33,18 +34,27 @@ async function getAssets(stack, folder, bulkPublish, environments, locale, apiVe
let assets = assetResponse.items;
for (let index = 0; index < assetResponse.items.length; index++) {
if (assets[index].is_dir === true) {
await getAssets(stack, assets[index].uid, bulkPublish, environments, locale, apiVersion, 0);
await getAssets(
stack,
assets[index].uid,
bulkPublish,
environments,
locale,
apiVersion,
bulkPublishLimit,
0,
);
continue;
}
if (bulkPublish) {
if (bulkPublishSet.length < 10) {
if (bulkPublishSet.length < bulkPublishLimit) {
bulkPublishSet.push({
uid: assets[index].uid,
locale,
publish_details: assets[index].publish_details || [],
});
}
if (bulkPublishSet.length === 10) {
if (bulkPublishSet.length === bulkPublishLimit) {
await queue.Enqueue({
assets: bulkPublishSet,
Type: 'asset',
Expand All @@ -56,7 +66,11 @@ async function getAssets(stack, folder, bulkPublish, environments, locale, apiVe
bulkPublishSet = [];
}

if (assetResponse.items.length - 1 === index && bulkPublishSet.length > 0 && bulkPublishSet.length < 10) {
if (
assetResponse.items.length - 1 === index &&
bulkPublishSet.length > 0 &&
bulkPublishSet.length < bulkPublishLimit
) {
await queue.Enqueue({
assets: bulkPublishSet,
Type: 'asset',
Expand All @@ -81,7 +95,7 @@ async function getAssets(stack, folder, bulkPublish, environments, locale, apiVe
if (skip === assetResponse.count) {
return resolve(true);
}
await getAssets(stack, folder, bulkPublish, environments, locale, apiVersion, skip);
await getAssets(stack, folder, bulkPublish, environments, locale, apiVersion, bulkPublishLimit, skip);
return resolve();
} else {
resolve();
Expand Down Expand Up @@ -133,8 +147,9 @@ async function start({ retryFailed, bulkPublish, environments, folderUid, locale
}
} else if (folderUid) {
setConfig(config, bulkPublish);
const bulkPublishLimit = fetchBulkPublishLimit(stack?.org_uid);
for (const element of locales) {
await getAssets(stack, folderUid, bulkPublish, environments, element, apiVersion);
await getAssets(stack, folderUid, bulkPublish, environments, element, apiVersion, bulkPublishLimit);
}
}
}
Expand Down
Loading