Skip to content

Commit

Permalink
Merge pull request #2467 from zowe/update/maintenance
Browse files Browse the repository at this point in the history
Update maintenance with 2.11.0 changes
  • Loading branch information
JillieBeanSim authored Sep 20, 2023
2 parents 755df8f + 03c9ced commit 9d147a8
Show file tree
Hide file tree
Showing 83 changed files with 8,720 additions and 224 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/zowe-explorer-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Zowe Explorer Samples CI

on:
push:
paths:
- .github/workflows/zowe-explorer-samples.yml
- packages/zowe-explorer-api/**
- samples/**
pull_request:
paths:
- .github/workflows/zowe-explorer-samples.yml
- packages/zowe-explorer-api/**
- samples/**

jobs:
samples-build:
runs-on: ubuntu-latest
timeout-minutes: 30

concurrency:
group: node-${{ matrix.node-version }}-ze-samples-ci-${{ github.ref }}
cancel-in-progress: true

strategy:
# Continue to run tests on the other systems if one fails
fail-fast: false
matrix:
node-version: [16.x, 18.x]

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# install yarn
- run: npm install -g yarn

- run: for dir in samples/*; do pushd $dir && yarn && yarn run compile && popd; done
shell: bash
1 change: 0 additions & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
registry: "https://registry.npmjs.org/"
"@zowe:registry" "https://zowe.jfrog.io/zowe/api/npm/npm-local-release/"
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.10.1-SNAPSHOT",
"version": "2.11.1-SNAPSHOT",
"command": {
"version": {
"forcePublish": true,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"private": true,
"workspaces": [
"packages/*"
"packages/*",
"packages/zowe-explorer/webviews/*"
],
"engines": {
"vscode": "^1.53.2"
Expand Down
6 changes: 6 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,12 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `2.11.0`

### New features and enhancements

### Bug fixes

## `2.10.0`

### New features and enhancements
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-zowe-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-zowe-explorer",
"version": "2.10.1-SNAPSHOT",
"version": "2.11.1-SNAPSHOT",
"description": "Custom ESLint Rules for ZOWE Explorer",
"keywords": [
"eslint",
Expand Down
9 changes: 0 additions & 9 deletions packages/samples/README.md

This file was deleted.

10 changes: 8 additions & 2 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

### Bug fixes

## `2.11.0`

### New features and enhancements

- Added optional `pendingActions` record to `IZoweTreeNode` to allow nodes to track pending promises.
- Added optional `requestFailed` variable to `IZoweDatasetTreeNode` to track the result of the last fetch request made on a data set node.
- Added optional `wasDoubleClicked` variable to `IZoweTreeNode` to track whether a node was double-clicked during an action.

### Bug fixes

- Bump `@zowe/secrets-for-zowe-sdk` to 7.18.3 to handle install errors gracefully and to allow running without MSVC redistributables.
- Bump `@zowe/secrets-for-zowe-sdk` to 7.18.4 to handle install errors gracefully and to allow running without MSVC redistributables.

## `2.10.0`

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

### Bug fixes

## `2.11.0`

### Bug fixes

- Bump `@zowe/zowe-explorer-api` to pick up latest, including `@zowe/secrets-for-zowe-sdk` 7.18.4 to handle install errors gracefully and to allow running without MSVC redistributables.

## `2.10.0`

### New features and enhancements
Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer-ftp-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Zowe",
"license": "EPL-2.0",
"description": "Adds zFTP support to Zowe Explorer demonstrating how to extend the Zowe Explorer using its extensibility API.",
"version": "2.10.1-SNAPSHOT",
"version": "2.11.1-SNAPSHOT",
"icon": "resources/zowe-ftp-color.png",
"repository": {
"url": "https://github.com/zowe/vscode-extension-for-zowe"
Expand Down Expand Up @@ -48,7 +48,7 @@
},
"dependencies": {
"@zowe/zos-ftp-for-zowe-cli": "2.1.2",
"@zowe/zowe-explorer-api": "2.10.1-SNAPSHOT",
"@zowe/zowe-explorer-api": "2.11.1-SNAPSHOT",
"tmp": "0.2.1"
},
"devDependencies": {
Expand Down
13 changes: 12 additions & 1 deletion packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### Bug fixes

## `2.11.0`

### New features and enhancements

- Allow deleting migrated datasets [#2447](https://github.com/zowe/vscode-extension-for-zowe/issues/2447)

### Bug fixes

- Fixed issue with favorited Job filter search. [#2440](https://github.com/zowe/vscode-extension-for-zowe/issues/2440)
- Remove the 'Show Attributes' context menu action for migrated datasets. [#2033](https://github.com/zowe/vscode-extension-for-zowe/issues/2033)
- Fixed issue with endless credential prompt loop when logging out. [#2262](https://github.com/zowe/vscode-extension-for-zowe/issues/2262)
- Bump `@zowe/secrets-for-zowe-sdk` to 7.18.3 to handle install errors gracefully and to allow running without MSVC redistributables.
- Bump `@zowe/secrets-for-zowe-sdk` to 7.18.4 to handle install errors gracefully and to allow running without MSVC redistributables.
- Fixed issue where data set content does not always appear as soon as the editor is opened. [#2427](https://github.com/zowe/vscode-extension-for-zowe/issues/2427)
- Adjust scope of "Security: Secure Credentials Enabled" setting to `machine-overridable` so it appears again in certain cloud IDEs.
- Fixed issue where disabling "Automatic Profile Validation" caused the search prompts to stop appearing for all tree views. [#2454](https://github.com/zowe/vscode-extension-for-zowe/issues/2454)

## `2.10.0`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
undefined,
globalMocks.imperativeProfile
);
const testMigrNode = new ZoweDatasetNode(
"HLQ.TEST.MIGR",
vscode.TreeItemCollapsibleState.None,
globalMocks.datasetSessionNode,
globalMocks.session,
globals.DS_MIGRATED_FILE_CONTEXT,
undefined,
globalMocks.imperativeProfile
);
const testMemberNode = new ZoweDatasetNode(
"MEMB",
vscode.TreeItemCollapsibleState.None,
Expand Down Expand Up @@ -447,6 +456,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
testFavoritedNode.children.push(testFavMemberNode);
globalMocks.datasetSessionNode.children.push(testDatasetNode);
globalMocks.datasetSessionNode.children.push(testVsamNode);
globalMocks.datasetSessionNode.children.push(testMigrNode);
globalMocks.datasetSessionFavNode.children.push(testFavoritedNode);

mocked(vscode.window.withProgress).mockImplementation((progLocation, callback) => {
Expand All @@ -466,6 +476,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
testDatasetTree,
testDatasetNode,
testVsamNode,
testMigrNode,
testMemberNode,
testFavMemberNode,
testFavoritedNode,
Expand Down Expand Up @@ -518,6 +529,20 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
expect(mocked(Gui.showMessage)).toBeCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testVsamNode.getLabel()}`);
});

it("Should delete one migrated dataset", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks(globalMocks);

const selectedNodes = [blockMocks.testMigrNode];
const treeView = createTreeView(selectedNodes);
blockMocks.testDatasetTree.getTreeView.mockReturnValueOnce(treeView);
globalMocks.mockShowWarningMessage.mockResolvedValueOnce("Delete");

await dsActions.deleteDatasetPrompt(blockMocks.testDatasetTree);

expect(mocked(Gui.showMessage)).toBeCalledWith(`The following 1 item(s) were deleted: ${blockMocks.testMigrNode.getLabel()}`);
});

it("Should delete two datasets", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks(globalMocks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,6 @@ describe("ZosJobsProvider unit tests - Function getChildren", () => {

expect(elementGetChildrenSpy).toHaveBeenCalledTimes(1);
});
it("Tests that getChildren returns the empty array if status of profile is unverified", async () => {
const globalMocks = await createGlobalMocks();
jest.spyOn(Profiles.getInstance(), "checkCurrentProfile").mockResolvedValueOnce({ status: "unverified" } as any);
const blockMocks = createBlockMocks(globalMocks);
mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView);
const testTree = new ZosJobsProvider();
testTree.mSessionNodes.push(blockMocks.jobSessionNode);
testTree.mSessionNodes[1].dirty = true;

await expect(testTree.getChildren(testTree.mSessionNodes[1])).resolves.toEqual([]);
});
});

describe("ZosJobsProvider unit tests - Function initializeFavChildNodeForProfile", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ describe("ZosJobsProvider - getJobs", () => {
value: () => ({
getJobsByParameters: false,
getJobsByOwnerAndPrefix: () => ["test"],
getSession: () => globalMocks.testSession,
}),
});
jest.spyOn(Gui, "warningMessage").mockImplementation();
Expand Down
90 changes: 0 additions & 90 deletions packages/zowe-explorer/__tests__/__unit__/job/actions.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,6 @@ describe("Jobs Actions Unit Tests - Function refreshJobsServer", () => {
it("Checking common execution of function", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
const job = new Job(
"jobtest",
vscode.TreeItemCollapsibleState.Expanded,
Expand All @@ -1052,75 +1050,11 @@ describe("Jobs Actions Unit Tests - Function refreshJobsServer", () => {
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValueOnce(blockMocks.session.ISession);

await jobActions.refreshJobsServer(job, blockMocks.testJobTree);

expect(blockMocks.testJobTree.checkCurrentProfile).toHaveBeenCalledWith(job);
expect(blockMocks.testJobTree.refreshElement).toHaveBeenCalledWith(job);
});
it("Checking common execution of function with Unverified", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
Object.defineProperty(Profiles, "getInstance", {
value: jest.fn(() => {
return {
checkCurrentProfile: blockMocks.mockCheckCurrentProfile.mockReturnValueOnce({
name: blockMocks.imperativeProfile.name,
status: "unverified",
}),
validProfile: ValidProfileEnum.UNVERIFIED,
};
}),
});
const job = new Job(
"jobtest",
vscode.TreeItemCollapsibleState.Expanded,
null,
blockMocks.session,
blockMocks.iJob,
blockMocks.imperativeProfile
);
job.contextValue = globals.JOBS_SESSION_CONTEXT;
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValueOnce(blockMocks.session.ISession);

await jobActions.refreshJobsServer(job, blockMocks.testJobTree);

expect(blockMocks.testJobTree.checkCurrentProfile).toHaveBeenCalledWith(job);
expect(blockMocks.testJobTree.refreshElement).toHaveBeenCalledWith(job);
});
it("Checking failed attempt to execute the function", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
const job = new Job(
"jobtest",
vscode.TreeItemCollapsibleState.Expanded,
null,
blockMocks.session,
blockMocks.iJob,
blockMocks.imperativeProfile
);
job.contextValue = globals.JOBS_SESSION_CONTEXT;
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValueOnce(blockMocks.session.ISession);
blockMocks.testJobTree.checkCurrentProfile.mockImplementationOnce(() => {
throw Error("test");
});

try {
await jobActions.refreshJobsServer(job, blockMocks.testJobTree);
} catch (err) {
expect(err).toEqual(Error("test"));
}

expect(blockMocks.testJobTree.refreshElement).not.toHaveBeenCalled();
});
it("Checking execution of function with credential prompt", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

blockMocks.profileInstance.promptCredentials.mockReturnValue(["fake", "fake", "fake"]);
mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
const job = new Job(
"jobtest",
vscode.TreeItemCollapsibleState.Expanded,
Expand All @@ -1133,30 +1067,6 @@ describe("Jobs Actions Unit Tests - Function refreshJobsServer", () => {
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValueOnce(blockMocks.session.ISession);

await jobActions.refreshJobsServer(job, blockMocks.testJobTree);

expect(blockMocks.testJobTree.checkCurrentProfile).toHaveBeenCalledWith(job);
expect(blockMocks.testJobTree.refreshElement).toHaveBeenCalledWith(job);
});
it("Checking execution of function with credential prompt for favorite", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

blockMocks.profileInstance.promptCredentials.mockReturnValue(["fake", "fake", "fake"]);
mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
const job = new Job(
"jobtest",
vscode.TreeItemCollapsibleState.Expanded,
null,
blockMocks.session,
blockMocks.iJob,
blockMocks.imperativeProfile
);
job.contextValue = globals.JOBS_SESSION_CONTEXT + globals.FAV_SUFFIX;
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValueOnce(blockMocks.session.ISession);

await jobActions.refreshJobsServer(job, blockMocks.testJobTree);

expect(blockMocks.testJobTree.checkCurrentProfile).toHaveBeenCalledWith(job);
expect(blockMocks.testJobTree.refreshElement).toHaveBeenCalledWith(job);
});
});
Expand Down
Loading

0 comments on commit 9d147a8

Please sign in to comment.