Skip to content

Commit

Permalink
Merge pull request #2924 from zowe/port/2.16.0
Browse files Browse the repository at this point in the history
Port 2.16.0 to Main
  • Loading branch information
t1m0thyj authored May 23, 2024
2 parents 8755004 + 0a4bd07 commit a320a65
Show file tree
Hide file tree
Showing 30 changed files with 430 additions and 253 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.16.0-SNAPSHOT",
"version": "2.17.0-SNAPSHOT",
"command": {
"version": {
"forcePublish": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vscode": "^1.53.2"
},
"dependencies": {
"@zowe/cli": "7.24.0",
"@zowe/cli": "7.24.3",
"vscode-nls": "4.1.2"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin-zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `2.16.0`

## `2.15.4`

## `2.15.3`
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.16.0-SNAPSHOT",
"version": "2.17.0-SNAPSHOT",
"description": "Custom ESLint Rules for ZOWE Explorer",
"keywords": [
"eslint",
Expand Down
9 changes: 9 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

### Bug fixes

## `2.16.0`

### New features and enhancements

- Added optional `consoleName` argument to `ZosmfCommandApi.issueMvsCommand`. [#1667](https://github.com/zowe/vscode-extension-for-zowe/issues/1667)
- Added "Date Completed" attribute to JobSortOpts enum type. [#1685](https://github.com/zowe/vscode-extension-for-zowe/issues/1685)
- Added PEM certificate support as an authentication method for logging into the API ML. [#2621](https://github.com/zowe/zowe-explorer-vscode/issues/2621)

### Bug fixes

- Updated `@zowe/cli` dependency to fix issue where "Log out of authentication service" doesn't show in Manage Profile menu. [#2633](https://github.com/zowe/zowe-explorer-vscode/issues/2633)
- Fixed regression of issue where the `ProfilesCache` class would retain old service profiles, even if they were removed from the team config. [#2910](https://github.com/zowe/zowe-explorer-vscode/issues/2910)

## `2.15.4`

## `2.15.3`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,16 @@ describe("ProfilesCache", () => {
it("should remove old types from profilesByType and defaultProfileByType maps when reloading profiles", async () => {
const profCache = new ProfilesCache({ ...fakeLogger, error: mockLogError } as unknown as zowe.imperative.Logger);
jest.spyOn(profCache, "getProfileInfo").mockResolvedValue(createProfInfoMock([]));
(profCache as any).profilesByType.set("test-type", { name: "someProf" as any });
(profCache as any).defaultProfileByType.set("test-type", { name: "someProf" as any });
(profCache as any).profilesByType.set("base", { name: "someProf" as any });
(profCache as any).defaultProfileByType.set("base", { name: "someProf" as any });
const promise = profCache.refresh();
expect((profCache as any).profilesByType.size).toBe(1);
expect((profCache as any).defaultProfileByType.size).toBe(1);
await promise;
expect((profCache as any).profilesByType.size).toBe(0);
expect((profCache as any).defaultProfileByType.size).toBe(0);
expect((profCache as any).allProfiles.length).toBe(0);
expect((profCache as any).allTypes).toEqual(["base"]);
expect(mockLogError).not.toHaveBeenCalled();
});
});
Expand Down
4 changes: 2 additions & 2 deletions 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.16.0-SNAPSHOT",
"version": "2.17.0-SNAPSHOT",
"description": "Extensibility API for Zowe Explorer.",
"publisher": "Zowe",
"author": "Zowe",
Expand All @@ -21,7 +21,7 @@
},
"dependencies": {
"@types/vscode": "^1.53.2",
"@zowe/cli": "7.24.0",
"@zowe/cli": "7.24.3",
"@zowe/secrets-for-zowe-sdk": "7.18.6",
"handlebars": "^4.7.7",
"semver": "^7.5.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer-api/src/profiles/ProfilesCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class ProfilesCache {
*
* @returns {IProfileLoaded[]}
*/
public getProfiles(type = "zosmf"): zowe.imperative.IProfileLoaded[] {
public getProfiles(type = "zosmf"): zowe.imperative.IProfileLoaded[] | undefined {
return this.profilesByType.get(type);
}

Expand Down Expand Up @@ -222,7 +222,7 @@ export class ProfilesCache {
}
this.allProfiles = allProfiles;
this.allTypes = allTypes;
for (const oldType of [...this.profilesByType.keys()].filter((type) => !allTypes.includes(type))) {
for (const oldType of [...this.profilesByType.keys()].filter((type) => !allProfiles.some((prof) => prof.type === type))) {
this.profilesByType.delete(oldType);
this.defaultProfileByType.delete(oldType);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### Bug fixes

## `2.16.0`

### Bug fixes

- Fix issue with zFTP spool files not listing properly for active jobs. [#2832](https://github.com/zowe/zowe-explorer-vscode/issues/2832)
- Changed the hashing algorithm for e-tag generation from `sha1` to `sha256` to avoid collisions. [#2890](https://github.com/zowe/zowe-explorer-vscode/pull/2890)

## `2.15.4`
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.16.0-SNAPSHOT",
"version": "2.17.0-SNAPSHOT",
"icon": "resources/zowe-ftp-color.png",
"repository": {
"url": "https://github.com/zowe/zowe-explorer-vscode"
Expand Down Expand Up @@ -48,7 +48,7 @@
},
"dependencies": {
"@zowe/zos-ftp-for-zowe-cli": "2.1.8",
"@zowe/zowe-explorer-api": "2.16.0-SNAPSHOT",
"@zowe/zowe-explorer-api": "2.17.0-SNAPSHOT",
"tmp": "0.2.1"
},
"devDependencies": {
Expand Down
17 changes: 12 additions & 5 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

- Added support for `consoleName` property in z/OSMF profiles when issuing MVS commands [#1667](https://github.com/zowe/vscode-extension-for-zowe/issues/1667)
- Updated sorting of PDS members to show items without stats at bottom of list [#2660](https://github.com/zowe/vscode-extension-for-zowe/issues/2660)
- Added support to view the Encoding history for MVS and Dataset in the History View [#2776](https://github.com/zowe/zowe-explorer-vscode/pull/2776)
### Bug fixes

## `2.16.0`

### New features and enhancements

- Added support for `consoleName` property in z/OSMF profiles when issuing MVS commands. [#1667](https://github.com/zowe/vscode-extension-for-zowe/issues/1667)
- Updated sorting of PDS members to show items without stats at bottom of list. [#2660](https://github.com/zowe/vscode-extension-for-zowe/issues/2660)
- Added support to view the Encoding history for MVS and Dataset in the History View. [#2776](https://github.com/zowe/zowe-explorer-vscode/pull/2776)
- Updated MVS view progress indicator for entering a filter search. [#2181](https://github.com/zowe/zowe-explorer-vscode/issues/2181)
- Added error handling for when the default credential manager is unable to initialize [#2811](https://github.com/zowe/zowe-explorer-vscode/issues/2811)
- Added error handling for when the default credential manager is unable to initialize. [#2811](https://github.com/zowe/zowe-explorer-vscode/issues/2811)
- Provide users with the option to upload binary files by implementing a "Upload Files (Binary)" right-click option in the USS tree. [#1956](https://github.com/zowe/zowe-explorer-vscode/issues/1956)
- Added Status bar to indicate that data is being pulled from mainframe. [#2484](https://github.com/zowe/zowe-explorer-vscode/issues/2484)
- Added PEM certificate support as an authentication method for logging into the API ML. [#2621](https://github.com/zowe/zowe-explorer-vscode/issues/2621)
Expand All @@ -20,7 +26,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### Bug fixes

- To fix clicking submitted job hyperlink throws error [#2813](https://github.com/zowe/vscode-extension-for-zowe/issues/2813)
- Fixed issue where clicking on a submitted job hyperlink throws an error. [#2813](https://github.com/zowe/vscode-extension-for-zowe/issues/2813)
- Omitted the following Zowe Explorer commands from the Command Palette that do not execute properly when run as a standalone command: [#2853](https://github.com/zowe/zowe-explorer-vscode/pull/2853)
- `Zowe Explorer: Cancel job`
- `Zowe Explorer: Filter jobs`
Expand All @@ -32,6 +38,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Duplicated profile schema writing on repeated Team Config file initialization:
[#2828](https://github.com/zowe/zowe-explorer-vscode/pull/2828)
- Fixed issue where saving changes to favorited PDS member fails when custom temp folder is set on Windows. [#2880](https://github.com/zowe/zowe-explorer-vscode/issues/2880)
- Fixed issue where data sets or members containing binary content cannot be opened. [#2696](https://github.com/zowe/zowe-explorer-vscode/issues/2696)

## `2.15.4`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function createGlobalMocks() {
statusBarMsgSpy: null,
mvsApi: null,
mockShowWarningMessage: jest.fn(),
mockTextDocuments: [],
concatChildNodes: jest.spyOn(sharedUtils, "concatChildNodes"),
};

Expand Down Expand Up @@ -100,6 +101,7 @@ function createGlobalMocks() {
Object.defineProperty(vscode.workspace, "openTextDocument", { value: jest.fn(), configurable: true });
Object.defineProperty(vscode.workspace, "getConfiguration", { value: jest.fn(), configurable: true });
Object.defineProperty(vscode.window, "showTextDocument", { value: jest.fn(), configurable: true });
Object.defineProperty(vscode.workspace, "textDocuments", { value: newMocks.mockTextDocuments, configurable: true });
Object.defineProperty(vscode.window, "showQuickPick", { value: jest.fn(), configurable: true });
Object.defineProperty(vscode.window, "createQuickPick", { value: jest.fn(), configurable: true });
Object.defineProperty(vscode.commands, "executeCommand", { value: jest.fn(), configurable: true });
Expand Down Expand Up @@ -267,15 +269,16 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {

it("Checking common PS dataset refresh", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const node = new ZoweDatasetNode({
label: "HLQ.TEST.AFILE7",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
const documentFilePath = path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString());

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockResolvedValueOnce({
success: true,
commandResponse: null,
Expand All @@ -290,27 +293,26 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
blockMocks.zosmfSession,
node.label,
expect.objectContaining({
file: path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString()),
file: documentFilePath,
returnEtag: true,
})
);
expect(mocked(vscode.workspace.openTextDocument)).toBeCalledWith(
path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString())
);
expect(mocked(vscode.workspace.openTextDocument)).toBeCalledWith(documentFilePath);
expect(mocked(vscode.window.showTextDocument)).toBeCalledTimes(2);
expect(mocked(vscode.commands.executeCommand)).toBeCalledWith("workbench.action.closeActiveEditor");
});
it("Checking duplicate PS dataset refresh attempt", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const node = new ZoweDatasetNode({
label: "HLQ.TEST.AFILE7",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
const documentFilePath = path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString());

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: false } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: false } as any);
mocked(zowe.Download.dataSet).mockResolvedValueOnce({
success: true,
commandResponse: null,
Expand All @@ -332,8 +334,9 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
const documentFilePath = path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString());

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockRejectedValueOnce(Error("not found"));

globalMocks.getContentsSpy.mockRejectedValueOnce(new Error("not found"));
Expand All @@ -345,16 +348,17 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
});
it("Checking failed attempt to refresh PDS Member", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const parent = new ZoweDatasetNode({
label: "parent",
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
parentNode: blockMocks.datasetSessionNode,
});
const child = new ZoweDatasetNode({ label: "child", collapsibleState: vscode.TreeItemCollapsibleState.None, parentNode: parent });
const documentFilePath = path.join(globals.DS_DIR, child.getSessionNode().label.toString(), child.label.toString());

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockRejectedValueOnce(Error(""));

await dsActions.refreshPS(child);
Expand All @@ -371,16 +375,17 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
});
it("Checking favorite empty PDS refresh", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const node = new ZoweDatasetNode({
label: "HLQ.TEST.AFILE7",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
const documentFilePath = path.join(globals.DS_DIR, node.getSessionNode().label.toString(), node.label.toString());
node.contextValue = globals.DS_PDS_CONTEXT + globals.FAV_SUFFIX;

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockResolvedValueOnce({
success: true,
commandResponse: null,
Expand All @@ -396,17 +401,22 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
});
it("Checking favorite PDS Member refresh", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const parent = new ZoweDatasetNode({
label: "parent",
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
parentNode: blockMocks.datasetSessionNode,
});
const child = new ZoweDatasetNode({ label: "child", collapsibleState: vscode.TreeItemCollapsibleState.None, parentNode: parent });
const documentFilePath = path.join(
globals.DS_DIR,
child.getSessionNode().label.toString(),
parent.label.toString() + "(" + child.label.toString() + ")"
);
parent.contextValue = globals.DS_PDS_CONTEXT + globals.FAV_SUFFIX;

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockResolvedValueOnce({
success: true,
commandResponse: null,
Expand All @@ -422,17 +432,18 @@ describe("Dataset Actions Unit Tests - Function refreshPS", () => {
});
it("Checking favorite PS refresh", async () => {
globals.defineGlobals("");
createGlobalMocks();
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocksShared();
const parent = new ZoweDatasetNode({
label: "parent",
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
parentNode: blockMocks.datasetSessionNode,
});
const child = new ZoweDatasetNode({ label: "child", collapsibleState: vscode.TreeItemCollapsibleState.None, parentNode: parent });
const documentFilePath = path.join(globals.DS_DIR, child.getSessionNode().label.toString(), child.label.toString());
child.contextValue = globals.DS_FAV_CONTEXT;

mocked(vscode.workspace.openTextDocument).mockResolvedValueOnce({ isDirty: true } as any);
globalMocks.mockTextDocuments.push({ fileName: documentFilePath, isDirty: true } as any);
mocked(zowe.Download.dataSet).mockResolvedValueOnce({
success: true,
commandResponse: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe("Test src/dataset/extension", () => {
},
{
name: "zowe.ds.openWithEncoding",
mock: [{ spy: jest.spyOn(dsProvider, "openWithEncoding"), arg: [test.value] }],
mock: [{ spy: jest.spyOn(dsProvider, "openWithEncoding"), arg: [test.value, undefined] }],
},
{
name: "zowe.ds.copyName",
Expand Down
Loading

0 comments on commit a320a65

Please sign in to comment.