From 972a2150871ca90ffbc73642071b35eda350a107 Mon Sep 17 00:00:00 2001 From: MAVRICK-1 Date: Fri, 27 Dec 2024 16:41:40 +0530 Subject: [PATCH 1/4] Enhancement: Add progress tracking to DirToUSSDirHandler for file uploads Signed-off-by: MAVRICK-1 --- .../zosfiles/upload/dtu/DirToUSSDir.handler.ts | 17 ++++++++++++----- packages/imperative/CHANGELOG.md | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts index f5c406ac37..2f37a11abf 100644 --- a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts +++ b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts @@ -54,12 +54,19 @@ export default class DirToUSSDirHandler extends ZosFilesBaseHandler { uploadOptions.filesMap = this.buildFilesMap(commandParameters); } - const uploadApi = commandParameters.arguments.recursive ? Upload.dirToUSSDirRecursive : Upload.dirToUSSDir; - const response = await uploadApi.bind(Upload)(session, inputDir, commandParameters.arguments.USSDir, uploadOptions); + commandParameters.response.progress.startBar("Uploading files..."); - const formatMessage = TextUtils.prettyJson(response.apiResponse); - commandParameters.response.console.log(formatMessage); - return response; + try { + const uploadApi = commandParameters.arguments.recursive ? Upload.dirToUSSDirRecursive : Upload.dirToUSSDir; + const response = await uploadApi.bind(Upload)(session, inputDir, commandParameters.arguments.USSDir, uploadOptions); + + const formatMessage = TextUtils.prettyJson(response.apiResponse); + commandParameters.response.console.log(formatMessage); + + return response; + } finally { + commandParameters.response.progress.endBar(); + } } private buildFilesMap(commandParameters: IHandlerParameters) { diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 0ba57c37bf..536b05870e 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Imperative package will be documented in this file. +## Recent Changes + +- Enhancement: Added progress tracking to the `DirToUSSDirHandler` by using `commandParameters.response.progress` to show progress bars during file uploads. [#2334](https://github.com/zowe/zowe-cli/issues/2344) + ## `8.10.1` From 0eb2639f776ae274087397907be90ab96700d889 Mon Sep 17 00:00:00 2001 From: MAVRICK-1 Date: Fri, 3 Jan 2025 23:22:13 +0530 Subject: [PATCH 2/4] Enhancement: Update progress bar to include task status in DirToUSSDirHandler Signed-off-by: MAVRICK-1 --- packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts index 2f37a11abf..44bf308634 100644 --- a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts +++ b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts @@ -54,7 +54,7 @@ export default class DirToUSSDirHandler extends ZosFilesBaseHandler { uploadOptions.filesMap = this.buildFilesMap(commandParameters); } - commandParameters.response.progress.startBar("Uploading files..."); + commandParameters.response.progress.startBar({ task: status }); try { const uploadApi = commandParameters.arguments.recursive ? Upload.dirToUSSDirRecursive : Upload.dirToUSSDir; From f63f865fedec8d49f71b53fff01884befa762f57 Mon Sep 17 00:00:00 2001 From: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:24:36 -0500 Subject: [PATCH 3/4] review: move changelog updates ot cli package Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> --- packages/cli/CHANGELOG.md | 4 ++++ packages/imperative/CHANGELOG.md | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 2a7c9fc4a8..b8ce6a3936 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to the Zowe CLI package will be documented in this file. +## Recent Changes + +- Enhancement: Added progress tracking to the `DirToUSSDirHandler` by using `commandParameters.response.progress` to show progress bars during file uploads. [#2334](https://github.com/zowe/zowe-cli/issues/2344) + ## `8.10.3` - BugFix: The `zowe files copy data-set` command no longer copies all partitioned data set members if a member is specified. [#2402](https://github.com/zowe/zowe-cli/pull/2402) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 916c5aae5c..490e36fcb8 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,10 +2,6 @@ All notable changes to the Imperative package will be documented in this file. -## Recent Changes - -- Enhancement: Added progress tracking to the `DirToUSSDirHandler` by using `commandParameters.response.progress` to show progress bars during file uploads. [#2334](https://github.com/zowe/zowe-cli/issues/2344) - ## `8.10.3` - BugFix: Resolved an issue where extraneous base profiles were created in project configurations when a nested profile property was updated. [#2400](https://github.com/zowe/zowe-cli/pull/2400) From 83f1e449efbe04e0d1bc8186da1b5ac3b9673690 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Tue, 7 Jan 2025 14:11:06 -0500 Subject: [PATCH 4/4] Update CHANGELOG.md Signed-off-by: Timothy Johnson --- packages/cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index b8ce6a3936..600caf7f87 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the Zowe CLI package will be documented in this file. ## Recent Changes -- Enhancement: Added progress tracking to the `DirToUSSDirHandler` by using `commandParameters.response.progress` to show progress bars during file uploads. [#2334](https://github.com/zowe/zowe-cli/issues/2344) +- BugFix: Fixed an issue where the `zowe files upload dir-to-uss` command was missing progress bar to track progress of file uploads. [#2344](https://github.com/zowe/zowe-cli/issues/2344) ## `8.10.3`