Skip to content

Commit

Permalink
Merge branch 'v3.x/staging' into users/muzikovam/yamlCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
muzikovam authored Nov 7, 2024
2 parents 2710f40 + 6aecbd2 commit d808029
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 112 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
All notable changes to the Zowe Installer will be documented in this file.

## `3.0.1`
- Bugfix: When `--log-dir` parameter for `zwe` command is a file, there might be an error "InternalError: stack overflow". [#40nn](https://github.com/zowe/zowe-install-packaging/pull/40nn)
- Enhancement: new javascript funtion `getStatvfs()` to obtain information about the file sysytem [#3994](https://github.com/zowe/zowe-install-packaging/pull/3994)
- Enhancement: command `zwe diagnose` in javascript only [#4061](https://github.com/zowe/zowe-install-packaging/pull/4061)
- Enhancement: schema validation update for `zowe.job.name` and `zowe.job.prefix` [#4060](https://github.com/zowe/zowe-install-packaging/pull/4060)

## `3.0.0`

Expand Down
57 changes: 1 addition & 56 deletions bin/commands/diagnose/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,4 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/diagnose/cli.js"
else

error_code="${ZWE_CLI_PARAMETER_ERROR_CODE}"

print_message ""

if echo $error_code | grep -q -E "^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$"; then
server_code=$(echo "${error_code}" | cut -c4)
if [[ "$server_code" == [Dd] ]]; then
print_message "This code corresponds to the errors related to the ZOWE Desktop and the App Server."
print_message ""
print_message "To find the description of this error code, refer to the:"
print_message ""
print_message " Zowe documentation for Application framework"
print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/appserver-error-codes"
elif [[ "$server_code" == [Ss] ]]; then
print_message "This code corresponds to the errors related to the Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)."
print_message ""
print_message "To find the description of this error code, refer to the:"
print_message ""
print_message " Zowe documentation for ZSS"
print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes"
print_message " Zowe documentation for ZIS"
print_message " https://docs.zowe.org/stable/troubleshoot/app-framework/zis-error-codes"
elif [[ "$server_code" == [Aa] ]]; then
print_message "This code corresponds to the errors related to the Zowe API Mediation Layer (APIML)."
print_message ""
print_message "To find the description of this error code, refer to the:"
print_message ""
print_message " Zowe documentation for API Mediation Layer"
print_message " https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes"
elif [[ "$server_code" == [Ll] ]]; then
print_message "This code corresponds to the errors related to the Zowe Launcher and ZWE."
print_message ""
print_message "To find the description of this error code, refer to the:"
print_message ""
print_message " Zowe documentation for Launcher"
print_message " https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes"
print_message " Launcher error codes"
print_message " https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h"
print_message " Zowe documentation for ZWE"
print_message " https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/"
fi
print_message ""
print_message "You may also explore reports from other users experiencing the same error by searching"
print_message "https://github.com/search?q=org%3Azowe+${error_code}&type=discussions"
else
print_error_and_exit "ZWEL0102E: Invalid parameter --error-code='${error_code}'" "" 102
fi

print_message ""

fi
_CEE_RUNOPTS="XPLINK(ON)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/diagnose/cli.js"
91 changes: 45 additions & 46 deletions bin/commands/diagnose/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,64 @@
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 std from 'cm_std';
import * as common from '../../libs/common';

const THIS_CODE = "\nThis code corresponds to the errors related to the";
const FIND_DESC = "To find the description of this error code, refer to the:\n ";
const URL = {
apiML: "https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes",
appFW : "https://docs.zowe.org/stable/troubleshoot/app-framework/appserver-error-codes",
launcher: "https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes",
launcherGit: "https://github.com/zowe/launcher/blob/v2.x/master/src/msg.h",
zss: "https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes",
zis: "https://docs.zowe.org/stable/troubleshoot/app-framework/zis-error-codes",
zwe: "https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/"
}

function thisCodeCorrespondsTo(component: string){
common.printMessage(`${THIS_CODE} ${component}.\n`);
common.printMessage(`${FIND_DESC}`);
const COMPONENTS = {
a: {
title: 'Zowe API Mediation Layer (APIML)',
urls: [
{ text: 'API Mediation Layer', link: 'https://docs.zowe.org/stable/troubleshoot/troubleshoot-apiml-error-codes' }
]
},
d: {
title: 'Zowe Desktop and the App Server',
urls: [
{ text: 'Application framework', link: 'https://docs.zowe.org/stable/troubleshoot/app-framework/appserver-error-codes' }
]
},
l: {
title: 'Zowe Launcher and zwe',
urls: [
{ text: 'Launcher', link: 'https://docs.zowe.org/stable/troubleshoot/launcher/launcher-error-codes' },
{ text: 'Launcher error codes', link: `https://github.com/zowe/launcher/blob/v${common.getZoweVersion().substring(0,1)}.x/master/src/msg.h`, git: true },
{ text: 'zwe', link: 'https://docs.zowe.org/stable/appendix/zwe_server_command_reference/zwe/' },
]
},
s: {
title: 'Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)',
urls: [
{ text: 'ZSS', link: 'https://docs.zowe.org/stable/troubleshoot/app-framework/zss-error-codes' },
{ text: 'ZIS', link: 'https://docs.zowe.org/stable/troubleshoot/app-framework/zis-error-codes' }
]
}
}

function printLinks(description: string, link: string){
if (link.indexOf('github') > 0)
common.printMessage(` ${description}`)
else
common.printMessage(` Zowe documentation for ${description}`)
common.printMessage(` ${link}`);
function printComponent(component: any): void {
common.printMessage(`\nThis code corresponds to the errors related to the ${component.title}.\n`);
common.printMessage(`To find the description of this error code, refer to the:\n`);
for (let url in component.urls) {
let zoweDocFor = component.urls[url].git ? '' : 'Zowe documentation for ';
common.printMessage(` ${zoweDocFor}${component.urls[url].text}`);
common.printMessage(` ${component.urls[url].link}`);
}
}

export function execute() {
export function execute(): void {
const errorCode = std.getenv('ZWE_CLI_PARAMETER_ERROR_CODE');
if (/^[zZ][wW][eE][AaSsDdLl][A-Za-z]?[0-9]{3,4}[A-Za-z]$/.test(errorCode)) {
const serverCode = errorCode.charAt(3);
if (serverCode.toLowerCase() === 'd') {
thisCodeCorrespondsTo('ZOWE Desktop and the App Server');
printLinks('Application framework', `${URL.appFW}`);
}
else if (serverCode.toLowerCase() === 's') {
thisCodeCorrespondsTo('Zowe Subsystem Services (ZSS) and Zowe Installation Services (ZIS)');
printLinks('ZSS', `${URL.zss}`);
printLinks('ZIS', `${URL.zis}`);
}
else if (serverCode.toLowerCase() === 'a') {
thisCodeCorrespondsTo('Zowe API Mediation Layer (APIML)');
printLinks('API Mediation Layer', `${URL.apiML}`);
const serverCode = errorCode.charAt(3).toLowerCase();
if ('adls'.includes(serverCode)) {
printComponent(COMPONENTS[serverCode]);
common.printMessage(`\nYou may also explore reports from other users experiencing the same error by searching\nhttps://github.com/search?q=org%3Azowe+${errorCode}&type=discussions\n`);
}
else if (serverCode.toLowerCase() === 'l') {
thisCodeCorrespondsTo('Zowe Launcher and ZWE');
printLinks('Launcher', `${URL.launcher}`);
printLinks('Launcher error codes', `${URL.launcherGit}`);
printLinks('ZWE', `${URL.zwe}`);
}
common.printMessage(`\nYou may also explore reports from other users experiencing the same error by searching\nhttps://github.com/search?q=org%3Azowe+${errorCode}&type=discussions\n`);
}
else {
} else {
common.printErrorAndExit(`ZWEL0102E: Invalid parameter --error-code='${errorCode}'`, undefined, 102);
}
}
2 changes: 1 addition & 1 deletion bin/libs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export function getZoweRuntimeManifest(): any|undefined {
if (!runtimeManifest) {
const manifestFileName = `${std.getenv('ZWE_zowe_runtimeDirectory')}/manifest.json`;
const result = xplatform.loadFileUTF8(manifestFileName,xplatform.AUTO_DETECT);
if (result){
if (!result) {
printError('Could not read runtime manifest in '+manifestFileName);
} else {
runtimeManifest=JSON.parse(result);
Expand Down
3 changes: 3 additions & 0 deletions bin/libs/logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
export ZWE_PRIVATE_LOG_FILE=

prepare_log_file() {
if [ -f "${1}" ]; then
print_error_and_exit "Error ZWEL0102E: Invalid parameter --log-dir=${1} (not a directory)" "" 102
fi
# use absolute path to make sure we can always write to correct location even
# if other scripts changed current working directory
log_dir=$(convert_to_absolute_path "${1}" | remove_trailing_slash)
Expand Down
4 changes: 2 additions & 2 deletions schemas/zowe-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,11 @@
"description": "Customize your Zowe z/OS JES job.",
"properties": {
"name": {
"type": "string",
"$ref": "/schemas/v2/server-common#zoweJobname",
"description": "Job name of Zowe primary ZWESLSTC started task."
},
"prefix": {
"type": "string",
"$ref": "/schemas/v2/server-common#zoweJobname",
"description": "A short prefix to customize address spaces created by Zowe job."
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-07-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-08-subsys.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down
4 changes: 3 additions & 1 deletion tests/sanity/test/e2e/test-10-api-catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down Expand Up @@ -79,6 +79,8 @@ describe(`test ${APP_TO_TEST}`, function() {
try {
const searchBox = await waitUntilElement(driver, '.search-bar');
expect(searchBox).to.be.an('object');
await saveScreenshotWithIframeAppContext(this, driver, testName, 'login-pre-success', APP_TO_TEST, MVD_IFRAME_APP_CONTENT);

} catch (e) {
// try to save screenshot for debug purpose
await saveScreenshotWithIframeAppContext(this, driver, testName, 'login-failed', APP_TO_TEST, MVD_IFRAME_APP_CONTENT);
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-11-workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-12-angular-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-13-react-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe.skip(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test/e2e/test-14-ip-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe(`test ${APP_TO_TEST}`, function() {
// load MVD login page
await loginMVD(
driver,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_ZLUX_HTTPS_PORT}/`,
`https://${process.env.ZOWE_EXTERNAL_HOST}:${process.env.ZOWE_API_MEDIATION_GATEWAY_HTTP_PORT}/zlux/ui/v1/ZLUX/plugins/org.zowe.zlux.bootstrap/web/`,
process.env.SSH_USER,
process.env.SSH_PASSWD
);
Expand Down

0 comments on commit d808029

Please sign in to comment.