From c2fbbcaedf4c0ec3e2166afdb7f6c3abccc2d480 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 6 Jun 2023 15:52:40 -0400 Subject: [PATCH 01/23] fix: tokenType/tokenValue assigned to direct-to-service profiles Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/Profiles.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index c6d4a0e9bf..4ca2263088 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -883,8 +883,15 @@ export class Profiles extends ProfilesCache { return; // See https://github.com/zowe/vscode-extension-for-zowe/issues/1827 } - const updSession = promptInfo.profile as zowe.imperative.ISession; - const returnValue = [updSession.user, updSession.password, updSession.base64EncodedAuth]; + const isImperativeProfile = (prof: string | zowe.imperative.IProfileLoaded): prof is zowe.imperative.IProfileLoaded => + typeof prof !== "string"; + + if (isImperativeProfile(profile)) { + if (profile.profile?.tokenValue == null || profile.profile?.tokenType == null) { + promptInfo.profile.tokenType = promptInfo.profile.tokenValue = null; + } + } + const returnValue: string[] = [promptInfo.profile.user, promptInfo.profile.password, promptInfo.profile.base64EncodedAuth]; this.updateProfilesArrays(promptInfo); return returnValue; } @@ -1213,7 +1220,7 @@ export class Profiles extends ProfilesCache { }; await this.updateBaseProfileFileLogin(baseProfile, updBaseProfile); const baseIndex = this.allProfiles.findIndex((profile) => profile.name === baseProfile.name); - this.allProfiles[baseIndex] = { ...baseProfile, profile: { ...baseProfile, ...updBaseProfile } }; + this.allProfiles[baseIndex] = { ...baseProfile, profile: { ...baseProfile.profile, ...updBaseProfile } }; node.setProfileToChoice({ ...node.getProfile(), profile: { ...node.getProfile().profile, ...updBaseProfile }, From e9247a5c4d2882879cf95c72262284d86b6d0aec Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:26:42 -0400 Subject: [PATCH 02/23] fix: do not rebuild prof. w/ ProfilesCache if already provided Signed-off-by: Trae Yelovich --- .../src/vscode/ZoweVsCodeExtension.ts | 13 +++++++++---- .../src/vscode/doc/IPromptCredentials.ts | 3 ++- packages/zowe-explorer/src/Profiles.ts | 11 +---------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 5436951cfd..20fafecfdd 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -80,8 +80,8 @@ export class ZoweVsCodeExtension { * @deprecated */ public static async promptCredentials(options: IPromptCredentialsOptions): Promise { - const loadProfile = await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()); - if (loadProfile == null) { + const loadProfile = options.sessionName ? await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()) : options.profile; + if (typeof loadProfile === "string" || loadProfile == null) { return undefined; } const loadSession = loadProfile.profile as imperative.ISession; @@ -117,10 +117,15 @@ export class ZoweVsCodeExtension { const cache = this.profilesCache; const profInfo = await cache.getProfileInfo(); const setSecure = options.secure ?? profInfo.isSecured(); - const loadProfile = await cache.getLoadedProfConfig(options.sessionName, options.sessionType); - const loadSession = loadProfile.profile as imperative.ISession; + + const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; + const loadSession = loadProfile?.profile as imperative.ISession; const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); + if (loadProfile == null || loadSession == null) { + return; + } + if (creds && creds.length > 0) { loadProfile.profile.user = loadSession.user = creds[0]; loadProfile.profile.password = loadSession.password = creds[1]; diff --git a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts index 4551993a66..ff78243a00 100644 --- a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts +++ b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts @@ -19,7 +19,8 @@ export interface IPromptCredentialsCommonOptions { } export interface IPromptCredentialsOptions extends IPromptCredentialsCommonOptions { - sessionName: string; + profile?: string | imperative.IProfileLoaded; + sessionName?: string; sessionType?: string; secure?: boolean; } diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index 4ca2263088..35e9701f0a 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -869,8 +869,7 @@ export class Profiles extends ProfilesCache { const promptInfo = await ZoweVsCodeExtension.updateCredentials( { - sessionName: typeof profile !== "string" ? profile.name : profile, - sessionType: typeof profile !== "string" ? profile.type : undefined, + profile, rePrompt, secure: (await this.getProfileInfo()).isSecured(), userInputBoxOptions, @@ -883,14 +882,6 @@ export class Profiles extends ProfilesCache { return; // See https://github.com/zowe/vscode-extension-for-zowe/issues/1827 } - const isImperativeProfile = (prof: string | zowe.imperative.IProfileLoaded): prof is zowe.imperative.IProfileLoaded => - typeof prof !== "string"; - - if (isImperativeProfile(profile)) { - if (profile.profile?.tokenValue == null || profile.profile?.tokenType == null) { - promptInfo.profile.tokenType = promptInfo.profile.tokenValue = null; - } - } const returnValue: string[] = [promptInfo.profile.user, promptInfo.profile.password, promptInfo.profile.base64EncodedAuth]; this.updateProfilesArrays(promptInfo); return returnValue; From e0bf8ed356be220642b78f3a7dc8ee95d622e6ba Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:33:02 -0400 Subject: [PATCH 03/23] docs: add changelogs Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/CHANGELOG.md | 3 +++ packages/zowe-explorer/CHANGELOG.md | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index b8ec7dee7c..f9b6a56283 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -10,9 +10,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added a new type `DataSetAllocTemplate` that is used for data set creation templates. - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. +- Added optional `profile` parameter to `IPromptCredentialsOptions` so developers can choose to skip rebuilding the profile with ProfilesCache. ### Bug fixes +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) + ## `2.8.1` ### Bug fixes diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 6ad6da4162..e18be87c5f 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed issue where user was not able to view job spool file with the same DD name in different steps because of duplicated local file name. [#2279](https://github.com/zowe/vscode-extension-for-zowe/issues/2279) - Fixed issue where user was not able to view job spool file from jobs with duplicated step names because of duplicated local file name. [#2315](https://github.com/zowe/vscode-extension-for-zowe/issues/2315) - Fixed issue with Windows path when uploading file to data set. [#2323](https://github.com/zowe/vscode-extension-for-zowe/issues/2323) +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) ## `2.8.1` From 4348e47990ce88676cd1ef314e098312a17fb8a7 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:34:58 -0400 Subject: [PATCH 04/23] fix: move sanity check above ZoweVsCodeExtension.promptUserPass call Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 20fafecfdd..0aef9429ab 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -120,11 +120,11 @@ export class ZoweVsCodeExtension { const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; const loadSession = loadProfile?.profile as imperative.ISession; - const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); if (loadProfile == null || loadSession == null) { - return; + return undefined; } + const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); if (creds && creds.length > 0) { loadProfile.profile.user = loadSession.user = creds[0]; From 0e4521f530f10fd7706c1270ea8412c435d8c8fd Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:45:15 -0400 Subject: [PATCH 05/23] fix: change IPromptCredentialsOptions.profile type to IProfileLoaded Signed-off-by: Trae Yelovich --- .../zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts | 8 ++++++-- .../src/vscode/doc/IPromptCredentials.ts | 2 +- packages/zowe-explorer/src/Profiles.ts | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 0aef9429ab..a379383037 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -81,7 +81,7 @@ export class ZoweVsCodeExtension { */ public static async promptCredentials(options: IPromptCredentialsOptions): Promise { const loadProfile = options.sessionName ? await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()) : options.profile; - if (typeof loadProfile === "string" || loadProfile == null) { + if (loadProfile == null) { return undefined; } const loadSession = loadProfile.profile as imperative.ISession; @@ -118,7 +118,11 @@ export class ZoweVsCodeExtension { const profInfo = await cache.getProfileInfo(); const setSecure = options.secure ?? profInfo.isSecured(); - const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; + if (options.profile == null && options.sessionName == null) { + return undefined; + } + + const loadProfile = options.sessionName ? await cache.getLoadedProfConfig(options.sessionName) : options.profile; const loadSession = loadProfile?.profile as imperative.ISession; if (loadProfile == null || loadSession == null) { diff --git a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts index ff78243a00..5c41c72e0f 100644 --- a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts +++ b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts @@ -19,7 +19,7 @@ export interface IPromptCredentialsCommonOptions { } export interface IPromptCredentialsOptions extends IPromptCredentialsCommonOptions { - profile?: string | imperative.IProfileLoaded; + profile?: imperative.IProfileLoaded; sessionName?: string; sessionType?: string; secure?: boolean; diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index 35e9701f0a..5c3db45f5d 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -869,7 +869,8 @@ export class Profiles extends ProfilesCache { const promptInfo = await ZoweVsCodeExtension.updateCredentials( { - profile, + profile: typeof profile === "string" ? undefined : profile, + sessionName: typeof profile === "string" ? profile : undefined, rePrompt, secure: (await this.getProfileInfo()).isSecured(), userInputBoxOptions, From 224157fe07fe074ced1217af058fbf0011605150 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 15:03:45 -0400 Subject: [PATCH 06/23] test: add 2 unit tests for profile/sessionName args Signed-off-by: Trae Yelovich --- .../vscode/ZoweVsCodeExtension.unit.test.ts | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts index ef83041647..e6ebcad4eb 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts @@ -14,7 +14,8 @@ import { Gui } from "../../../src/globals/Gui"; import { MessageSeverity, IZoweLogger } from "../../../src/logger/IZoweLogger"; import { IProfileLoaded } from "@zowe/imperative"; import { IPromptCredentialsOptions, ZoweVsCodeExtension } from "../../../src/vscode"; -import { ZoweExplorerApi } from "../../../src"; +import { ProfilesCache, ZoweExplorerApi } from "../../../src"; +import { imperative } from "@zowe/cli"; describe("ZoweVsCodeExtension", () => { const fakeVsce = { @@ -328,5 +329,50 @@ describe("ZoweVsCodeExtension", () => { expect(showInputBoxSpy).toHaveBeenCalledTimes(2); expect(mockUpdateProperty).toHaveBeenCalledTimes(0); }); + + it("should do nothing if profile and sessionName args are not provided", async () => { + const mockUpdateProperty = jest.fn(); + jest.spyOn(ZoweVsCodeExtension as any, "profilesCache", "get").mockReturnValue({ + getLoadedProfConfig: jest.fn().mockReturnValue({ + profile: {}, + }), + getProfileInfo: jest.fn().mockReturnValue({ + isSecured: jest.fn().mockReturnValue(true), + updateProperty: mockUpdateProperty, + }), + refresh: jest.fn(), + }); + const showInputBoxSpy = jest.spyOn(Gui, "showInputBox").mockResolvedValueOnce("fakeUser").mockResolvedValueOnce(undefined); + const profileLoaded = await ZoweVsCodeExtension.updateCredentials({}, undefined as unknown as ZoweExplorerApi.IApiRegisterClient); + expect(profileLoaded).toBeUndefined(); + expect(showInputBoxSpy).not.toHaveBeenCalled(); + expect(mockUpdateProperty).not.toHaveBeenCalled(); + }); + + it("should not call ProfilesCache.getLoadedProfConfig if profile object is provided", async () => { + const mockUpdateProperty = jest.fn(); + jest.spyOn(ZoweVsCodeExtension as any, "profilesCache", "get").mockReturnValue({ + getLoadedProfConfig: jest.fn().mockReturnValue({ + profile: { + name: "someExampleProfile", + profile: { + user: "testUser", + password: "testPassword", + } as imperative.IProfile, + } as imperative.IProfileLoaded, + }), + getProfileInfo: jest.fn().mockReturnValue({ + isSecured: jest.fn().mockReturnValue(true), + updateProperty: mockUpdateProperty, + }), + refresh: jest.fn(), + }); + const getLoadedProfConfigSpy = jest.spyOn(ProfilesCache.prototype, "getLoadedProfConfig"); + const showInputBoxSpy = jest.spyOn(Gui, "showInputBox").mockResolvedValueOnce("fakeUser").mockResolvedValueOnce(undefined); + const profileLoaded = await ZoweVsCodeExtension.updateCredentials({}, undefined as unknown as ZoweExplorerApi.IApiRegisterClient); + expect(profileLoaded).toBeUndefined(); + expect(getLoadedProfConfigSpy).not.toHaveBeenCalled(); + expect(showInputBoxSpy).not.toHaveBeenCalled(); + }); }); }); From 6d4404742446aebb4b11fd322d43e0e24745dc71 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:34:37 -0400 Subject: [PATCH 07/23] prepare release Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- lerna.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 6 ++---- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 2 -- packages/zowe-explorer/CHANGELOG.md | 10 +++++----- .../__tests__/__unit__/globals.unit.test.ts | 11 +++++++++++ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lerna.json b/lerna.json index f91e91be09..1f87b0aa75 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.0-SNAPSHOT", + "version": "2.9.0", "command": { "version": { "forcePublish": true, diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index b8ec7dee7c..524c2c666e 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -6,13 +6,11 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### New features and enhancements -- Added new optional IZoweTree functions, `addDsTemplate` and `getDSTemplates`. -- Added a new type `DataSetAllocTemplate` that is used for data set creation templates. +- Added optional IZoweTree functions, `addDsTemplate` and `getDSTemplates`. +- Added a new type `DataSetAllocTemplate` for data set attributes. - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. -### Bug fixes - ## `2.8.1` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index ba8d342f17..56ff5942e4 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -2,8 +2,6 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ## TBD Release -### New features and enhancements - ### Bug fixes - Fixed an issue with mismatch etag, correcting error message sent to Zowe Explorer to trigger diff editor. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 39e5751ac8..39c1269ceb 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -13,11 +13,11 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes - Fixed issue where the "Disable Validation for Profile" context menu option did not update to "Enable Validation for Profile" after use. [#1897](https://github.com/zowe/vscode-extension-for-zowe/issues/1897) -- Removed "/" characters in `path.join()` calls [#2172](https://github.com/zowe/vscode-extension-for-zowe/issues/2172) -- Fixed issue where user was not able to view job spool file with the same DD name in different steps because of duplicated local file name. [#2279](https://github.com/zowe/vscode-extension-for-zowe/issues/2279) -- Fixed issue where user was not able to view job spool file from jobs with duplicated step names because of duplicated local file name. [#2315](https://github.com/zowe/vscode-extension-for-zowe/issues/2315) -- Fixed issue with Windows path when uploading file to data set. [#2323](https://github.com/zowe/vscode-extension-for-zowe/issues/2323) -- Fixed an issue with mismatch etag error returned not triggering the diff editor and possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) +- Fixed parameters passed to `path.join()` calls [#2172](https://github.com/zowe/vscode-extension-for-zowe/issues/2172) +- Fixed issue handling job files with the same DD names across different steps. [#2279](https://github.com/zowe/vscode-extension-for-zowe/issues/2279) +- Fixed issue handling job files with unnamed steps. [#2315](https://github.com/zowe/vscode-extension-for-zowe/issues/2315) +- Fixed issue with Windows path when uploading a file to a data set. [#2323](https://github.com/zowe/vscode-extension-for-zowe/issues/2323) +- Fixed an issue where the mismatch etag error returned was not triggering the diff editor, resulting in possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) ## `2.8.2` diff --git a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts index 172be8208e..fe2e6372d4 100644 --- a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts @@ -1,3 +1,14 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + import * as globals from "../../src/globals"; import { ZoweLogger } from "../../src/utils/LoggerUtils"; import * as SettingsConfig from "../../src/utils/SettingsConfig"; From 42cdff109c77552349c92aa72b0964c23d1c4652 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 8 Jun 2023 10:29:28 -0400 Subject: [PATCH 08/23] fix: only call `refreshAll` once in `ssoLogin, ssoLogout` Signed-off-by: Trae Yelovich --- .../__tests__/__unit__/globals.unit.test.ts | 11 ++++++++++ .../src/abstract/ZoweTreeProvider.ts | 20 +++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts index 172be8208e..fe2e6372d4 100644 --- a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts @@ -1,3 +1,14 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + import * as globals from "../../src/globals"; import { ZoweLogger } from "../../src/utils/LoggerUtils"; import * as SettingsConfig from "../../src/utils/SettingsConfig"; diff --git a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts index 2ab82bb8d1..2843b5766a 100644 --- a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts +++ b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts @@ -247,17 +247,25 @@ export class ZoweTreeProvider { public async ssoLogin(node: IZoweTreeNode): Promise { ZoweLogger.trace("ZoweTreeProvider.ssoLogin called."); await Profiles.getInstance().ssoLogin(node); - await vscode.commands.executeCommand("zowe.ds.refreshAll"); - await vscode.commands.executeCommand("zowe.uss.refreshAll"); - await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + if (contextually.isDsSession(node)) { + await vscode.commands.executeCommand("zowe.ds.refreshAll"); + } else if (contextually.isUssSession(node)) { + await vscode.commands.executeCommand("zowe.uss.refreshAll"); + } else { + await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + } } public async ssoLogout(node: IZoweTreeNode): Promise { ZoweLogger.trace("ZoweTreeProvider.ssoLogout called."); await Profiles.getInstance().ssoLogout(node); - await vscode.commands.executeCommand("zowe.ds.refreshAll"); - await vscode.commands.executeCommand("zowe.uss.refreshAll"); - await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + if (contextually.isDsSession(node)) { + await vscode.commands.executeCommand("zowe.ds.refreshAll"); + } else if (contextually.isUssSession(node)) { + await vscode.commands.executeCommand("zowe.uss.refreshAll"); + } else { + await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + } } public async createZoweSchema(zoweFileProvider: IZoweTree): Promise { From d35d025d89419c998780c5f8d29bd431eecf75e9 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 8 Jun 2023 10:56:50 -0400 Subject: [PATCH 09/23] tests: `ZoweTreeProvider.ssoLogin, ZoweTreeProvider.ssoLogout` Signed-off-by: Trae Yelovich --- .../abstract/TreeProvider.unit.test.ts | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts index 8c172cec19..885b767471 100644 --- a/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts @@ -24,12 +24,13 @@ import { Profiles } from "../../../src/Profiles"; import { imperative } from "@zowe/cli"; import * as globals from "../../../src/globals"; import { createUSSTree } from "../../../src/uss/USSTree"; -import { createIJobObject } from "../../../__mocks__/mockCreators/jobs"; +import { createIJobObject, createJobSessionNode } from "../../../__mocks__/mockCreators/jobs"; import { Job } from "../../../src/job/ZoweJobNode"; import { createJobsTree } from "../../../src/job/ZosJobsProvider"; import { SettingsConfig } from "../../../src/utils/SettingsConfig"; import { ZoweTreeProvider } from "../../../src/abstract/ZoweTreeProvider"; import { ZoweLogger } from "../../../src/utils/LoggerUtils"; +import { createDatasetSessionNode } from "../../../__mocks__/mockCreators/datasets"; async function createGlobalMocks() { const globalMocks = { @@ -54,6 +55,8 @@ async function createGlobalMocks() { mockGetProfileSetting: jest.fn(), mockProfilesForValidation: jest.fn(), mockProfilesValidationSetting: jest.fn(), + mockSsoLogin: jest.fn(), + mockSsoLogout: jest.fn(), ProgressLocation: jest.fn().mockImplementation(() => { return { Notification: 15, @@ -115,6 +118,8 @@ async function createGlobalMocks() { name: globalMocks.testProfile.name, setting: true, }), + ssoLogin: globalMocks.mockSsoLogin, + ssoLogout: globalMocks.mockSsoLogout, getProfileInfo: () => globalMocks.mockProfileInfo, fetchAllProfiles: jest.fn(() => { return [{ name: "sestest" }, { name: "profile1" }, { name: "profile2" }]; @@ -405,3 +410,103 @@ describe("Tree Provider Unit Tests - function renameNode", () => { spy.mockClear(); }); }); + +describe("Tree Provider Unit Tests - function ssoLogin", () => { + const createBlockMocks = () => { + const executeCommandSpy = jest.spyOn(vscode.commands, "executeCommand"); + return { + executeCommandSpy, + }; + }; + + const blockMocks = createBlockMocks(); + + afterEach(() => { + blockMocks.executeCommandSpy.mockClear(); + }); + + it("should only call zowe.ds.refreshAll for a Data Set session node", async () => { + const globalMocks = await createGlobalMocks(); + const dsNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(dsNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.uss.refreshAll for a USS session node", async () => { + const globalMocks = await createGlobalMocks(); + const ussNode = createUSSSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(ussNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.jobs.refreshAllJobs for a Job session node", async () => { + const globalMocks = await createGlobalMocks(); + const jobNode = createJobSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(jobNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + }); +}); + +describe("Tree Provider Unit Tests - function ssoLogout", () => { + const createBlockMocks = () => { + const executeCommandSpy = jest.spyOn(vscode.commands, "executeCommand"); + return { + executeCommandSpy, + }; + }; + + const blockMocks = createBlockMocks(); + + afterEach(() => { + blockMocks.executeCommandSpy.mockClear(); + }); + + afterAll(() => { + blockMocks.executeCommandSpy.mockRestore(); + }); + + it("should only call zowe.ds.refreshAll for a Data Set session node", async () => { + const globalMocks = await createGlobalMocks(); + const dsNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(dsNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.uss.refreshAll for a USS session node", async () => { + const globalMocks = await createGlobalMocks(); + const ussNode = createUSSSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(ussNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.jobs.refreshAllJobs for a Job session node", async () => { + const globalMocks = await createGlobalMocks(); + const jobNode = createJobSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(jobNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + }); +}); From 43f2b33c71f0c8710875ecaefdfb189575160179 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 8 Jun 2023 13:55:44 -0400 Subject: [PATCH 10/23] Fix Coverity issue with prop.label Signed-off-by: Timothy Johnson --- packages/zowe-explorer/src/dataset/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/src/dataset/actions.ts b/packages/zowe-explorer/src/dataset/actions.ts index 769b53d82a..d27f5ae6c8 100644 --- a/packages/zowe-explorer/src/dataset/actions.ts +++ b/packages/zowe-explorer/src/dataset/actions.ts @@ -608,7 +608,7 @@ async function handleUserSelection(): Promise { const qpItems = []; qpItems.push(new FilterItem({ text: `\u002B ${localizedStrings.allocString}`, show: true })); newDSProperties?.forEach((prop) => { - const propLabel = `\u270F ${prop?.label as string}`; + const propLabel = `\u270F ${prop.label as string}`; qpItems.push(new FilterItem({ text: propLabel, description: prop.value, show: true })); }); From a38db633e87430e16b3673791e0ca4fbca49fc61 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Thu, 8 Jun 2023 17:29:25 -0400 Subject: [PATCH 11/23] update CHANGELOGS with items that were in wrong location Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer-api/CHANGELOG.md | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 5 +---- packages/zowe-explorer/CHANGELOG.md | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 524c2c666e..eaa0891baf 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added a new type `DataSetAllocTemplate` for data set attributes. - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. +- Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) ## `2.8.1` @@ -29,7 +30,6 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added `Poller` utility singleton for handling continuous poll requests: see `Poller.addRequest, Poller.removeRequest` functions. - Added `pollData` optional function to `IZoweTree` class. - Added `ZosmfJesApi.downloadSingleSpool` optional api that can be used to download a single spool file in text or binary formats. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) -- Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Added new optional API, `IJes.downloadSingleSpool`, that can be used to download a single spool file in text or binary formats. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index 56ff5942e4..9fd2e84e14 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ### Bug fixes - Fixed an issue with mismatch etag, correcting error message sent to Zowe Explorer to trigger diff editor. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) +- Renamed instances of "dataset" to "data set" for consistency across Zowe Explorer. ## `2.8.1` @@ -19,10 +20,6 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum - Updated linter rules and addressed linter errors. [#2184](https://github.com/zowe/vscode-extension-for-zowe/issues/2184) - Added support for new setting `zowe.files.logsFolder.path` that can be used to override Zowe Explorer logs folder. [#2186](https://github.com/zowe/vscode-extension-for-zowe/issues/2186) -### Bug fixes - -- Renamed instances of "dataset" to "data set" for consistency across Zowe Explorer. - ## `2.7.0` ### New features and enhancements diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 39c1269ceb..27f0aae18d 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added option to save unique data set attributes as a template after allocation for future use. [#1425](https://github.com/zowe/vscode-extension-for-zowe/issues/1425) - Added "Cancel Job" feature for job nodes in Jobs tree view. [#2251](https://github.com/zowe/vscode-extension-for-zowe/issues/2251) - Enhanced ID generation for parent tree nodes to ensure uniqueness. +- Added support for custom credential manager extensions in Zowe Explorer [#2212](https://github.com/zowe/vscode-extension-for-zowe/issues/2212) ### Bug fixes @@ -18,6 +19,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed issue handling job files with unnamed steps. [#2315](https://github.com/zowe/vscode-extension-for-zowe/issues/2315) - Fixed issue with Windows path when uploading a file to a data set. [#2323](https://github.com/zowe/vscode-extension-for-zowe/issues/2323) - Fixed an issue where the mismatch etag error returned was not triggering the diff editor, resulting in possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) +- Fixed issue where refreshing views collapsed the respective trees. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) ## `2.8.2` @@ -48,7 +50,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added polling options for JES Spool files. Spool files can be polled manually by clicking on the spool file name or automatic polling can be set with `Start Polling` option in context menu. [#1952](https://github.com/zowe/vscode-extension-for-zowe/issues/1952) - Added the JOBS context menu option to download all spool files in binary format. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) - Added two new options to download a single spool file from a Job in plain text or in binary format. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) -- Added the option for secure credential storage to be enable in Theia environment. ### Bug fixes @@ -59,7 +60,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed redundant text in error messages that included the same error details twice. - Fixed issue where a spool file would open a duplicate tab when clicked between updates. [#1952](https://github.com/zowe/vscode-extension-for-zowe/issues/1952) - Fixed issue where a job search query would not expand the session node after it has been filtered. -- Fixed issue where refreshing views collapsed the respective trees. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed error message when no data sets found that match pattern. - Fixed secure credential storage not possible to enable in Theia. From fd1d83b8091b384bc4c62854724bb4af491c0d09 Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:43:12 -0400 Subject: [PATCH 12/23] prompt user for creds if auth error on ftp Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- .../src/profiles/ProfilesCache.ts | 10 ++++++---- .../src/vscode/ZoweVsCodeExtension.ts | 4 ++-- .../ZoweExplorerAbstractFtpApi.unit.test.ts | 20 ++++++++++--------- .../src/ZoweExplorerAbstractFtpApi.ts | 19 +++++------------- .../__tests__/__unit__/globals.unit.test.ts | 11 ++++++++++ .../zowe-explorer/src/utils/ProfilesUtils.ts | 12 +++++------ 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts index 4d8b5e27cf..857d67783f 100644 --- a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts +++ b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts @@ -104,12 +104,14 @@ export class ProfilesCache { */ public updateProfilesArrays(profileLoaded: zowe.imperative.IProfileLoaded): void { // update allProfiles array - const promptedTypeIndex = this.allProfiles.findIndex((profile) => profile.type === profileLoaded.type && profile.name === profileLoaded.name); + const promptedTypeIndex = this.allProfiles.findIndex( + (profile) => profile?.type === profileLoaded?.type && profile?.name === profileLoaded?.name + ); this.allProfiles[promptedTypeIndex] = profileLoaded; // checks if default, if true update defaultProfileByType - const defaultProf = this.defaultProfileByType.get(profileLoaded.type); - if (defaultProf.name === profileLoaded.name) { - this.defaultProfileByType.set(profileLoaded.type, profileLoaded); + const defaultProf = this.defaultProfileByType.get(profileLoaded?.type); + if (defaultProf?.name === profileLoaded?.name) { + this.defaultProfileByType.set(profileLoaded?.type, profileLoaded); } } diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 5436951cfd..407bfb6ea6 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -92,7 +92,7 @@ export class ZoweVsCodeExtension { loadProfile.profile.user = loadSession.user = creds[0]; loadProfile.profile.password = loadSession.password = creds[1]; - const upd = { profileName: loadProfile.name, profileType: loadProfile.type }; + const upd = { profileName: loadProfile?.name, profileType: loadProfile.type }; await ( await this.profilesCache.getProfileInfo() ).updateProperty({ ...upd, property: "user", value: creds[0], setSecure: options.secure }); @@ -132,7 +132,7 @@ export class ZoweVsCodeExtension { if (shouldSave || profInfo.usingTeamConfig) { // v1 write changes to the file, v2 autoStore value determines if written to file - const upd = { profileName: loadProfile.name, profileType: loadProfile.type }; + const upd = { profileName: loadProfile?.name, profileType: loadProfile.type }; await profInfo.updateProperty({ ...upd, property: "user", value: creds[0], setSecure }); await profInfo.updateProperty({ ...upd, property: "password", value: creds[1], setSecure }); } diff --git a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts index 1c3338152b..8a2aea9ec9 100644 --- a/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts +++ b/packages/zowe-explorer-ftp-extension/__tests__/__unit__/FtpApi/ZoweExplorerAbstractFtpApi.unit.test.ts @@ -14,6 +14,7 @@ import { AbstractFtpApi } from "../../../src/ZoweExplorerAbstractFtpApi"; import { FtpSession } from "../../../src/ftpSession"; import { FTPConfig, IZosFTPProfile } from "@zowe/zos-ftp-for-zowe-cli"; import { Gui, MessageSeverity } from "@zowe/zowe-explorer-api"; +import { imperative } from "@zowe/cli"; jest.mock("zos-node-accessor"); @@ -75,6 +76,10 @@ describe("AbstractFtpApi", () => { throw new Error("Failed: missing credentials"); }) ); + const imperativeError = new imperative.ImperativeError({ + msg: "Rest API failure with HTTP(S) status 401 Authentication error.", + errorCode: `${imperative.RestConstants.HTTP_STATUS_401}`, + }); const instance = new Dummy(); instance.profile = { profile: {}, @@ -85,14 +90,9 @@ describe("AbstractFtpApi", () => { try { await instance.getStatus(undefined, "zftp"); } catch (err) { - expect(Gui.errorMessage).toHaveBeenCalledWith( - "Invalid Credentials. Please ensure the username and password for undefined are valid or this may lead to a lock-out.", - { - logger: ZoweLogger, - } - ); expect(err).not.toBeUndefined(); expect(err).toBeInstanceOf(Error); + expect(err).toEqual(imperativeError); } }); @@ -104,6 +104,10 @@ describe("AbstractFtpApi", () => { }) ); const instance = new Dummy(); + const imperativeError = new imperative.ImperativeError({ + msg: "Rest API failure with HTTP(S) status 401 Authentication error.", + errorCode: `${imperative.RestConstants.HTTP_STATUS_401}`, + }); instance.profile = { profile: {}, message: undefined, @@ -113,11 +117,9 @@ describe("AbstractFtpApi", () => { try { await instance.getStatus(undefined, "zftp"); } catch (err) { - expect(Gui.errorMessage).toHaveBeenCalledWith("Something happened", { - logger: ZoweLogger, - }); expect(err).not.toBeUndefined(); expect(err).toBeInstanceOf(Error); + expect(err).toEqual(imperativeError); } }); diff --git a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerAbstractFtpApi.ts b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerAbstractFtpApi.ts index 153607b311..490a996d34 100644 --- a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerAbstractFtpApi.ts +++ b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerAbstractFtpApi.ts @@ -96,20 +96,11 @@ export abstract class AbstractFtpApi implements ZoweExplorerApi.ICommon { try { sessionStatus = await this.ftpClient(this.checkedProfile()); } catch (e) { - if (e instanceof Error) { - /* The errMsg should be consistent with the errMsg in ProfilesUtils.ts of zowe-explorer */ - if (e.message.indexOf("failed") !== -1 || e.message.indexOf("missing") !== -1) { - const errMsg = - "Invalid Credentials. Please ensure the username and password for " + - validateProfile?.name + - " are valid or this may lead to a lock-out."; - await Gui.errorMessage(errMsg, { logger: ZoweLogger }); - throw new Error(); - } else { - await Gui.errorMessage(e.message, { logger: ZoweLogger }); - throw new Error(); - } - } + const imperativeError = new imperative.ImperativeError({ + msg: "Rest API failure with HTTP(S) status 401 Authentication error.", + errorCode: `${imperative.RestConstants.HTTP_STATUS_401}`, + }); + throw imperativeError; } if (sessionStatus) { return "active"; diff --git a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts index 172be8208e..fe2e6372d4 100644 --- a/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/globals.unit.test.ts @@ -1,3 +1,14 @@ +/** + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright Contributors to the Zowe Project. + * + */ + import * as globals from "../../src/globals"; import { ZoweLogger } from "../../src/utils/LoggerUtils"; import * as SettingsConfig from "../../src/utils/SettingsConfig"; diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index e66abbd490..cf76b2915d 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -41,11 +41,11 @@ export async function errorHandling(errorDetails: Error | string, label?: string // Use util.inspect instead of JSON.stringify to handle circular references // eslint-disable-next-line @typescript-eslint/restrict-template-expressions ZoweLogger.error(`${errorDetails.toString()}\n` + util.inspect({ errorDetails, label, moreInfo }, { depth: null })); - - if (errorDetails instanceof imperative.ImperativeError && errorDetails.mDetails !== undefined) { - const httpErrorCode = errorDetails.mDetails.errorCode as unknown as number; + if (typeof errorDetails !== "string" && (errorDetails as imperative.ImperativeError)?.mDetails !== undefined) { + const imperativeError: imperative.ImperativeError = errorDetails as imperative.ImperativeError; + const httpErrorCode = Number(imperativeError.mDetails.errorCode); // open config file for missing hostname error - if (errorDetails.toString().includes("hostname")) { + if (imperativeError.toString().includes("hostname")) { const mProfileInfo = await Profiles.getInstance().getProfileInfo(); if (mProfileInfo.usingTeamConfig) { Gui.errorMessage(localize("errorHandling.invalid.host", "Required parameter 'host' must not be blank.")); @@ -72,8 +72,8 @@ export async function errorHandling(errorDetails: Error | string, label?: string label = label.substring(0, label.indexOf(" [")).trim(); } - if (errorDetails.mDetails.additionalDetails) { - const tokenError: string = errorDetails.mDetails.additionalDetails; + if (imperativeError.mDetails.additionalDetails) { + const tokenError: string = imperativeError.mDetails.additionalDetails; if (tokenError.includes("Token is not valid or expired.")) { if (isTheia()) { Gui.errorMessage(errToken).then(async () => { From 51fa6df54ff70661b2abda1957d37058ff8325ba Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:59:07 -0400 Subject: [PATCH 13/23] add changelog Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- packages/zowe-explorer-api/CHANGELOG.md | 2 ++ packages/zowe-explorer-ftp-extension/CHANGELOG.md | 1 + packages/zowe-explorer/CHANGELOG.md | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index b8ec7dee7c..0ff987e7dd 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -13,6 +13,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### Bug fixes +- Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). + ## `2.8.1` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index ba8d342f17..6ea90bf5c4 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ### Bug fixes - Fixed an issue with mismatch etag, correcting error message sent to Zowe Explorer to trigger diff editor. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) +- Fixed an issue with prompting for credentials by correcting the 401 error when throwing an auth error. [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334) ## `2.8.1` diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 39e5751ac8..bafd121719 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed issue where user was not able to view job spool file from jobs with duplicated step names because of duplicated local file name. [#2315](https://github.com/zowe/vscode-extension-for-zowe/issues/2315) - Fixed issue with Windows path when uploading file to data set. [#2323](https://github.com/zowe/vscode-extension-for-zowe/issues/2323) - Fixed an issue with mismatch etag error returned not triggering the diff editor and possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) +- Fixed an issue where user would not get prompted when authentication error is thrown. [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334) ## `2.8.2` From a1cd0d0c9708b46731fca3a6a492229e7855117e Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:58:46 -0400 Subject: [PATCH 14/23] remove duplicate CHANGELOG entry Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 27f0aae18d..640a54caac 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -43,7 +43,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added a new Zowe Explorer setting, `zowe.logger`, with a default setting of `INFO`. - Added an output channel, `Zowe Explorer`, for logging within VS Code's Output view. The log level is set by the new Zowe Explorer setting, `zowe.logger`. -- Added support for custom credential manager extensions in Zowe Explorer [#2212](https://github.com/zowe/vscode-extension-for-zowe/issues/2212) - Added a new setting `zowe.files.logsFolder.path` that can be used to override Zowe Explorer logs folder if default location is read-only. [#2186](https://github.com/zowe/vscode-extension-for-zowe/issues/2186) - Opening a dialog for Upload or Download of files will now open at the project level directory or the user's home directory if no project is opened. [#2203](https://github.com/zowe/vscode-extension-for-zowe/issues/2203) - Updated linter rules and addressed linter errors. [#2184](https://github.com/zowe/vscode-extension-for-zowe/issues/2184) From 8e4bdc8a22642c5e19810c2a9743538e9163d0bf Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 12 Jun 2023 09:02:07 -0400 Subject: [PATCH 15/23] add back CHANGELOG item mistakenly removed Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 640a54caac..8cb9d5fb8c 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -49,6 +49,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added polling options for JES Spool files. Spool files can be polled manually by clicking on the spool file name or automatic polling can be set with `Start Polling` option in context menu. [#1952](https://github.com/zowe/vscode-extension-for-zowe/issues/1952) - Added the JOBS context menu option to download all spool files in binary format. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) - Added two new options to download a single spool file from a Job in plain text or in binary format. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) +- Added the option for secure credential storage to be enable in Theia environment. ### Bug fixes From 95e5e8f59682c64a94d54dc41e7df582a5579ba5 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 12 Jun 2023 09:10:11 -0400 Subject: [PATCH 16/23] clarify CHANGELOG items dealing with new extender APi Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer-api/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index eaa0891baf..3e0d399839 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -29,8 +29,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added `ZoweVsCodeExtension.customLoggingPath` that can be used to get custom logging path defined in VS Code settings. [#2186](https://github.com/zowe/vscode-extension-for-zowe/issues/2186) - Added `Poller` utility singleton for handling continuous poll requests: see `Poller.addRequest, Poller.removeRequest` functions. - Added `pollData` optional function to `IZoweTree` class. -- Added `ZosmfJesApi.downloadSingleSpool` optional api that can be used to download a single spool file in text or binary formats. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) -- Added new optional API, `IJes.downloadSingleSpool`, that can be used to download a single spool file in text or binary formats. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) +- Created a new optional API, `IJes.downloadSingleSpool`, that can be used to download a single spool file in text or binary formats. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) +- Added capability to download a single spool file to in text or binary formats for zOSMF profiles by adopting the new api, `ZosmfJesApi.downloadSingleSpool`. [#2060](https://github.com/zowe/vscode-extension-for-zowe/issues/2060) ### Bug fixes From 8011ae7364307eae0f1ba7f9646f64e834c56af3 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 13 Jun 2023 09:59:04 -0400 Subject: [PATCH 17/23] Patchwork fix to use VSCode keytar Signed-off-by: Andrew W. Harn --- packages/zowe-explorer-api/src/profiles/ProfilesCache.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts index 857d67783f..ca57331240 100644 --- a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts +++ b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts @@ -16,6 +16,7 @@ import { URL } from "url"; import * as zowe from "@zowe/cli"; import { ZoweExplorerApi } from "./ZoweExplorerApi"; +import { getSecurityModules } from "../security"; // TODO: find a home for constants export const CONTEXT_PREFIX = "_"; @@ -72,8 +73,10 @@ export class ProfilesCache { this.cwd = cwd != null ? getFullPath(cwd) : undefined; } - public async getProfileInfo(): Promise { - const mProfileInfo = new zowe.imperative.ProfileInfo("zowe"); + public async getProfileInfo(envTheia = false): Promise { + const mProfileInfo = new zowe.imperative.ProfileInfo("zowe", { + credMgrOverride: zowe.imperative.ProfileCredentials.defaultCredMgrWithKeytar(() => getSecurityModules("keytar", envTheia)), + }); await mProfileInfo.readProfilesFromDisk({ homeDir: getZoweDir(), projectDir: this.cwd ?? undefined }); return mProfileInfo; } From bb861b108210a685ecc7e18f567d2b3336baf687 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 13 Jun 2023 10:17:40 -0400 Subject: [PATCH 18/23] Update changelog Signed-off-by: Andrew W. Harn --- packages/zowe-explorer-api/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 0ff987e7dd..5100b35835 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### Bug fixes +- Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). ## `2.8.1` From 877158f1887ff1886854b63d6e1fd74c9a176d4f Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 14 Jun 2023 10:51:08 -0400 Subject: [PATCH 19/23] Install known good version of Lerna in deployment workflow Signed-off-by: Timothy Johnson --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 3f4fa1a4ca..6ef66b00d2 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -34,8 +34,8 @@ jobs: with: node-version: '16.x' - - name: Install Yarn - run: npm install -g yarn + - name: Install Yarn and Lerna + run: npm install -g yarn lerna@6 - name: Build Source run: yarn From fa5c9dd69f5039e443b925062f3af8c4d55d5ffb Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Wed, 14 Jun 2023 15:05:13 +0000 Subject: [PATCH 20/23] Bump version to 2.9.0 [ci skip] Signed-off-by: zowe-robot --- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 2 +- packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 2 +- packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 2 +- packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 2 +- packages/zowe-explorer/package.json | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index f1e202e0dd..716395a692 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. -## TBD Release +## `2.9.0` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index 42e527efa7..34e30da200 100644 --- a/packages/eslint-plugin-zowe-explorer/package.json +++ b/packages/eslint-plugin-zowe-explorer/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-zowe-explorer", - "version": "2.9.0-SNAPSHOT", + "version": "2.9.0", "description": "Custom ESLint Rules for ZOWE Explorer", "keywords": [ "eslint", diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 80b6393b90..32d161a06d 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. -## TBD Release +## `2.9.0` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 3922fbea51..7680bead80 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zowe-explorer-api", - "version": "2.9.0-SNAPSHOT", + "version": "2.9.0", "description": "Extensibility API for Zowe Explorer.", "publisher": "Zowe", "author": "Zowe", diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index 0d07517a9a..f907177311 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. -## TBD Release +## `2.9.0` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index d8f7657f33..b3cdde93a5 100644 --- a/packages/zowe-explorer-ftp-extension/package.json +++ b/packages/zowe-explorer-ftp-extension/package.json @@ -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.9.0-SNAPSHOT", + "version": "2.9.0", "icon": "resources/zowe-ftp-color.png", "repository": { "url": "https://github.com/zowe/vscode-extension-for-zowe" @@ -48,7 +48,7 @@ }, "dependencies": { "@zowe/zos-ftp-for-zowe-cli": "2.1.2", - "@zowe/zowe-explorer-api": "2.9.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.0", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 9d79e9b44e..1756cd97f6 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. -## TBD Release +## `2.9.0` ### New features and enhancements diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 7262988fcd..48b8713e98 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -2,7 +2,7 @@ "name": "vscode-extension-for-zowe", "displayName": "%displayName%", "description": "%description%", - "version": "2.9.0-SNAPSHOT", + "version": "2.9.0", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.0-SNAPSHOT", + "eslint-plugin-zowe-explorer": "2.9.0", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.0", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 130540b0609c8ce5c158353ba40746d288df5ee8 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Wed, 14 Jun 2023 15:07:41 +0000 Subject: [PATCH 21/23] Bump version to 2.10.0-SNAPSHOT [ci skip] Signed-off-by: zowe-robot --- lerna.json | 2 +- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 6 ++++++ packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 6 ++++++ packages/zowe-explorer/package.json | 6 +++--- 9 files changed, 32 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index 1f87b0aa75..43b0635765 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.0", + "version": "2.10.0-SNAPSHOT", "command": { "version": { "forcePublish": true, diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 716395a692..bef26f8312 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.0` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index 34e30da200..ce30dbad4d 100644 --- a/packages/eslint-plugin-zowe-explorer/package.json +++ b/packages/eslint-plugin-zowe-explorer/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-zowe-explorer", - "version": "2.9.0", + "version": "2.10.0-SNAPSHOT", "description": "Custom ESLint Rules for ZOWE Explorer", "keywords": [ "eslint", diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 32d161a06d..cee55f45db 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.0` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 7680bead80..08415ea491 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zowe-explorer-api", - "version": "2.9.0", + "version": "2.10.0-SNAPSHOT", "description": "Extensibility API for Zowe Explorer.", "publisher": "Zowe", "author": "Zowe", diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index f907177311..1f87547e4a 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.0` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index b3cdde93a5..233ed59271 100644 --- a/packages/zowe-explorer-ftp-extension/package.json +++ b/packages/zowe-explorer-ftp-extension/package.json @@ -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.9.0", + "version": "2.10.0-SNAPSHOT", "icon": "resources/zowe-ftp-color.png", "repository": { "url": "https://github.com/zowe/vscode-extension-for-zowe" @@ -48,7 +48,7 @@ }, "dependencies": { "@zowe/zos-ftp-for-zowe-cli": "2.1.2", - "@zowe/zowe-explorer-api": "2.9.0", + "@zowe/zowe-explorer-api": "2.10.0-SNAPSHOT", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 1756cd97f6..0668897722 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.0` ### New features and enhancements diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 48b8713e98..4030b8b250 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -2,7 +2,7 @@ "name": "vscode-extension-for-zowe", "displayName": "%displayName%", "description": "%description%", - "version": "2.9.0", + "version": "2.10.0-SNAPSHOT", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.0", + "eslint-plugin-zowe-explorer": "2.10.0-SNAPSHOT", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.0", + "@zowe/zowe-explorer-api": "2.10.0-SNAPSHOT", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 8b7617858c0f9353d477882d377919c02930bafa Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 15 Jun 2023 08:10:41 -0400 Subject: [PATCH 22/23] Add condition to initialization test Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/profiles/ProfilesCache.unit.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts index b7b5567805..c091c46f63 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts @@ -14,6 +14,8 @@ import * as path from "path"; import * as zowe from "@zowe/cli"; import { ProfilesCache } from "../../../src/profiles/ProfilesCache"; import { ZoweExplorerApi } from "../../../src"; +import { getSecurityModules } from "../../../src/security/KeytarCredentialManager"; +jest.mock("../../../src/security/KeytarCredentialManager"); jest.mock("fs"); jest.mock("@zowe/cli", () => { @@ -124,6 +126,7 @@ describe("ProfilesCache", () => { const fakeLogger = { debug: jest.fn() }; const fakeZoweDir = zowe.getZoweDir(); const readProfilesFromDiskSpy = jest.spyOn(zowe.imperative.ProfileInfo.prototype, "readProfilesFromDisk"); + const defaultCredMgrWithKeytarSpy = jest.spyOn(zowe.imperative.ProfileCredentials, "defaultCredMgrWithKeytar"); afterEach(() => { jest.clearAllMocks(); @@ -132,6 +135,7 @@ describe("ProfilesCache", () => { it("getProfileInfo should initialize ProfileInfo API", async () => { const profInfo = await new ProfilesCache(fakeLogger as unknown as zowe.imperative.Logger, __dirname).getProfileInfo(); expect(readProfilesFromDiskSpy).toHaveBeenCalledTimes(1); + expect(defaultCredMgrWithKeytarSpy).toHaveBeenCalledTimes(1); const teamConfig = profInfo.getTeamConfig(); expect(teamConfig.appName).toBe("zowe"); expect(teamConfig.paths).toEqual([ From 9652fa911418be058df1169120dbff88ae33eb7a Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 15 Jun 2023 08:44:15 -0400 Subject: [PATCH 23/23] Removed unused import Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/profiles/ProfilesCache.unit.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts index c091c46f63..ac1aa333cb 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts @@ -14,8 +14,6 @@ import * as path from "path"; import * as zowe from "@zowe/cli"; import { ProfilesCache } from "../../../src/profiles/ProfilesCache"; import { ZoweExplorerApi } from "../../../src"; -import { getSecurityModules } from "../../../src/security/KeytarCredentialManager"; -jest.mock("../../../src/security/KeytarCredentialManager"); jest.mock("fs"); jest.mock("@zowe/cli", () => {