Skip to content

Commit

Permalink
Merge branch 'master' into copy-pds-enhancement
Browse files Browse the repository at this point in the history
Signed-off-by: Pujal Gandhi <[email protected]>
  • Loading branch information
pujal0909 authored Dec 16, 2024
2 parents 48fb141 + 14986b1 commit e3af0c8
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 33 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/merge-by-comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Merge-by

on:
pull_request:
types: [opened, ready_for_review]
jobs:
rfr_add_date:
name: "Post merge-by date as comment"
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: zowe-actions/shared-actions/merge-by@main
with:
operation: "bump-dates"
25 changes: 25 additions & 0 deletions .github/workflows/merge-by-table.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Merge-by

on:
pull_request:
types: [opened, ready_for_review, converted_to_draft]
pull_request_review:
types: [submitted]
push:
branches:
- main
- next
workflow_dispatch:
schedule:
- cron: "0 11 * * *"
jobs:
rfr_add_date:
name: "Build table and notify users"
runs-on: ubuntu-latest
permissions:
discussions: write
pull-requests: write
steps:
- uses: zowe-actions/shared-actions/merge-by@main
with:
operation: "build-table"
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "8.8.4",
"version": "8.9.1",
"command": {
"publish": {
"ignoreChanges": [
Expand Down
18 changes: 9 additions & 9 deletions npm-shrinkwrap.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/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to the Zowe CLI package will be documented in this file.
## Recent Changes
-Enhancement: The `zowe zos-files copy data-set` command now copies members from a source partitioned data set to an existing target partitioned data set.[#2386](https://github.com/zowe/zowe-cli/pull/2386)

## Recent Changes
## `8.9.0`
- Enhancement: Added new command zowe zos-files download all-members-matching, (zowe files dl amm), to download members matching specified pattern(s). The success message for the Download.allMembers API was changed from originally "Data set downloaded successfully" to "Member(s) downloaded successfully." The change also alters the commandResponse when using the --rfj flag. [#2359](https://github.com/zowe/zowe-cli/pull/2359)

## `8.8.0`
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/cli",
"version": "8.8.4",
"version": "8.9.1",
"zoweVersion": "v3.0.0",
"description": "Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.",
"author": "Zowe",
Expand Down Expand Up @@ -62,12 +62,12 @@
"@zowe/imperative": "8.8.3",
"@zowe/provisioning-for-zowe-sdk": "8.8.3",
"@zowe/zos-console-for-zowe-sdk": "8.8.3",
"@zowe/zos-files-for-zowe-sdk": "8.8.4",
"@zowe/zos-jobs-for-zowe-sdk": "8.8.4",
"@zowe/zos-files-for-zowe-sdk": "8.9.1",
"@zowe/zos-jobs-for-zowe-sdk": "8.9.1",
"@zowe/zos-logs-for-zowe-sdk": "8.8.3",
"@zowe/zos-tso-for-zowe-sdk": "8.8.3",
"@zowe/zos-uss-for-zowe-sdk": "8.8.3",
"@zowe/zos-workflows-for-zowe-sdk": "8.8.4",
"@zowe/zos-workflows-for-zowe-sdk": "8.9.1",
"@zowe/zosmf-for-zowe-sdk": "8.8.3",
"find-process": "1.4.7",
"lodash": "4.17.21",
Expand Down
4 changes: 2 additions & 2 deletions packages/workflows/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/zos-workflows-for-zowe-sdk",
"version": "8.8.4",
"version": "8.9.1",
"description": "Zowe SDK to interact with the z/OS workflows APIs",
"author": "Zowe",
"license": "EPL-2.0",
Expand Down Expand Up @@ -45,7 +45,7 @@
"prepack": "node ../../scripts/prepareLicenses.js"
},
"dependencies": {
"@zowe/zos-files-for-zowe-sdk": "8.8.4"
"@zowe/zos-files-for-zowe-sdk": "8.9.1"
},
"devDependencies": {
"@zowe/cli-test-utils": "8.8.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/zosfiles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to the Zowe z/OS files SDK package will be documented in thi
## Recent Changes
- Enhancement: The `Copy.dataset` method now recognizes partioned data sets and can copy members of a source PDS into an existing target PDS. [#2386](https://github.com/zowe/zowe-cli/pull/2386)

## Recent Changes
## `8.9.1`

- BugFix: Corrected the `apiResponse` response value from `streamToDataSet()`,`streamToUss()`,`bufferToUss()` and `bufferToDataSet()` on the Upload SDK. [#2381](https://github.com/zowe/zowe-cli/pull/2381)
- BugFix: Corrected the `Upload.BufferToUssFile()` SDK function to properly tag uploaded files. [#2378](https://github.com/zowe/zowe-cli/pull/2378)

## `8.9.0`
- Enhancement: Added a `List.membersMatchingPattern` method to download all members that match a specific pattern.[#2359](https://github.com/zowe/zowe-cli/pull/2359)

## `8.8.4`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { deleteFiles, getUniqueDatasetName, stripNewLines, wait, waitTime } from
import * as fs from "fs";
import { ITestEnvironment } from "../../../../../../__tests__/__src__/environment/ITestEnvironment";
import { runCliScript } from "../../../../../../__tests__/__packages__/cli-test-utils/src";
import { Readable } from "stream";

let REAL_SESSION: Session;
let testEnvironment: ITestEnvironment<ITestPropertiesSchema>;
Expand Down Expand Up @@ -309,6 +310,49 @@ describe("Upload Data Set", () => {
}
});

it("should upload a PDS file - bufferToDataSet()", async () => {
let error;
let uploadResponse;
let getResponse;
const data: Buffer = Buffer.from(testdata);

try {
uploadResponse = await Upload.bufferToDataSet(REAL_SESSION, data, dsname+"(TEST)");
getResponse = await Get.dataSet(REAL_SESSION, dsname+"(TEST)");
} catch (err) {
error = err;
Imperative.console.info("Error: " + inspect(error));
}

expect(error).toBeFalsy();

expect(uploadResponse.apiResponse).toMatchObject({"success": true, "from": "Buffer<>","to": dsname+"(TEST)"});
expect(Buffer.from(getResponse.toString().trim())).toEqual(data);
});

it("should upload a PDS file - streamToDataSet()", async () => {
let error;
let uploadResponse;
let getResponse;

const inputStream = new Readable();
inputStream.push(testdata);
inputStream.push(null);

try {
uploadResponse = await Upload.streamToDataSet(REAL_SESSION, inputStream, dsname+"(TEST)");
getResponse = await Get.dataSet(REAL_SESSION, dsname+"(TEST)");
} catch (err) {
error = err;
Imperative.console.info("Error: " + inspect(error));
}

expect(error).toBeFalsy();

expect(uploadResponse.apiResponse).toMatchObject({"success": true, "from": "Stream<>","to": dsname+"(TEST)"});
expect(getResponse.toString().trim()).toEqual(testdata);
});

it("should upload a file to a partitioned data set member using full path", async () => {
let error;
let response: IZosFilesResponse;
Expand Down Expand Up @@ -733,7 +777,7 @@ describe("Upload USS file", () => {
await deleteFiles(REAL_SESSION, ussname);
});

it("should upload a USS file", async () => {
it("should upload a USS file - bufferToUssFile()", async () => {
let error;
let uploadResponse;
let getResponse;
Expand All @@ -748,26 +792,53 @@ describe("Upload USS file", () => {
}

expect(error).toBeFalsy();

expect(uploadResponse.apiResponse).toMatchObject({"success": true, "from": "Buffer<>","to": ussname});
expect(getResponse).toEqual(Buffer.from(data.toString()));
});

it("should upload a USS file - streamToUssFile()", async () => {
let error;
let uploadResponse;
let getResponse;
const inputStream = new Readable();
inputStream.push(testdata);
inputStream.push(null);

try {
uploadResponse = await Upload.streamToUssFile(REAL_SESSION, ussname, inputStream);
getResponse = await Get.USSFile(REAL_SESSION, ussname);
} catch (err) {
error = err;
Imperative.console.info("Error: " + inspect(error));
}

expect(error).toBeFalsy();

expect(uploadResponse.apiResponse).toMatchObject({"success": true, "from": "Stream<>","to": ussname});
expect(getResponse).toEqual(Buffer.from(testdata));
});

it("should upload a USS file in binary mode", async () => {
let error;
let uploadResponse;
let getResponse;
let tagResponse;

const data: Buffer = Buffer.from(testdata);

try {
uploadResponse = await Upload.bufferToUssFile(REAL_SESSION, ussname, data, { binary: true });
getResponse = await Get.USSFile(REAL_SESSION, ussname, {binary: true});
tagResponse = await Utilities.isFileTagBinOrAscii(REAL_SESSION, ussname);
} catch (err) {
error = err;
Imperative.console.info("Error: " + inspect(error));
}

expect(error).toBeFalsy();
expect(getResponse).toEqual(Buffer.from(data.toString()));

expect(tagResponse).toBe(true);
});
it("should upload a USS file from local file", async () => {
let error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { IUploadOptions } from "../../../../src/methods/upload/doc/IUploadOption
import { Upload } from "../../../../src/methods/upload/Upload";
import { List } from "../../../../src/methods/list/List";
import { Utilities } from "../../../../src/methods/utilities/Utilities";

import { inspect } from "util";
import { ZosFilesUtils } from "../../../../src/utils/ZosFilesUtils";
import { stripNewLines } from "../../../../../../__tests__/__src__/TestUtils";
import { Create } from "../../../../src/methods/create";
Expand Down Expand Up @@ -379,7 +379,7 @@ describe("z/OS Files - Upload", () => {
expect(error).toBeDefined();
expect(error).toBe(testError);
});
it("should return with proper response when upload buffer to a data set", async () => {
it("should return with proper response when upload buffer to a data set - buffer less than 10 chars", async () => {
const buffer: Buffer = Buffer.from("testing");
const endpoint = path.posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_DS_FILES, dsName);
const reqHeaders = [ZosmfHeaders.X_IBM_TEXT, ZosmfHeaders.ACCEPT_ENCODING];
Expand All @@ -392,6 +392,27 @@ describe("z/OS Files - Upload", () => {

expect(error).toBeUndefined();
expect(response).toBeDefined();
expect(response.apiResponse).toMatchObject({"from": "<Buffer 74 65 73 74 69 6e 67>", "success": true, "to": dsName});

expect(zosmfPutFullSpy).toHaveBeenCalledTimes(1);
expect(zosmfPutFullSpy).toHaveBeenCalledWith(dummySession, {resource: endpoint,
reqHeaders,
writeData: buffer});
});
it("should return with proper response when upload buffer to a data set - buffer more than 10 chars", async () => {
const buffer: Buffer = Buffer.from("bufferLargerThan10Chars");
const endpoint = path.posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_DS_FILES, dsName);
const reqHeaders = [ZosmfHeaders.X_IBM_TEXT, ZosmfHeaders.ACCEPT_ENCODING];

try {
response = await Upload.bufferToDataSet(dummySession, buffer, dsName);
} catch (err) {
error = err;
}

expect(error).toBeUndefined();
expect(response).toBeDefined();
expect(response.apiResponse).toMatchObject({"from": "<Buffer 62 75 66 66 65 72 4c 61 72 67...>", "success": true, "to": dsName});

expect(zosmfPutFullSpy).toHaveBeenCalledTimes(1);
expect(zosmfPutFullSpy).toHaveBeenCalledWith(dummySession, {resource: endpoint,
Expand Down Expand Up @@ -748,6 +769,7 @@ describe("z/OS Files - Upload", () => {

expect(error).toBeUndefined();
expect(response).toBeDefined();
expect(response.apiResponse).toMatchObject({"from": "[Readable]", "success": true, "to": dsName});

expect(zosmfPutFullSpy).toHaveBeenCalledTimes(1);
expect(zosmfPutFullSpy).toHaveBeenCalledWith(dummySession, {resource: endpoint,
Expand Down Expand Up @@ -1661,6 +1683,9 @@ describe("z/OS Files - Upload", () => {
expect(zosmfExpectSpy).toHaveBeenCalledWith(dummySession, { reqHeaders: headers, resource: endpoint, writeData: data });
});
it("should return with proper response when upload USS file in binary", async () => {
const chtagSpy = jest.spyOn(Utilities, "chtag");
chtagSpy.mockImplementation(async (): Promise<any> => null);

const data: Buffer = Buffer.from("testing");
const endpoint = path.posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, dsName);
const headers = [ZosmfHeaders.OCTET_STREAM, ZosmfHeaders.X_IBM_BINARY, ZosmfHeaders.ACCEPT_ENCODING];
Expand All @@ -1673,7 +1698,7 @@ describe("z/OS Files - Upload", () => {

expect(error).toBeUndefined();
expect(USSresponse).toBeDefined();

expect(chtagSpy).toHaveBeenCalled();
expect(zosmfExpectSpy).toHaveBeenCalledTimes(1);
expect(zosmfExpectSpy).toHaveBeenCalledWith(dummySession, { reqHeaders: headers, resource: endpoint, writeData: data });
});
Expand Down Expand Up @@ -1752,6 +1777,7 @@ describe("z/OS Files - Upload", () => {

expect(error).toBeUndefined();
expect(USSresponse).toBeDefined();
expect(USSresponse.apiResponse).toMatchObject({"from": "<Buffer 74 65 73 74 69 6e 67 0a 74 65...>", "success": true, "to": dsName});

const normalizedData = ZosFilesUtils.normalizeNewline(data);
expect(data.length).not.toBe(normalizedData.length);
Expand Down Expand Up @@ -1827,6 +1853,7 @@ describe("z/OS Files - Upload", () => {

expect(error).toBeUndefined();
expect(USSresponse).toBeDefined();
expect(USSresponse.apiResponse).toMatchObject({"from": "[Readable]", "success": true, "to": dsName});
expect(USSresponse.success).toBeTruthy();

expect(zosmfExpectFullSpy).toHaveBeenCalledTimes(1);
Expand Down
2 changes: 1 addition & 1 deletion packages/zosfiles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/zos-files-for-zowe-sdk",
"version": "8.8.4",
"version": "8.9.1",
"description": "Zowe SDK to interact with files and data sets on z/OS",
"author": "Zowe",
"license": "EPL-2.0",
Expand Down
Loading

0 comments on commit e3af0c8

Please sign in to comment.