Skip to content

Commit

Permalink
Merge branch 'main' into filtering-of-jobs
Browse files Browse the repository at this point in the history
Signed-off-by: SanthoshiBoyina <[email protected]>
  • Loading branch information
SanthoshiBoyina authored Nov 9, 2023
2 parents 5859464 + c2fc8c9 commit b277588
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 121 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.12.0-SNAPSHOT",
"version": "2.13.0-SNAPSHOT",
"command": {
"version": {
"forcePublish": true,
Expand Down
38 changes: 2 additions & 36 deletions packages/eslint-plugin-zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,24 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `2.11.2`

### New features and enhancements
## `2.12.0`

### Bug fixes
## `2.11.2`

## `2.11.1`

### New features and enhancements

### Bug fixes

## `2.11.0`

### New features and enhancements

### Bug fixes

## `2.10.0`

### New features and enhancements

### Bug fixes

## `2.9.2`

### New features and enhancements

### Bug fixes

## `2.9.1`

### New features and enhancements

### Bug fixes

## `2.9.0`

### New features and enhancements

### Bug fixes

## `2.8.1`

### New features and enhancements

### Bug fixes

- Added `no-floating-promises` rule that ignores floating thenables without a `.catch` method. [#2291](https://github.com/zowe/vscode-extension-for-zowe/issues/2291)
Expand All @@ -62,14 +34,8 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

- Updated linter rules and addressed linter errors throughout the codebase. [#2184](https://github.com/zowe/vscode-extension-for-zowe/issues/2184)

### Bug fixes

## `2.7.0`

### New features and enhancements

### Bug fixes

## `2.6.0`

### New features and enhancements
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-zowe-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-zowe-explorer",
"version": "2.12.0-SNAPSHOT",
"version": "2.13.0-SNAPSHOT",
"description": "Custom ESLint Rules for ZOWE Explorer",
"keywords": [
"eslint",
Expand Down
14 changes: 9 additions & 5 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

### Bug fixes

## `2.12.0`

### New features and enhancements

- Added optional `getTag` function to `ZoweExplorerAPI.IUss` for getting the tag of a file on USS.
- Added new API {ZE Extender MetaData} to allow extenders to have the metadata of registered extenders to aid in team configuration file creation from a view that isn't Zowe Explorer's. [#2394](https://github.com/zowe/vscode-extension-for-zowe/issues/2394)
- Added new ProfilesCache API `getConfigArray` to allow extenders to get the registered profile type's metadata for team configuration file creation handled outside of Zowe Explorer views. [#2394](https://github.com/zowe/vscode-extension-for-zowe/issues/2394)
- Add `sort` and `filter` optional variables for storing sort/filter options alongside tree nodes. [#2420](https://github.com/zowe/vscode-extension-for-zowe/issues/2420)
- Add `stats` optional variable for storing dataset stats (such as user, modified date, etc.)
- Add `stats` optional variable for storing dataset stats (such as user, modified date, etc.).
- Add option enums and types for sorting, filtering and sort direction in tree nodes. [#2420](https://github.com/zowe/vscode-extension-for-zowe/issues/2420)
- Added option for retaining context when generating webviews in Webview API

### Bug fixes
- Added option for retaining context when generating webviews in Webview API.

## `2.11.2`

Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/zowe-explorer-api",
"version": "2.12.0-SNAPSHOT",
"version": "2.13.0-SNAPSHOT",
"description": "Extensibility API for Zowe Explorer.",
"publisher": "Zowe",
"author": "Zowe",
Expand Down
6 changes: 6 additions & 0 deletions packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### Bug fixes

## `2.12.0`

### Bug fixes

- Fixed ECONNRESET error when trying to upload or create an empty data set member. [#2350](https://github.com/zowe/vscode-extension-for-zowe/issues/2350)
- Fixed issue where temporary files for e-tag comparison were not deleted after use.
- Fixed issue where another connection attempt was made inside `putContents` (in `getContentsTag`) even though a connection was already active.

## `2.11.2`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ describe("FtpMvsApi", () => {

it("should upload content to dataset.", async () => {
const localFile = tmp.tmpNameSync({ tmpdir: "/tmp" });
const tmpNameSyncSpy = jest.spyOn(tmp, "tmpNameSync");
const rmSyncSpy = jest.spyOn(fs, "rmSync");

fs.writeFileSync(localFile, "hello");
const response = TestUtils.getSingleLineStream();
Expand All @@ -113,14 +115,17 @@ describe("FtpMvsApi", () => {
dataSetName: " (IBMUSER).DS2",
options: { encoding: "", returnEtag: true, etag: "utf8" },
};
jest.spyOn(MvsApi as any, "getContentsTag").mockReturnValue(undefined);
jest.spyOn(MvsApi as any, "getContents").mockResolvedValueOnce({ apiResponse: { etag: "utf8" } });
jest.spyOn(fs, "readFileSync").mockReturnValue("test");
jest.spyOn(Gui, "warningMessage").mockImplementation();
const result = await MvsApi.putContents(mockParams.inputFilePath, mockParams.dataSetName, mockParams.options);
expect(result.commandResponse).toContain("Data set uploaded successfully.");
expect(DataSetUtils.listDataSets).toBeCalledTimes(1);
expect(DataSetUtils.uploadDataSet).toBeCalledTimes(1);
expect(MvsApi.releaseConnection).toBeCalled();
// check that correct function is called from node-tmp
expect(tmpNameSyncSpy).toHaveBeenCalled();
expect(rmSyncSpy).toHaveBeenCalled();
});

it("should upload single space to dataset when secureFtp is true and contents are empty", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ describe("FtpUssApi", () => {
const localFile = tmp.tmpNameSync({ tmpdir: "/tmp" });
const response = TestUtils.getSingleLineStream();
UssUtils.uploadFile = jest.fn().mockReturnValue(response);
const tmpNameSyncSpy = jest.spyOn(tmp, "tmpNameSync");
const rmSyncSpy = jest.spyOn(fs, "rmSync");
jest.spyOn(UssApi, "getContents").mockResolvedValue({ apiResponse: { etag: "test" } } as any);
const mockParams = {
inputFilePath: localFile,
Expand All @@ -107,11 +109,14 @@ describe("FtpUssApi", () => {
},
};
const result = await UssApi.putContents(mockParams.inputFilePath, mockParams.ussFilePath, undefined, undefined, "test", true);
jest.spyOn(UssApi as any, "getContentsTag").mockReturnValue("test");
jest.spyOn(UssApi as any, "getContents").mockResolvedValueOnce({ apiResponse: { etag: "test" } });
expect(result.commandResponse).toContain("File uploaded successfully.");
expect(UssUtils.downloadFile).toBeCalledTimes(1);
expect(UssUtils.uploadFile).toBeCalledTimes(1);
expect(UssApi.releaseConnection).toBeCalled();
// check that correct function is called from node-tmp
expect(tmpNameSyncSpy).toHaveBeenCalled();
expect(rmSyncSpy).toHaveBeenCalled();
});

it("should call putContents when calling putContent", async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer-ftp-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Zowe",
"license": "EPL-2.0",
"description": "Adds zFTP support to Zowe Explorer demonstrating how to extend the Zowe Explorer using its extensibility API.",
"version": "2.12.0-SNAPSHOT",
"version": "2.13.0-SNAPSHOT",
"icon": "resources/zowe-ftp-color.png",
"repository": {
"url": "https://github.com/zowe/vscode-extension-for-zowe"
Expand Down Expand Up @@ -48,7 +48,7 @@
},
"dependencies": {
"@zowe/zos-ftp-for-zowe-cli": "2.1.2",
"@zowe/zowe-explorer-api": "2.12.0-SNAPSHOT",
"@zowe/zowe-explorer-api": "2.13.0-SNAPSHOT",
"tmp": "0.2.1"
},
"devDependencies": {
Expand Down
24 changes: 15 additions & 9 deletions packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,24 @@ export class FtpMvsApi extends AbstractFtpApi implements ZoweExplorerApi.IMvs {
}
const result = this.getDefaultResponse();
const profile = this.checkedProfile();

// Save-Save with FTP requires loading the file first
// (moved this block above connection request so only one connection is active at a time)
if (options.returnEtag && options.etag) {
const contentsTag = await this.getContentsTag(dataSetName);
if (contentsTag && contentsTag !== options.etag) {
result.success = false;
result.commandResponse = "Rest API failure with HTTP(S) status 412 Save conflict.";
return result;
}
}
let connection;
try {
connection = await this.ftpClient(profile);
if (!connection) {
ZoweLogger.logImperativeMessage(result.commandResponse, MessageSeverity.ERROR);
throw new Error(result.commandResponse);
}
// Save-Save with FTP requires loading the file first
if (options.returnEtag && options.etag) {
const contentsTag = await this.getContentsTag(dataSetName);
if (contentsTag && contentsTag !== options.etag) {
result.success = false;
result.commandResponse = "Rest API failure with HTTP(S) status 412 Save conflict.";
return result;
}
}
const lrecl: number = dsAtrribute.apiResponse.items[0].lrecl;
const data = fs.readFileSync(inputFilePath, { encoding: "utf8" });
const transferOptions: Record<string, any> = {
Expand Down Expand Up @@ -178,6 +180,9 @@ export class FtpMvsApi extends AbstractFtpApi implements ZoweExplorerApi.IMvs {
await DataSetUtils.uploadDataSet(connection, targetDataset, transferOptions);
result.success = true;
if (options.returnEtag) {
// release this connection instance because a new one will be made with getContentsTag
this.releaseConnection(connection);
connection = null;
const contentsTag = await this.getContentsTag(dataSetName);
result.apiResponse = [
{
Expand Down Expand Up @@ -367,6 +372,7 @@ export class FtpMvsApi extends AbstractFtpApi implements ZoweExplorerApi.IMvs {
};
const loadResult = await this.getContents(dataSetName, options);
const etag: string = loadResult.apiResponse.etag;
fs.rmSync(tmpFileName, { force: true });
return etag;
}
private getDefaultResponse(): zowe.IZosFilesResponse {
Expand Down
19 changes: 12 additions & 7 deletions packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpUssApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,27 @@ export class FtpUssApi extends AbstractFtpApi implements ZoweExplorerApi.IUss {
localFile: inputFilePath,
};
const result = this.getDefaultResponse();
// Save-Save with FTP requires loading the file first
// (moved this block above connection request so only one connection is active at a time)
if (returnEtag && etag) {
const contentsTag = await this.getContentsTag(ussFilePath);
if (contentsTag && contentsTag !== etag) {
throw new Error("Rest API failure with HTTP(S) status 412 Save conflict.");
}
}
let connection;
try {
connection = await this.ftpClient(this.checkedProfile());
if (!connection) {
throw new Error(result.commandResponse);
}
// Save-Save with FTP requires loading the file first
if (returnEtag && etag) {
const contentsTag = await this.getContentsTag(ussFilePath);
if (contentsTag && contentsTag !== etag) {
throw new Error("Rest API failure with HTTP(S) status 412 Save conflict.");
}
}
await UssUtils.uploadFile(connection, ussFilePath, transferOptions);

result.success = true;
if (returnEtag) {
// release this connection instance because a new one will be made with getContentsTag
this.releaseConnection(connection);
connection = null;
const contentsTag = await this.getContentsTag(ussFilePath);
result.apiResponse.etag = contentsTag;
}
Expand Down Expand Up @@ -274,6 +278,7 @@ export class FtpUssApi extends AbstractFtpApi implements ZoweExplorerApi.IUss {
};
const loadResult = await this.getContents(ussFilePath, options);
const etag: string = loadResult.apiResponse.etag;
fs.rmSync(tmpFileName, { force: true });
return etag;
}

Expand Down
12 changes: 9 additions & 3 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

### Bug fixes

## `2.12.0`

### New features and enhancements

- Added "Sort Jobs" feature in Jobs tree view: accessible via sort icon or right-clicking on session node. [#2257](https://github.com/zowe/vscode-extension-for-zowe/issues/2257)
- Introduce a new user interface for managing profiles via right-click action "Manage Profile".
- Added new edit feature on `Edit Attributes` view for changing file tags on USS [#2113](https://github.com/zowe/vscode-extension-for-zowe/issues/2113)
- Added new edit feature on `Edit Attributes` view for changing file tags on USS. [#2113](https://github.com/zowe/vscode-extension-for-zowe/issues/2113)
- Added new API {ZE Extender MetaData} to allow extenders to have the metadata of registered extenders to aid in team configuration file creation from a view that isn't Zowe Explorer's. [#2394](https://github.com/zowe/vscode-extension-for-zowe/issues/2394)
- Added ability to install extension from VS Code marketplace if custom credential manager extension is missing after defining it on `imperative.json` [#2381](https://github.com/zowe/vscode-extension-for-zowe/issues/2381)
- Added ability to install extension from VS Code marketplace if custom credential manager extension is missing after defining it on `imperative.json`. [#2381](https://github.com/zowe/vscode-extension-for-zowe/issues/2381)
- Added new right-click action for `Submit as JCL` for local files in the VS Code file explorer as well as files opened in the VS Code text editor. [#2475](https://github.com/zowe/vscode-extension-for-zowe/issues/2475)
- Added "Sort PDS members" feature in Data Sets tree view: accessible via sort icon on session node, or by right-clicking a PDS or session. [#2420](https://github.com/zowe/vscode-extension-for-zowe/issues/2420)
- Added "Filter PDS members" feature in Data Sets tree view: accessible via filter icon on session node, or by right-clicking a PDS or session. [#2420](https://github.com/zowe/vscode-extension-for-zowe/issues/2420)
Expand All @@ -22,7 +28,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

- Fixed submitting local JCL using command pallet option `Zowe Explorer: Submit as JCL` by adding a check for chosen profile returned to continue the action. [#1625](https://github.com/zowe/vscode-extension-for-zowe/issues/1625)
- Fixed conflict resolution being skipped if local and remote file have different contents but are the same size. [#2496](https://github.com/zowe/vscode-extension-for-zowe/issues/2496)
- Fixed issue with token based auth for unsecure profiles in Zowe Explorer [#2518](https://github.com/zowe/vscode-extension-for-zowe/issues/2518)
- Fixed issue with token based auth for unsecure profiles in Zowe Explorer. [#2518](https://github.com/zowe/vscode-extension-for-zowe/issues/2518)

## `2.11.2`

Expand Down
Loading

0 comments on commit b277588

Please sign in to comment.