Skip to content

Commit

Permalink
Merge pull request #2995 from zowe/port-2.16.3
Browse files Browse the repository at this point in the history
Port 2.16.3 to main
  • Loading branch information
t1m0thyj authored Jul 12, 2024
2 parents a2cff84 + e44bd1d commit 141289c
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 52 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/theia-zowe-explorer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ jobs:
run: yarn workspace vscode-extension-for-zowe package

- name: Create extension install directory
run: mkdir -p temp/plugins && chmod -R 777 temp
run: mkdir -p temp/extensions && chmod -R 777 temp

- name: Copy vsix to theia folder
run: cp dist/*.vsix temp/plugins
run: cp dist/*.vsix temp/extensions

# Verify vsix
- run: ls -la temp/plugins
- run: ls -la temp/extensions

- name: Start Theia
run: docker run --name theia --init -d -p 3000:3000 --user theia -v "${PWD}/temp/plugins/:/home/theia/plugins" ghcr.io/zowe/zowe-sample-dockerfiles-ze-theia-slim
run: docker run --name theia --init -d -p 3000:3000 --user theia -v "${PWD}/temp/:/home/theia/.theia" ghcr.io/zowe/zowe-sample-dockerfiles-ze-theia-slim
# NOTE(Kelosky): alternatively, we could run docker via something like this; however, we cannot hot reload
# hosted VS Code extensions after theia is started (at least at the time this was written).
# services:
Expand All @@ -61,14 +61,11 @@ jobs:
# # --health-cmd "curl --fail http://localhost:3000 || exit 1" --health-interval=5s --health-timeout=5s --health-retries 60
# options: --init

- name: Allow some time for the theia server to load
run: sleep 30s
- name: Verify Theia accessible
run: curl --fail --max-time 5 --retry 12 --retry-delay 5 --retry-all-errors http://localhost:3000

- name: Verify plugin loaded
run: docker exec -i theia ls -la /home/theia/plugins

- name: Verify Theia accessible
run: curl --fail http://localhost:3000
run: docker exec -i theia ls -la /home/theia/.theia/deployedPlugins

- name: Prep integration test files
run: yarn workspace vscode-extension-for-zowe build:integration
Expand Down
6 changes: 2 additions & 4 deletions packages/eslint-plugin-zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `2.16.2`

### New features and enhancements
## `2.16.3`

### Bug fixes
## `2.16.2`

## `2.16.1`

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

- Removed `handlebars` dependency in favor of `mustache` for technical currency purposes. [#2974](https://github.com/zowe/zowe-explorer-vscode/pull/2974)

## `2.16.3`

## `2.16.2`

### Bug fixes
Expand Down
2 changes: 2 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,8 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### Bug fixes

## `2.16.3`

## `2.16.2`

### Bug fixes
Expand Down
8 changes: 7 additions & 1 deletion packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

- To add the ability to open a Favorited Job Search under Favorites [#2630](https://github.com/zowe/zowe-explorer-vscode/pull/2930)

### Bug fixes

- To add the ability to open a Favorited Job Search under Favorites [#2630](https://github.com/zowe/zowe-explorer-vscode/pull/2930)
## `2.16.3`

### Bug fixes

- Fixed issue where USS files could not be submitted as JCL. [#2991](https://github.com/zowe/zowe-explorer-vscode/issues/2991)

## `2.16.2`

Expand Down
8 changes: 4 additions & 4 deletions packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

export const TheiaLocator = {
theiaUrl: "http://localhost:3000",
zoweExplorerxId: "shell-tab-plugin-view-container:zowe",
zoweExplorerxId: "shell-tab-plugin-view-container:workbench.view.extension.zowe",
};

export const DatasetsLocators = {
datasetTabId: "plugin-view-container:zowe--plugin-view:zowe.ds.explorer",
datasetTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.ds.explorer",
datasetTabXpath: "//span[@title='Data Sets']",
datasetsPanelId: "plugin-view:zowe.ds.explorer",
datasetsAddSessionId: "zowe.ds.addSession-as-tabbar-toolbar-item",
Expand All @@ -32,7 +32,7 @@ export const DatasetsLocators = {
};

export const UssLocators = {
ussTabId: "plugin-view-container:zowe--plugin-view:zowe.uss.explorer",
ussTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.uss.explorer",
ussTabXpath: "//span[@title='Unix System Services (USS)']",
ussPanelId: "plugin-view:zowe.uss.explorer",
ussAddSessionId: "zowe.uss.addSession-as-tabbar-toolbar-item",
Expand All @@ -48,7 +48,7 @@ export const UssLocators = {
};

export const JobsLocators = {
jobTabId: "plugin-view-container:zowe--plugin-view:zowe.jobs.explorer",
jobTabId: "plugin-view-container:workbench.view.extension.zowe--plugin-view:zowe.jobs.explorer",
jobTabXpath: "//span[@title='Jobs']",
jobsPanelId: "zowe.jobs.explorer",
jobsAddSessionId: "zowe.jobs.addJobsSession-as-tabbar-toolbar-item",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function OpenTheiaInChrome() {
}

export async function clickOnZoweExplorer() {
await driverChrome.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId))).click();
await driverChrome.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId)), WAITTIME).click();
}

export async function clickOnFavoriteTabInDatasets() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function OpenTheiaInFirefox() {
}

export async function clickOnZoweExplorer() {
driverFirefox.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId))).click();
driverFirefox.wait(until.elementLocated(By.id(TheiaLocator.zoweExplorerxId)), WAITTIME).click();
}

export async function clickOnDatasetsTab() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { ProfileManagement } from "../../../src/utils/ProfileManagement";
import { TreeProviders } from "../../../src/shared/TreeProviders";
import { mocked } from "../../../__mocks__/mockUtils";
import { TreeViewUtils } from "../../../src/utils/TreeViewUtils";
import * as path from "path";

const activeTextEditorDocument = jest.fn();

Expand Down Expand Up @@ -423,8 +424,6 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
const imperativeProfile = createIProfile();
const datasetSessionNode = createDatasetSessionNode(session, imperativeProfile);
const textDocument = createTextDocument("HLQ.TEST.AFILE(mem)", datasetSessionNode);
(textDocument.languageId as any) = "jcl";
(textDocument.uri.fsPath as any) = "/user/temp/textdocument.txt";
const profileInstance = createInstanceOfProfile(imperativeProfile);
const jesApi = createJesApi(imperativeProfile);
const mockCheckCurrentProfile = jest.fn();
Expand Down Expand Up @@ -651,22 +650,25 @@ describe("Jobs Actions Unit Tests - Function submitJcl", () => {
expect(showMessagespy).toBeCalledWith("No profiles available");
});
it("Getting session name from the path itself", async () => {
globals.defineGlobals("/user/");
globals.defineGlobals(__dirname);
createGlobalMocks();
const blockMocks: any = createBlockMocks();
mocked(zowe.ZosmfSession.createSessCfgFromArgs).mockReturnValue(blockMocks.session);
mocked(Profiles.getInstance).mockReturnValue(blockMocks.profileInstance);
const loadNamedProfileSpy = jest.spyOn(blockMocks.profileInstance, "loadNamedProfile");
blockMocks.testDatasetTree.getChildren.mockResolvedValueOnce([
new ZoweDatasetNode({ label: "node", collapsibleState: vscode.TreeItemCollapsibleState.None, parentNode: blockMocks.datasetSessionNode }),
blockMocks.datasetSessionNode,
]);
blockMocks.datasetSessionNode.label = "temp";
blockMocks.textDocument.fileName = path.join(globals.USS_DIR, "lpar1_zosmf", "file.txt");
blockMocks.textDocument.uri = vscode.Uri.file(blockMocks.textDocument.fileName);
activeTextEditorDocument.mockReturnValue(blockMocks.textDocument);
const submitJclSpy = jest.spyOn(blockMocks.jesApi, "submitJcl");
submitJclSpy.mockClear();
submitJclSpy.mockResolvedValueOnce(blockMocks.iJob);
await dsActions.submitJcl(blockMocks.testDatasetTree, undefined);

expect(loadNamedProfileSpy).toBeCalledWith("lpar1_zosmf");
expect(submitJclSpy).toBeCalled();
expect(mocked(Gui.showMessage)).toBeCalled();
expect(mocked(Gui.showMessage).mock.calls.length).toBe(1);
Expand Down
45 changes: 18 additions & 27 deletions packages/zowe-explorer/src/dataset/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,39 +933,30 @@ export async function submitJcl(datasetProvider: api.IZoweTree<api.IZoweDatasetT
}

// get session name
const sessionregex = /\[(.*)(\])(?!.*\])/;
const regExp = sessionregex.exec(doc.fileName);
const profiles = Profiles.getInstance();
let sessProfileName;
if (regExp === null) {
if (!doc.uri.fsPath.includes(globals.ZOWETEMPFOLDER)) {
const profileNamesList = ProfileManagement.getRegisteredProfileNameList(globals.Trees.JES);
if (profileNamesList.length > 1) {
const quickPickOptions: vscode.QuickPickOptions = {
placeHolder: localize("submitJcl.qp.placeholder", "Select the Profile to use to submit the job"),
ignoreFocusOut: true,
canPickMany: false,
};
sessProfileName = await api.Gui.showQuickPick(profileNamesList, quickPickOptions);
if (!sessProfileName) {
api.Gui.infoMessage(localizedStrings.opCancelled);
return;
}
} else if (profileNamesList.length > 0) {
sessProfileName = profileNamesList[0];
} else {
api.Gui.showMessage(localize("submitJcl.noProfile", "No profiles available"));
if (!doc.uri.fsPath.includes(globals.ZOWETEMPFOLDER)) {
const profileNamesList = ProfileManagement.getRegisteredProfileNameList(globals.Trees.JES);
if (profileNamesList.length > 1) {
const quickPickOptions: vscode.QuickPickOptions = {
placeHolder: localize("submitJcl.qp.placeholder", "Select the Profile to use to submit the job"),
ignoreFocusOut: true,
canPickMany: false,
};
sessProfileName = await api.Gui.showQuickPick(profileNamesList, quickPickOptions);
if (!sessProfileName) {
api.Gui.infoMessage(localizedStrings.opCancelled);
return;
}
} else if (profileNamesList.length > 0) {
sessProfileName = profileNamesList[0];
} else {
const filePathArray = doc.uri.fsPath.split(path.sep);
sessProfileName = filePathArray[filePathArray.length - 2];
api.Gui.showMessage(localize("submitJcl.noProfile", "No profiles available"));
}
} else {
sessProfileName = regExp[1];
if (sessProfileName.includes("[")) {
// if submitting from favorites, sesName might be the favorite node, so extract further
sessProfileName = sessionregex.exec(sessProfileName)[1];
}
const start = path.join(globals.ZOWETEMPFOLDER + path.sep).length;
const pathSegments = doc.fileName.substring(start).split(path.sep);
sessProfileName = pathSegments[1];
}

// get profile from session name
Expand Down

0 comments on commit 141289c

Please sign in to comment.