Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
Browse files Browse the repository at this point in the history
…archfor

Signed-off-by: Andrew W. Harn <[email protected]>
  • Loading branch information
awharn committed Nov 21, 2024
2 parents 53e2d30 + 66f4592 commit 4a739b8
Show file tree
Hide file tree
Showing 73 changed files with 1,055 additions and 990 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/zowe-explorer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
# install pnpm
- run: npm install -g pnpm@8

- run: pnpm config set network-timeout 60000 && pnpm install && pnpm build
- run: pnpm config set network-timeout 60000 && pnpm install

- run: pnpm build
id: build

- run: pnpm test
env:
Expand All @@ -55,22 +58,24 @@ jobs:
id: unlock-keyring
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
uses: t1m0thyj/unlock-keyring@v1

- name: Integration tests
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
run: xvfb-run pnpm test:integration --exclude "Activation.feature"
working-directory: packages/zowe-explorer

- name: Upload test results
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
with:
name: zowe-explorer-results
path: packages/zowe-explorer/results/
path: |
packages/zowe-explorer/results/
packages/zowe-explorer/__tests__/__integration__/bdd/results/
- name: Upload API test results
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
with:
name: zowe-explorer-api-results
path: packages/zowe-explorer-api/results/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@types/jest": "^29.2.3",
"@types/mocha": "^10.0.1",
"@types/node": "^18.19.14",
"@types/node": "^20.14.8",
"@types/vscode": "^1.73.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
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

## `3.0.3`

## `3.0.2`

## `3.0.1`
Expand Down
16 changes: 15 additions & 1 deletion packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

- Update Zowe SDKs to `8.2.0` to get the latest enhancements from Imperative.
- Update Zowe SDKs to `8.8.4` to get the latest enhancements from the z/OS Files SDK. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added new `searchDataSets` API to provide the ability to search all data sets and PDS members that match a pattern for a string. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added optional `getLocalStorage` function to the `IApiExplorerExtender` interface to expose local storage access to Zowe Explorer extenders. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)

### Bug fixes

## `3.0.3`

### New features and enhancements

- Update Zowe SDKs to `8.8.2` to get the latest enhancements from Imperative. [#3296](https://github.com/zowe/zowe-explorer-vscode/pull/3296)

### Bug fixes

- Fixed an issue to review inconsistent capitalization across translation strings. [#2935](https://github.com/zowe/zowe-explorer-vscode/issues/2935)

## `3.0.3`

### Bug fixes

- Fixed an issue where the `responseTimeout` profile property was ignored for z/OSMF MVS and USS API calls. [#3225](https://github.com/zowe/zowe-explorer-vscode/issues/3225)
- Fixed an issue where the assignment of the `profile` property in `ZoweTreeNode.setProfileToChoice` caused references to that object to break elsewhere. [#3289](https://github.com/zowe/zowe-explorer-vscode/issues/3289)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ describe("_handleConflict", () => {
});
});
describe("_handleError", () => {
it("calls ErrorCorrelator.displayError to display error to user - no options provided", async () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((res, rej) => {}));
it("calls ErrorCorrelator.displayError to display error to user - no options provided", () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((_res, _rej) => {}));
const prov = new (BaseProvider as any)();
prov._handleError(new Error("example"));
expect(displayErrorMock).toHaveBeenCalledWith(ZoweExplorerApiType.All, new Error("example"), {
Expand All @@ -555,8 +555,8 @@ describe("_handleError", () => {
templateArgs: undefined,
});
});
it("calls ErrorCorrelator.displayError to display error to user - options provided", async () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((res, rej) => {}));
it("calls ErrorCorrelator.displayError to display error to user - options provided", () => {
const displayErrorMock = jest.spyOn(ErrorCorrelator.prototype, "displayError").mockReturnValue(new Promise((_res, _rej) => {}));
const prov = new (BaseProvider as any)();
prov._handleError(new Error("example"), {
additionalContext: "Failed to list data sets",
Expand Down
8 changes: 8 additions & 0 deletions packages/zowe-explorer-api/src/extend/IApiExplorerExtender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import * as imperative from "@zowe/imperative";
import { ProfilesCache } from "../profiles/ProfilesCache";
import { ErrorCorrelator } from "../utils/ErrorCorrelator";
import { ILocalStorageAccess } from "./ILocalStorageAccess";

/**
* This interface can be used by other VS Code Extensions to access an alternative
Expand Down Expand Up @@ -53,4 +54,11 @@ export interface IApiExplorerExtender {
* provide tips or additional resources for errors.
*/
getErrorCorrelator?(): ErrorCorrelator;

/**
* Allows extenders to access Zowe Explorer's local storage values. Retrieve a list of
* readable and writable keys by calling the `getReadableKeys, getWritableKeys` functions
* on the returned instance.
*/
getLocalStorage?(): ILocalStorageAccess;
}
38 changes: 38 additions & 0 deletions packages/zowe-explorer-api/src/extend/ILocalStorageAccess.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* 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.
*
*/

export interface ILocalStorageAccess {
/**
* @returns The list of readable keys from the access facility
*/
getReadableKeys(): string[];

/**
* @returns The list of writable keys from the access facility
*/
getWritableKeys(): string[];

/**
* Retrieve the value from local storage for the given key.
* @param key A readable key
* @returns The value if it exists in local storage, or `undefined` otherwise
* @throws If the extender does not have appropriate read permissions for the given key
*/
getValue<T>(key: string): T;

/**
* Set a value in local storage for the given key.
* @param key A writable key
* @param value The new value for the given key to set in local storage
* @throws If the extender does not have appropriate write permissions for the given key
*/
setValue<T>(key: string, value: T): Thenable<void>;
}
1 change: 1 addition & 0 deletions packages/zowe-explorer-api/src/extend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
*/

export * from "./IApiExplorerExtender";
export * from "./ILocalStorageAccess";
export * from "./IRegisterClient";
export * from "./MainframeInteraction";
8 changes: 4 additions & 4 deletions packages/zowe-explorer-api/src/utils/ErrorCorrelator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ export class ErrorCorrelator {
errorCode: "401",
matches: ["Token is not valid or expired"],
summary:
// eslint-disable-next-line max-len
"Your connection is no longer active for profile {{profileName}}. Please log in to an authentication service to restore the connection.",
"Your connection is no longer active for profile {{profileName}}. " +
"Please log in to an authentication service to restore the connection.",
},
{
errorCode: "401",
matches: ["Username or password are not valid or expired", "All configured authentication methods failed"],
summary:
// eslint-disable-next-line max-len
"Invalid credentials for profile {{profileName}}. Please ensure the username and password are valid or this may lead to a lock-out.",
"Invalid credentials for profile {{profileName}}. " +
"Please ensure the username and password are valid or this may lead to a lock-out.",
},
],
},
Expand Down
7 changes: 7 additions & 0 deletions packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### New features and enhancements

- Updated Zowe SDKs to `8.8.4` for technical currency. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)

### Bug fixes

## `3.0.3`

### Bug fixes

- Fixed issue where the MVS API `putContents` function did not support PDS members when the member was not specified in the data set name. [#3305](https://github.com/zowe/zowe-explorer-vscode/issues/3305)
Expand Down Expand Up @@ -42,6 +48,7 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum
- Fix Windows-specific hangs when saving members that contain JCL via the FTP extension. Thanks @tiantn & @std4lqi. [#2533](https://github.com/zowe/vscode-extension-for-zowe/issues/2533)
- Removed outdated vscode-nls webpack plug-in [#2253](https://github.com/zowe/vscode-extension-for-zowe/issues/2253)
- 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)
- Updated Zowe SDKs to `8.8.2` for technical currency. [#3296](https://github.com/zowe/zowe-explorer-vscode/pull/3296)
- Updated additional dependencies for technical currency purposes.

## `3.0.0-next.202409251932`
Expand Down
3 changes: 2 additions & 1 deletion packages/zowe-explorer/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ results
scripts
src/webviews/dist
l10n/bundle.l10n.json
__tests__/__common__/.wdio-vscode-service
__tests__/__common__/.wdio-vscode-service
__tests__/__integration__/bdd/resources
19 changes: 15 additions & 4 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

- Update Zowe SDKs to `8.2.0` to get the latest enhancements from Imperative.
- Updated Zowe SDKs to `8.8.4` for technical currency. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added expired JSON web token detection for profiles in each tree view (Data Sets, USS, Jobs). When a user performs a search on a profile, they are prompted to log in if their token expired. [#3175](https://github.com/zowe/zowe-explorer-vscode/issues/3175)
- Add a data set or USS resource to a virtual workspace with the new "Add to Workspace" context menu option. [#3265](https://github.com/zowe/zowe-explorer-vscode/issues/3265)
- Power users and developers can now build links to efficiently open mainframe resources in Zowe Explorer. Use the **Copy External Link** option in the context menu to get the URL for a data set or USS resource, or create a link in the format `vscode://Zowe.vscode-extension-for-zowe?<ZoweResourceUri>`. For more information on building resource URIs, see the [FileSystemProvider wiki article](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider#file-paths-vs-uris). [#3271](https://github.com/zowe/zowe-explorer-vscode/pull/3271)
- Implemented more user-friendly error messages for API or network errors within Zowe Explorer. [#3243](https://github.com/zowe/zowe-explorer-vscode/pull/3243)
- Use the "Troubleshoot" option for certain errors to obtain additional context, tips, and resources for how to resolve the errors. [#3243](https://github.com/zowe/zowe-explorer-vscode/pull/3243)
- Easily search for data in filtered data sets and partitioned data sets with the new `Search Filtered Data Sets` and `Search PDS Members` functionality. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Allow extenders to add context menu actions to a top level node, i.e. data sets, USS, Jobs, by encoding the profile type in the context value. [#3309](https://github.com/zowe/zowe-explorer-vscode/pull/3309)
- You can now add multiple partitioned data sets or USS directories to your workspace at once using the "Add to Workspace" feature. [#3324](https://github.com/zowe/zowe-explorer-vscode/issues/3324)
- Exposed read and write access to local storage keys for Zowe Explorer extenders. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)

### Bug fixes

- Fixed an issue during initialization where the error dialog shown for a broken team configuration file was missing the "Show Config" action. [#3322](https://github.com/zowe/zowe-explorer-vscode/pull/3322)
- Fixed an issue where editing a team config file or updating secrets in the OS credential vault could trigger multiple events for a single action. [#3296](https://github.com/zowe/zowe-explorer-vscode/pull/3296)
- Fixed an issue where opening a PDS member after renaming an expanded PDS resulted in an error. [#3314](https://github.com/zowe/zowe-explorer-vscode/issues/3314)
- Fixed issue where persistent settings defined at the workspace level were migrated into global storage rather than workspace-specific storage. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)

## `3.0.3`

### Bug fixes

Expand All @@ -25,11 +37,10 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Reduced the number of MVS API calls performed by `vscode.workspace.fs.readFile` when fetching the contents of a data set entry. [#3278](https://github.com/zowe/zowe-explorer-vscode/issues/3278)
- Fixed an issue to review inconsistent capitalization across translation strings. [#2935](https://github.com/zowe/zowe-explorer-vscode/issues/2935)
- Updated the test for the default credential manager for better compatibility with Cloud-based platforms such as Eclipse Che and Red Hat OpenShift Dev Spaces. [#3297](https://github.com/zowe/zowe-explorer-vscode/pull/3297)
- Fixed an issue where opening a PDS member after renaming an expanded PDS resulted in an error. [#3314](https://github.com/zowe/zowe-explorer-vscode/issues/3314)
- Fixed issue where users were not prompted to enter credentials if a 401 error was encountered when opening files, data sets or spools in the editor. [#3197](https://github.com/zowe/zowe-explorer-vscode/issues/3197)
- Fixed issue where profile credential updates or token changes were not reflected within the filesystem. [#3289](https://github.com/zowe/zowe-explorer-vscode/issues/3289)
- Fixed issue to update the success message when changing authentication from token to basic through the 'Change Authentication' option.
- Fixed an issue where fetching a USS file using `UssFSProvider.stat()` with a `fetch=true` query would cause Zowe Explorer to get stuck in an infinite loop.
- Fixed issue to update the success message when changing authentication from token to basic through the 'Change Authentication' option. [#3316](https://github.com/zowe/zowe-explorer-vscode/pull/3316)
- Fixed an issue where fetching a USS file using `UssFSProvider.stat()` with a `fetch=true` query would cause Zowe Explorer to get stuck in an infinite loop. [#3321](https://github.com/zowe/zowe-explorer-vscode/pull/3321)

## `3.0.2`

Expand Down
4 changes: 4 additions & 0 deletions packages/zowe-explorer/__tests__/__common__/base.wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/

import type { Options } from "@wdio/types";
import { tmpdir } from "os";
import { join as joinPath } from "path";

export const baseConfig: Partial<Options.Testrunner> = {
//
Expand Down Expand Up @@ -207,3 +209,5 @@ export const baseConfig: Partial<Options.Testrunner> = {
// afterAssertion: function(params) {
// }
};

export const dataDir = joinPath(process.platform === "darwin" ? tmpdir() : __dirname, ".wdio-vscode-service", "data");
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ async function setFilterForProfile(world: IWorld, profileNode: TreeItem, tree: s

if (isJobs) {
// Jobs
const createFilterSelector = await quickPick.findItem("plus Create job search filter");
const createFilterSelector = await quickPick.findItem("$(plus) Create job search filter");
await expect(createFilterSelector).toBeClickable();
await createFilterSelector.click();
const submitSelector = await quickPick.findItem("check Submit this query");
const submitSelector = await quickPick.findItem("$(check) Submit this query");
await expect(submitSelector).toBeClickable();
await submitSelector.click();
} else {
// Data sets or USS
if (await quickPick.hasOptions()) {
// Only click the "Create a new filter" button if there are existing filters and the option is presented
const filterLabel = isUss
? "plus Create a new filter"
: "plus Create a new filter. For example: HLQ.*, HLQ.aaa.bbb, HLQ.ccc.ddd(member)";
? "$(plus) Create a new filter"
: "$(plus) Create a new filter. For example: HLQ.*, HLQ.aaa.bbb, HLQ.ccc.ddd(member)";

const createFilterSelector = await quickPick.findItem(filterLabel);
await expect(createFilterSelector).toBeClickable();
Expand Down
3 changes: 2 additions & 1 deletion packages/zowe-explorer/__tests__/__e2e__/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { Options } from "@wdio/types";
import { existsSync } from "fs";
import { emptyDirSync, mkdirpSync } from "fs-extra";
import { join as joinPath, relative as relativePath } from "path";
import { baseConfig } from "../__common__/base.wdio.conf";
import { baseConfig, dataDir } from "../__common__/base.wdio.conf";

if (process.env.ZOWE_TEST_DIR) {
const homeDir = (process.env["ZOWE_CLI_HOME"] = joinPath(__dirname, relativePath(__dirname, process.env.ZOWE_TEST_DIR)));
Expand Down Expand Up @@ -99,6 +99,7 @@ export const config: Options.Testrunner = {
"wdio:vscodeOptions": {
// points to directory where extension package.json is located
extensionPath: joinPath(__dirname, "..", ".."),
storagePath: dataDir,
// optional VS Code settings
userSettings: {
"editor.fontSize": 14,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Scenario: User opens and dismisses the Team Configuration quick pick

# Scenario: User creates a global Team Configuration file
# Given a user who is looking at the Add Config quick pick
# When a user selects "Create a new Team Configuration file"
# When a user selects 'Create a new Team Configuration file'
# Then a new configuration file will be created and opened in the editor
# Then it will ask the user for the desired config location
# When the user selects the global option
# Then it will open the config in the editor

Scenario: User edits Team Configuration file
Given a user who is looking at the Add Config quick pick
When a user selects "Edit Team Configuration File"
When a user selects 'Edit Team Configuration File'
Then it will open the config in the editor

Scenario Outline: User wants to add a profile to the tree views
Expand All @@ -23,7 +23,7 @@ Scenario Outline: User wants to add a profile to the tree views
Then it will prompt the user to add the profile to one or all trees
When a user selects <opt> to apply to all trees
Then it will add a tree item for the profile to the correct trees

Examples:
| opt |
| No |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Feature: Update credentials for z/OSMF profile

Scenario: Prompt for missing <authType> credentials
Given a user who has profile with <authType> auth in team config
And a user who is looking at the Zowe Explorer tree views
And the user has a profile in their Data Sets tree
Given a user who is looking at the Zowe Explorer tree views
And the user has a <authType> profile in their Data Sets tree
When a user clicks search button for the profile
Then the user will be prompted for <authType> credentials
And the profile node icon will be marked as inactive
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invalidJson
Loading

0 comments on commit 4a739b8

Please sign in to comment.