diff --git a/.github/scripts/manifest_verification/check_sources.js b/.github/scripts/manifest_verification/check_sources.js new file mode 100644 index 0000000000..31293432f8 --- /dev/null +++ b/.github/scripts/manifest_verification/check_sources.js @@ -0,0 +1,159 @@ +// This script checks that the manifest sourceDependencies are reachable. + +const core = require('@actions/core'); +const fs = require('fs-extra'); + +const results = { + success: 'found_matching_commit_or_tag', + warn: 'found_matching_branch', + fail: 'no_matching_tag_or_branch' +} + +function is_sha(item) { + return /^[0-9a-f]{7}$/.test(item) || /^[0-9a-f]{40}$/.test(item) +} + +function isRcOrMaster(branchName) { + return /v[0-9]\.x\/(rc|master)/i.test(branchName); +} + +async function main() { + + if (process.env['BASE_REF'] == null) { + core.setFailed('This script requires the BASE_REF env to bet set.'); + return; + } + + if (process.env['GITHUB_TOKEN'] == null) { + core.setFailed('This script requires the GITHUB_TOKEN env to be set.'); + return; + } + + const baseRef = process.env['BASE_REF'].trim(); + + const github = require('@actions/github') + const octokit = github.getOctokit(process.env['GITHUB_TOKEN']); + + // expect script to be run from repo root + const sourceDeps = fs.readJSONSync('./manifest.json.template').sourceDependencies; + + /** + * Source dep structure is below: + * + * [ + * { + * "componentGroup": "Performance Timing Utility", + * "entries": [{ + * "repository": "perf-timing", + * "tag": "master", + * "destinations": ["Zowe CLI Package"] + * }] + * }, + * { ...same structure as prior...} + * ] + */ + + const analyzedRepos = []; + + for (const dep of sourceDeps) { + for (const entry of dep.entries) { + const repo = entry.repository; + const tag = entry.tag; + + // octokit ref/commit_sha APIs work for branches/tags, and we only want to test when its an actual hash + if (is_sha(tag)) { + const isCommit = await octokit.rest.repos.getCommit({ + owner: 'zowe', + repo: repo, + ref: tag + }).then((resp) => { + if (resp.status < 400) { + return true; + } + return false; + }) + + // Pinning repos with a commit is ok + if (isCommit) { + analyzedRepos.push({repository: repo, tag: tag, result: results.success}); + continue; + } + } + + // If not a commit, check repo tags + const tags = await octokit.rest.repos.listTags({ + owner: 'zowe', + repo: repo, + }).then((resp) => { + if (resp.status < 400) { + return resp.data; + } + return []; + }) + + const knownTag = tags.find((item) => item.name === tag); + if (knownTag != null && knownTag.name.trim().length > 0) { + analyzedRepos.push({repository: repo, tag: tag, result: results.success}); + continue; + } + + // if we didn't find tag, look at branches + // 2 REST Requests, unset protected was operating as protected=false + const protBranches = await octokit.rest.repos.listBranches({ + owner: 'zowe', + repo: repo, + protected: true + }).then((resp) => { + if (resp.status < 400) { + return resp.data; + } + return []; + }) + const unProtBranches = await octokit.rest.repos.listBranches({ + owner: 'zowe', + repo: repo, + protected: false + }).then((resp) => { + if (resp.status < 400) { + return resp.data; + } + return []; + }) + + const branches = [...protBranches, ...unProtBranches]; + + const knownBranch = branches.find((item) => item.name === tag); + if (knownBranch != null && knownBranch.name.trim().length > 0) { + analyzedRepos.push({repository: repo, tag: tag, result: results.warn}); + continue; + } + + // if we didn't find commit, tag or branch + analyzedRepos.push({repository: repo, tag: tag, result: results.fail}); + } + } + + let didFail = false; + + const failRepos = analyzedRepos.filter((item) => item.result === results.fail); + if (failRepos != null && failRepos.length > 0) { + core.warning('There are manifest sourceDependencies without a matching tag or branch. Review the output and update the manifest.'); + core.warning('The following repositories do not have a matching commit hash, tag or branch: ' + JSON.stringify(failRepos, null, {indent: 4})) + didFail = true; + } + + const warnRepos = analyzedRepos.filter((item) => item.result === results.warn) ; + if (warnRepos != null && warnRepos.length > 0) { + if (isRcOrMaster(baseRef)) { + core.warning('Merges to RC and master require tags or commit hashes instead of branches for sourceDependencies.') + didFail = true + } + core.warning('The following repositories have a branch instead of tag: ' + JSON.stringify(warnRepos, null, {indent: 4})) + } + + if (didFail) { + core.setFailed('The manifest validation was not successful. Review the warning output for more details.'); + } + +} +main() diff --git a/.github/scripts/manifest_verification/package-lock.json b/.github/scripts/manifest_verification/package-lock.json new file mode 100644 index 0000000000..784fe7954d --- /dev/null +++ b/.github/scripts/manifest_verification/package-lock.json @@ -0,0 +1,291 @@ +{ + "name": "manifest_verification", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "manifest_verification", + "version": "1.0.0", + "license": "EPL-2.0", + "dependencies": { + "@actions/core": "1.10.1", + "@actions/github": "^6.0.0", + "fs-extra": "11.2.0" + } + }, + "node_modules/@actions/core": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/github": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", + "integrity": "sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==", + "dependencies": { + "@actions/http-client": "^2.2.0", + "@octokit/core": "^5.0.1", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.1.tgz", + "integrity": "sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", + "dependencies": { + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", + "dependencies": { + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz", + "integrity": "sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==" + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz", + "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, + "node_modules/@octokit/request": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", + "dependencies": { + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", + "dependencies": { + "@octokit/types": "^13.1.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "dependencies": { + "@octokit/openapi-types": "^22.1.0" + } + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/.github/scripts/manifest_verification/package.json b/.github/scripts/manifest_verification/package.json new file mode 100644 index 0000000000..3d10210d27 --- /dev/null +++ b/.github/scripts/manifest_verification/package.json @@ -0,0 +1,16 @@ +{ + "name": "manifest_verification", + "version": "1.0.0", + "description": "Script to verify Zowe manifest sourceDependencies", + "main": "check_sources.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "EPL-2.0", + "dependencies": { + "@actions/core": "1.10.1", + "@actions/github": "6.0.0", + "fs-extra": "11.2.0" + } +} diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 54060667d2..1b64e08db8 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -49,16 +49,58 @@ on: description: 'random dispatch event id' required: false type: string + ORIGIN_ISSUE_TRIGGER: + description: 'is being triggered from PR issue comment' + default: false + required: false + type: boolean + +env: + PR_LABELS: jobs: - dump-context: + set-run-conditions: runs-on: ubuntu-latest + outputs: + pr-labels: ${{ steps.get-labels.outputs.result }} + should-build: ${{ steps.check-build.outputs.run_build }} + should-test: ${{ steps.check-test.outputs.run_test}} steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" + - name: 'Get labels' + id: get-labels + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + if ('${{ github.event_name}}' == 'pull_request') { + return JSON.stringify(${{ toJson(github.event.pull_request.labels) }}) + } + else if ('${{ github.event.inputs.ORIGIN_ISSUE_TRIGGER}}' == 'true') { + const res = await github.rest.pulls.list({ + state: 'open', + head: 'zowe:${{ github.ref_name }}', + owner: 'zowe', + repo: 'zowe-install-packaging' + }).then((resp) => { + const pr = resp.data.find((item) => item.head.ref == '${{ github.ref_name }}') + return JSON.stringify(pr.labels) + }) + return res; + } else { + return '[]' + } + + - id: check-build + name: 'export conditional used to determine if we should run a build' + # run_build explanation: workflow_dispatch can be manual, '/ci' comment trigger, or nightly. + # If this is a workflow_disaptch and not a '/ci' trigger, always run, ignoring PR labels. Otherwise, always check the label. + run: | + echo "run_build=${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.ORIGIN_ISSUE_TRIGGER == 'false') || !contains(fromJson(steps.get-labels.outputs.result), 'Build: None') }}" >> $GITHUB_OUTPUT + - id: check-test + name: 'export conditional used to determine if we should run a test suite' + run: | + echo "run_test=${{ (steps.check-build.outputs.run_build == 'true' && !contains(fromJson(steps.get-labels.outputs.result), 'Test: None')) }}" >> $GITHUB_OUTPUT display-dispatch-event-id: if: github.event.inputs.RANDOM_DISPATCH_EVENT_ID != '' @@ -75,14 +117,16 @@ jobs: uses: zowe-actions/shared-actions/permission-check@main with: github-token: ${{ secrets.GITHUB_TOKEN }} - + regular-build: + + if: ${{ needs.set-run-conditions.outputs.should-build == 'true' }} runs-on: ubuntu-latest - needs: check-permission + needs: [set-run-conditions, check-permission] steps: - name: '[Prep 1] Checkout' - uses: actions/checkout@v2 - + uses: actions/checkout@v4 + - name: '[Prep 2] Setup jFrog CLI' uses: jfrog/setup-jfrog-cli@v2 env: @@ -131,10 +175,37 @@ jobs: console.error('Cannot read manifest or manifest is invalid.'); } - - name: '[Prep 6] Process github.event.inputs' - id: process-inputs + - name: '[Prep 6a] Process labels for ci build (pull, push, comment)' + id: process-labels + if: github.event_name != 'workflow_dispatch' run: | BUILD_WHAT="PAX" + + if [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Build: PSWI') }}" == "true" ]]; then + echo INPUTS_BUILD_PSWI=true >> $GITHUB_ENV + echo INPUTS_BUILD_SMPE=true >> $GITHUB_ENV + BUILD_WHAT=$BUILD_WHAT", SMPE, PSWI" + else + if [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Build: SMPE') }}" == "true" ]]; then + echo INPUTS_BUILD_SMPE=true >> $GITHUB_ENV + BUILD_WHAT=$BUILD_WHAT", SMPE" + fi + fi + + if [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Build: Kubernetes') }}" == "true" ]]; then + echo INPUTS_BUILD_KUBERNETES=true >> $GITHUB_ENV + BUILD_WHAT=$BUILD_WHAT", K8S" + fi + + echo "INPUTS_KEEP_TEMP_PAX_FOLDER=${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Build: Debug-Remote') }}" >> $GITHUB_ENV + + echo BUILD_WHAT=$BUILD_WHAT >> $GITHUB_OUTPUT + + - name: '[Prep 6b] Process github.event.inputs for manually triggered build' + id: process-inputs + if: github.event_name == 'workflow_dispatch' + run: | + BUILD_WHAT="${{ steps.process-labels.outputs.BUILD_WHAT_LABELS }}" echo INPUTS_BUILD_PSWI=${{ github.event.inputs.BUILD_PSWI }} >> $GITHUB_ENV if [[ "${{ github.event.inputs.BUILD_PSWI }}" == true ]]; then @@ -364,9 +435,11 @@ jobs: # only run auto integration tests when the workflow is triggered by pull request # default running Convenience Pax on any zzow server call-integration-test: - needs: regular-build + + needs: [set-run-conditions, regular-build] runs-on: ubuntu-latest - if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'staging')) + if: ${{ needs.set-run-conditions.outputs.should-test == 'true' }} + steps: - name: 'Determine branch name' run: | @@ -376,6 +449,23 @@ jobs: echo "BRANCH_NAME=$(echo ${GITHUB_REF_NAME})" >> $GITHUB_ENV fi + - name: 'Determine test suite' + id: get-test-suite + run: | + TEST_SUITE="Convenience Pax" + if [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Test: Basic') }}" = "true" ]]; then + TEST_SUITE="Convenience Pax" + elif [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Test: SMPE') }}" = "true" ]]; then + TEST_SUITE="SMPE PTF" + elif [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Test: Extended') }}" = "true" ]]; then + TEST_SUITE="Zowe Nightly Tests" + elif [[ "${{ contains(fromJson(needs.set-run-conditions.outputs.pr-labels), 'Test: Silly') }}" = "true" ]]; then + TEST_SUITE="Zowe Release Tests" + else + echo "Unknown test label encountered; defaulting to 'Test: Basic' and running Convenience Pax tests." + fi + echo "TEST_SUITE=$TEST_SUITE" >> $GITHUB_OUTPUT + - name: 'Call test workflow' uses: zowe-actions/shared-actions/workflow-remote-call-wait@main id: call-test @@ -386,7 +476,7 @@ jobs: workflow-filename: cicd-test.yml branch-name: ${{ env.BRANCH_NAME }} poll-frequency: 3 - inputs-json-string: '{"custom-zowe-artifactory-pattern-or-build-number":"${{ github.run_number }}"}' + inputs-json-string: '{"custom-zowe-artifactory-pattern-or-build-number":"${{ github.run_number }}", "install-test": "${{ steps.get-test-suite.outputs.TEST_SUITE }}"}' # env: # DEBUG: 'workflow-remote-call-wait' diff --git a/.github/workflows/cicd-comment-trigger.yml b/.github/workflows/cicd-comment-trigger.yml new file mode 100644 index 0000000000..9865b1f088 --- /dev/null +++ b/.github/workflows/cicd-comment-trigger.yml @@ -0,0 +1,63 @@ +# Triggers when comments are made on issues/PRs, runs when '/ci' is added to a pull request. +name: Zowe CICD Issue Trigger + +permissions: + issues: write + pull-requests: write + contents: write + + +on: + issue_comment: + types: [created, edited] + +jobs: + + pr-comment-check: + + name: 'PR Comment Check' + runs-on: ubuntu-latest + outputs: + issue_run_ci: ${{ steps.check-comment.outputs.issue_run_ci }} + steps: + - name: Check for a comment triggering a build + id: check-comment + run: | + echo "issue_run_ci=false" >> $GITHUB_OUTPUT + if [[ ! -z "${{ github.event.issue.pull_request }}" && ${{ github.event_name == 'issue_comment' }} && "${{ github.event.comment.body }}" = '/ci' ]]; then + echo "issue_run_ci=true" >> $GITHUB_OUTPUT + fi + + get-pr-branch: + name: 'Get PR Branch' + runs-on: ubuntu-latest + outputs: + pr_branch_name: ${{ steps.get-pr-name.outputs.pr_branch_name }} + steps: + - name: Find PR Branch Name + id: get-pr-name + run: | + gh config set pager cat + PR_BRANCH=$(gh pr view ${{ github.event.issue.number }} -R zowe/zowe-install-packaging --json headRefName -q .headRefName) + echo "pr_branch_name=$PR_BRANCH" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + + trigger-ci: + name: 'Trigger Build' + runs-on: ubuntu-latest + needs: [pr-comment-check, get-pr-branch] + if: ${{ needs.pr-comment-check.outputs.issue_run_ci == 'true' }} + steps: + - name: 'Trigger Build workflow' + uses: zowe-actions/shared-actions/workflow-remote-call-wait@main + with: + github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }} + owner: zowe + repo: zowe-install-packaging + workflow-filename: build-packaging.yml + branch-name: ${{ needs.get-pr-branch.outputs.pr_branch_name }} + poll-frequency: 3 + inputs-json-string: '{"ORIGIN_ISSUE_TRIGGER":"true", "KEEP_TEMP_PAX_FOLDER":"false"}' + env: + DEBUG: zowe-actions:shared-actions:workflow-remote-call-wait diff --git a/.github/workflows/manifest-source-check.yml b/.github/workflows/manifest-source-check.yml new file mode 100644 index 0000000000..bde7c53b9f --- /dev/null +++ b/.github/workflows/manifest-source-check.yml @@ -0,0 +1,25 @@ +name: Manifest SourceDependencies Verification + +permissions: read-all + +on: + pull_request: + types: [opened, synchronize] + +jobs: + check-manifest: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Dependencies for script to work + run: npm install + working-directory: .github/scripts/manifest_verification + + - name: Run Check + run: node .github/scripts/manifest_verification/check_sources.js + env: + GITHUB_TOKEN: ${{ github.token }} + BASE_REF: ${{ github.event.pull_request.base.ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edb889b67..622d21f425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,45 @@ All notable changes to the Zowe Installer will be documented in this file. #### Minor enhancements/defect fixes +## `2.16.0 + +## Minor enhancements/defect fixes +- Enhancement: Reduced resource consumption by removal of one shell process per server that was used when starting each server. (#3812) +- Enhancement: The command `zwe support` now includes CEE Runtime option output to better diagnose issues related to environment customization. (#3799) +- Bugfix: zowe.network.validatePortFree and zowe.network.vipaIp variables were moved from zowe.network to zowe.network.server in the schema but not in the code, causing inability to use them without the workaround of specifying them as environment variables ZWE_NETWORK_VALIDATE_PORT_FREE and ZWE_NETWORK_VIPA_IP instead. Now, the variables match the schema: zowe.network.server is used instead of zowe.network. +- Bugfix: configmgr operations now run with HEAPPOOLS64 set to OFF to avoid abends caused when this parameter is not OFF. (#3799) + + +## `2.15.0` + +## New features and enhancements + +## Minor enhancements/defect fixes +- Bugfix: `zwe diagnose` running under comfigmgr and output formatted. Fixes #[3627](https://github.com/zowe/zowe-install-packaging/issues/3627). + +## `2.14.0` + +### New features and enhancements +- Enhancement: configmgr.ts now can return a Zowe config with the given HA instance's configuration substituted for convenience. This now used in zwe to fix an issue where zwe would not respect the preference of if a component was enabled or disabled in a particular instance when zowe.useConfigmgr was set to true. + +#### Minor enhancements/defect fixes +- Bugfix: environment variables were not using the values specified for each HA instance when zowe.useConfigmgr was set to true. + +## `2.13.0` + +### New features and enhancements +- Enhancement: Added utility "getesm" into bin/utils. When run it outputs to STDOUT which ESM your system is using. (#3662) + +#### Minor enhancements/defect fixes +- Bugfix: Workflow files in the Zowe PAX are now ASCII-encoded. Fixes [#3591](https://github.com/zowe/zowe-install-packaging/issues/3591). +- Enhancement: `/bin/utils/date-add.rex` utility is accepting the date formatting as combination of YY|YYYY, MM, DD and any separator. + +## `2.12.0` + +### New features and enhancements + +#### Minor enhancements/defect fixes + ## `2.11.0` ### New features and enhancements diff --git a/README.md b/README.md index b913752be2..ff5b649cb5 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ For each Zowe component, we have point of contact(s) in case if we want to confi - zowe-cli-ims-plugin - Explorer (Visual Studio Code Extension): Fernando Rijo Cedeno, Mark Ackert * Source Dependencies - - vscode-extension-for-zowe + - zowe-explorer-vscode - License: Mark Ackert * Binary Dependencies - org.zowe.licenses diff --git a/bin/commands/components/disable/index.sh b/bin/commands/components/disable/index.sh index a11ffb64c9..5934f05032 100644 --- a/bin/commands/components/disable/index.sh +++ b/bin/commands/components/disable/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/disable/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/disable/cli.js" else require_node diff --git a/bin/commands/components/enable/index.sh b/bin/commands/components/enable/index.sh index 572f5fa58f..2f421ed84f 100644 --- a/bin/commands/components/enable/index.sh +++ b/bin/commands/components/enable/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/enable/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/enable/cli.js" else require_node diff --git a/bin/commands/components/handlerutils.ts b/bin/commands/components/handlerutils.ts index 805690a1f4..7ad4d29798 100644 --- a/bin/commands/components/handlerutils.ts +++ b/bin/commands/components/handlerutils.ts @@ -45,7 +45,7 @@ export class HandlerCaller { std.setenv('ZWE_CLI_REGISTRY_COMMAND', 'search'); common.printMessage(`Calling handler '${this.handler}' to search for ${componentName}`); - const result = shell.execSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); + const result = shell.execSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); common.printMessage(`Handler search exited with rc=${result.rc}`); return result.rc; } @@ -59,7 +59,7 @@ export class HandlerCaller { std.setenv('ZWE_CLI_REGISTRY_DRY_RUN', dryRun ? 'true' : 'false'); - const result = shell.execOutSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); + const result = shell.execOutSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); common.printMessage(`Handler uninstall exited with rc=${result.rc}`); if (result.rc) { @@ -95,7 +95,7 @@ export class HandlerCaller { std.setenv('ZWE_CLI_REGISTRY_DRY_RUN', dryRun ? 'true' : 'false'); - const result = shell.execOutSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); + const result = shell.execOutSync('sh', '-c', `_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${std.getenv('ZWE_zowe_runtimeDirectory')}/bin/utils/configmgr -script "${this.handlerPath}"`); common.printMessage(`Handler ${action} exited with rc=${result.rc}`); if (result.rc) { diff --git a/bin/commands/components/install/extract/index.sh b/bin/commands/components/install/extract/index.sh index 5468abaa87..7a3ad52226 100644 --- a/bin/commands/components/install/extract/index.sh +++ b/bin/commands/components/install/extract/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/extract/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/extract/cli.js" else diff --git a/bin/commands/components/install/extract/index.ts b/bin/commands/components/install/extract/index.ts index af5724fcd6..576a3f3c12 100644 --- a/bin/commands/components/install/extract/index.ts +++ b/bin/commands/components/install/extract/index.ts @@ -23,7 +23,6 @@ import * as config from '../../../../libs/config'; import * as component from '../../../../libs/component'; import * as varlib from '../../../../libs/var'; import * as java from '../../../../libs/java'; -import * as node from '../../../../libs/node'; import * as zosmf from '../../../../libs/zosmf'; import { PathAPI as pathoid } from '../../../../libs/pathoid'; diff --git a/bin/commands/components/install/index.sh b/bin/commands/components/install/index.sh index 04d8c355da..22b163b994 100644 --- a/bin/commands/components/install/index.sh +++ b/bin/commands/components/install/index.sh @@ -16,7 +16,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/cli.js" else zwecli_inline_execute_command components install extract diff --git a/bin/commands/components/install/process-hook/index.sh b/bin/commands/components/install/process-hook/index.sh index 1cbb8c0e6d..668950ad9e 100644 --- a/bin/commands/components/install/process-hook/index.sh +++ b/bin/commands/components/install/process-hook/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/process-hook/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/install/process-hook/cli.js" else diff --git a/bin/commands/components/search/index.sh b/bin/commands/components/search/index.sh index 48bec0b0a7..bd125ea92a 100644 --- a/bin/commands/components/search/index.sh +++ b/bin/commands/components/search/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/search/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/search/cli.js" else print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316 fi diff --git a/bin/commands/components/uninstall/index.sh b/bin/commands/components/uninstall/index.sh index 020b96c521..48d55e9659 100644 --- a/bin/commands/components/uninstall/index.sh +++ b/bin/commands/components/uninstall/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/uninstall/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/uninstall/cli.js" else print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316 fi diff --git a/bin/commands/components/upgrade/index.sh b/bin/commands/components/upgrade/index.sh index 2d188011d1..12d8c96be5 100644 --- a/bin/commands/components/upgrade/index.sh +++ b/bin/commands/components/upgrade/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/upgrade/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/components/upgrade/cli.js" else print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316 fi diff --git a/bin/commands/config/get/index.sh b/bin/commands/config/get/index.sh index 3242f1f566..d41f5e542d 100644 --- a/bin/commands/config/get/index.sh +++ b/bin/commands/config/get/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/config/get/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/config/get/cli.js" else echo "This command is only available when zowe.useConfigmgr=true" fi diff --git a/bin/commands/config/validate/index.sh b/bin/commands/config/validate/index.sh index 0d854eb132..73bcbfd170 100644 --- a/bin/commands/config/validate/index.sh +++ b/bin/commands/config/validate/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/config/validate/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/config/validate/cli.js" else echo "This command is only available when zowe.useConfigmgr=true" fi diff --git a/bin/commands/diagnose/index.sh b/bin/commands/diagnose/index.sh index d1f07e8ebe..e45a33a2bb 100644 --- a/bin/commands/diagnose/index.sh +++ b/bin/commands/diagnose/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/diagnose/cli.js" + _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}" diff --git a/bin/commands/init/vsam/index.sh b/bin/commands/init/vsam/index.sh index acf3ae06cb..f40e606b6a 100644 --- a/bin/commands/init/vsam/index.sh +++ b/bin/commands/init/vsam/index.sh @@ -44,7 +44,7 @@ vsam_volume= if [ "${vsam_mode}" = "NONRLS" ]; then vsam_volume=$(read_yaml "${ZWE_CLI_PARAMETER_CONFIG}" ".zowe.setup.vsam.volume") if [ -z "${vsam_volume}" ]; then - print_error_and_exit "Error ZWEL0157E: Zowe Caching Service VSAM data set Non-RLS volume (zowe.setup.vsam.volume) is not defined in Zowe YAML configuration file." "" 157 + print_error_and_exit "Error ZWEL0157E: Zowe Caching Service VSAM data set volume (zowe.setup.vsam.volume) is not defined in Zowe YAML configuration file." "" 157 fi fi vsam_storageClass= diff --git a/bin/commands/internal/config/get/index.sh b/bin/commands/internal/config/get/index.sh index e6b7803bdc..f4eb38eb4f 100644 --- a/bin/commands/internal/config/get/index.sh +++ b/bin/commands/internal/config/get/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/config/get/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/config/get/cli.js" else ############################### diff --git a/bin/commands/internal/config/set/index.sh b/bin/commands/internal/config/set/index.sh index 38aaa2a59e..dddc8c9f26 100644 --- a/bin/commands/internal/config/set/index.sh +++ b/bin/commands/internal/config/set/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/config/set/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/config/set/cli.js" else ############################### diff --git a/bin/commands/internal/container/init/index.sh b/bin/commands/internal/container/init/index.sh index 49970840e7..91f3b89359 100644 --- a/bin/commands/internal/container/init/index.sh +++ b/bin/commands/internal/container/init/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/container/init/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/container/init/cli.js" else diff --git a/bin/commands/internal/get-launch-components/index.sh b/bin/commands/internal/get-launch-components/index.sh index 11b64eff01..ed9fc01836 100644 --- a/bin/commands/internal/get-launch-components/index.sh +++ b/bin/commands/internal/get-launch-components/index.sh @@ -14,7 +14,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/get-launch-components/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/get-launch-components/cli.js" else diff --git a/bin/commands/internal/start/component/index.sh b/bin/commands/internal/start/component/index.sh index a0d0fac1ff..1de4660459 100644 --- a/bin/commands/internal/start/component/index.sh +++ b/bin/commands/internal/start/component/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/component/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/component/cli.js" else diff --git a/bin/commands/internal/start/component/index.ts b/bin/commands/internal/start/component/index.ts index 8e4a9a2351..e627ae2216 100644 --- a/bin/commands/internal/start/component/index.ts +++ b/bin/commands/internal/start/component/index.ts @@ -12,10 +12,12 @@ import * as std from 'cm_std'; import * as os from 'cm_os'; import * as zos from 'zos'; +import * as xplatform from 'xplatform'; import * as common from '../../../../libs/common'; import * as config from '../../../../libs/config'; import * as shell from '../../../../libs/shell'; import * as varlib from '../../../../libs/var'; +import * as stringlib from '../../../../libs/string'; import * as java from '../../../../libs/java'; import * as fs from '../../../../libs/fs'; import * as component from '../../../../libs/component'; @@ -93,8 +95,26 @@ export function execute(componentId: string, runInBackground: boolean=false) { } else { // wait for all background subprocesses created by bin/start.sh exit // re-source libs is necessary to reclaim shell functions since this will be executed in a new shell - //TODO does this do the same as the shell script before it? - shell.execSync('sh', '-c', `cd ${COMPONENT_DIR} ; cat "${fullPath}" | { echo ". \"${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/libs/configmgr-index.sh\"" ; cat ; echo; echo wait; } | /bin/sh`); + const startScriptContents = `cd ${COMPONENT_DIR} ; . "${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/libs/configmgr-index.sh" ; ${xplatform.loadFileUTF8(fullPath, xplatform.AUTO_DETECT)} ; wait;`; + const pipeArray = os.pipe(); + if (!pipeArray) { + common.printFormattedError("ZWELS", "zwe-internal-start-component", `Error ZWEL0064E: failed to run command os.pipe - Cannot start component ${componentId}`); + return; + } + //TODO this will not work with unicode codepoints longer than a byte + const buf = new ArrayBuffer(startScriptContents.length); + const view = new Uint8Array(buf); + const ebcdicString = stringlib.asciiToEbcdic(startScriptContents); + for (let i = 0; i < startScriptContents.length; i++) { + view[i] = ebcdicString.charCodeAt(i); + } + + os.write(pipeArray[1], buf, 0, startScriptContents.length); + os.close(pipeArray[1]); + os.exec(['/bin/sh'], + {block: true, usePath: true, stdin: pipeArray[0]}); + os.close(pipeArray[0]); + } } else { common.printFormattedError("ZWELS", "zwe-internal-start-component", `Error ZWEL0172E: Component ${componentId} has commands.start defined but the file is missing.`); diff --git a/bin/commands/internal/start/index.sh b/bin/commands/internal/start/index.sh index 1c2ea3b7d8..843d4e4a86 100644 --- a/bin/commands/internal/start/index.sh +++ b/bin/commands/internal/start/index.sh @@ -13,7 +13,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/cli.js" else diff --git a/bin/commands/internal/start/prepare/index.sh b/bin/commands/internal/start/prepare/index.sh index 7927fbd231..85ca4ad100 100644 --- a/bin/commands/internal/start/prepare/index.sh +++ b/bin/commands/internal/start/prepare/index.sh @@ -17,7 +17,7 @@ USE_CONFIGMGR=$(check_configmgr_enabled) if [ "${USE_CONFIGMGR}" = "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/prepare/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/start/prepare/cli.js" else diff --git a/bin/commands/internal/start/prepare/index.ts b/bin/commands/internal/start/prepare/index.ts index 98b2bffec5..cf9463fbdc 100644 --- a/bin/commands/internal/start/prepare/index.ts +++ b/bin/commands/internal/start/prepare/index.ts @@ -137,11 +137,12 @@ function globalValidate(enabledComponents:string[]): void { if (runInContainer != 'true') { // only do these check when it's not running in container - // currently node is always required - let nodeOk = node.validateNodeHome(); - if (!nodeOk) { - privateErrors++; - common.printFormattedError('ZWELS', "zwe-internal-start-prepare,global_validate", `Could not validate node home`); + if (enabledComponents.includes('app-server')) { + let nodeOk = node.validateNodeHome(); + if (!nodeOk) { + privateErrors++; + common.printFormattedError('ZWELS', "zwe-internal-start-prepare,global_validate", `Could not validate node home`); + } } // validate java for some core components @@ -438,7 +439,10 @@ export function execute() { // other extensions need to specify `require_java` in their validate.sh java.requireJava(); } - node.requireNode(); + if (stringlib.itemInList('app-server', std.getenv('ZWE_CLI_PARAMETER_COMPONENT'))) { + // other extensions need to specify `require_node` in their validate.sh + node.requireNode(); + } common.requireZoweYaml(); // overwrite ZWE_PRIVATE_LOG_LEVEL_ZWELS with zowe.launchScript.logLevel config in YAML diff --git a/bin/commands/start/index.sh b/bin/commands/start/index.sh index a0ed1b47ad..a24dcb93df 100644 --- a/bin/commands/start/index.sh +++ b/bin/commands/start/index.sh @@ -18,7 +18,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/start/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/start/cli.js" else diff --git a/bin/commands/stop/index.sh b/bin/commands/stop/index.sh index 912092ee0a..fba55a3836 100644 --- a/bin/commands/stop/index.sh +++ b/bin/commands/stop/index.sh @@ -17,7 +17,7 @@ if [ "${USE_CONFIGMGR}" = "true" ]; then # user-facing command, use tmpdir to not mess up workspace permissions export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1 fi - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/stop/cli.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/stop/cli.js" else diff --git a/bin/commands/support/.help b/bin/commands/support/.help index 0f9ef64565..07bfab5e29 100644 --- a/bin/commands/support/.help +++ b/bin/commands/support/.help @@ -6,6 +6,7 @@ This command will collect these information: * z/OS version * Java version * Node.js version + * External Security Manager - Zowe configurations * Zowe manifest.json * Zowe configuration file diff --git a/bin/commands/support/index.sh b/bin/commands/support/index.sh index be3ab8c68e..838715d520 100644 --- a/bin/commands/support/index.sh +++ b/bin/commands/support/index.sh @@ -43,17 +43,23 @@ print_debug "Temporary directory created: ${tmp_dir}" print_message ############################### -print_level1_message "Collecting version of z/OS, Java, NodeJS" +print_level1_message "Collecting information about z/OS, Java, NodeJS and ESM" VERSION_FILE="${tmp_dir}/version_output" ZOS_VERSION=`operator_command "D IPLINFO" | grep -i release | xargs` print_message "- z/OS: ${ZOS_VERSION}" +CEE_OPTIONS=`tsocmd "OMVS RUNOPTS('RPTOPTS(ON)')"` +print_message "- CEE Runtime Options: ${CEE_OPTIONS}" JAVA_VERSION=`${JAVA_HOME}/bin/java -version 2>&1 | head -n 1` print_message "- Java: ${JAVA_VERSION}" NODE_VERSION=`${NODE_HOME}/bin/node --version` print_message "- NodeJS: ${NODE_VERSION}" +ESM=`"${ZWE_zowe_runtimeDirectory}/bin/utils/getesm"` +print_message "- External Security Manager: ${ESM}" echo "z/OS version: ${ZOS_VERSION}" > "${VERSION_FILE}" echo "Java version: ${JAVA_VERSION}" >> "${VERSION_FILE}" echo "NodeJS version: ${NODE_VERSION}" >> "${VERSION_FILE}" +echo "External Security Manager: ${ESM}" >> "${VERSION_FILE}" +echo "CEE Runtime Options: ${CEE_OPTIONS}" >> "${VERSION_FILE}" print_message ############################### diff --git a/bin/libs/config.ts b/bin/libs/config.ts index d1cafe5771..ce56e57607 100644 --- a/bin/libs/config.ts +++ b/bin/libs/config.ts @@ -24,7 +24,6 @@ import * as component from './component'; import * as zosfs from './zos-fs'; import * as sys from './sys'; import * as container from './container'; -import * as node from './node'; import * as objUtils from '../utils/ObjUtils'; const cliParameterConfig:string = function() { @@ -48,22 +47,6 @@ export function updateZoweConfig(updateObj: any, writeUpdate: boolean, arrayMerg return configmgr.updateZoweConfig(updateObj, writeUpdate, arrayMergeStrategy); } -// Convert instance.env to zowe.yaml file -export function convertInstanceEnvToYaml(instanceEnv: string, zoweYaml?: string) { - // we need node for following commands - node.ensureNodeIsOnPath(); - - if (!zoweYaml) { - shell.execSync('node', `${std.getenv('ROOT_DIR')}/bin/utils/config-converter/src/cli.js`, `env`, `yaml`, instanceEnv); - } else { - shell.execSync('node', `${std.getenv('ROOT_DIR')}/bin/utils/config-converter/src/cli.js`, `env`, `yaml`, instanceEnv, `-o`, zoweYaml); - - zosfs.ensureFileEncoding(zoweYaml, "zowe:", 1047); - - shell.execSync('chmod', `640`, zoweYaml); - } -} - ////////////////////////////////////////////////////////////// // Check encoding of a file and convert to IBM-1047 if needed. // @@ -95,7 +78,7 @@ export function generateInstanceEnvFromYamlConfig(haInstance: string) { } // delete old files to avoid potential issues - common.printFormattedTrace( "ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `deleting old files under ${zwePrivateWorkspaceEnvDir}`); + common.printFormattedTrace( "ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `deleting old files under ${zwePrivateWorkspaceEnvDir}`); let foundFiles = fs.getFilesInDirectory(zwePrivateWorkspaceEnvDir); if (foundFiles) { foundFiles.forEach((file:string)=> { @@ -108,27 +91,16 @@ export function generateInstanceEnvFromYamlConfig(haInstance: string) { } const components = component.findAllInstalledComponents2(); - //TODO use configmgr to write json and ha json, and components json - - // prepare .zowe.json and .zowe-.json - common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `config-converter yaml convert --ha ${haInstance} ${cliParameterConfig}`); - let result = shell.execOutSync('node', `${runtimeDirectory}/bin/utils/config-converter/src/cli.js`, `yaml`, `convert`, `--wd`, zwePrivateWorkspaceEnvDir, `--ha`, haInstance, cliParameterConfig, `--verbose`); - - common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `- Exit code: ${result.rc}: ${result.out}`); - if ( !fs.fileExists(`${zwePrivateWorkspaceEnvDir}/.zowe.json`)) { - common.printFormattedError( "ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); - std.exit(140); - } - - - - + let jsonConfig = Object.assign({}, getZoweConfig()); + let componentsWithConfigs:string[] = []; + let merger = new objUtils.Merger(); + merger.mergeArrays = false; // convert YAML configurations to backward compatible .instance-.env files - common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `config-converter yaml env --ha ${haInstance}`); + common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `getZoweConfigEnv(${haInstance})`); const envs = configmgr.getZoweConfigEnv(haInstance); - common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `- Output: ${JSON.stringify(envs, null, 2)}`); + common.printFormattedTrace("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `- Output: ${JSON.stringify(envs, null, 2)}`); const envKeys = Object.keys(envs); let envFileArray=[]; @@ -145,7 +117,7 @@ export function generateInstanceEnvFromYamlConfig(haInstance: string) { let rc = fs.mkdirp(folderName, 0o700); if (rc) { //TODO error code - common.printFormattedError("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `Failed to make env var folder for component=${currentComponent}`); + common.printFormattedError("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `Failed to make env var folder for component=${currentComponent}`); } let componentFileArray = []; componentFileArray.push('#!/bin/sh'); @@ -163,6 +135,12 @@ export function generateInstanceEnvFromYamlConfig(haInstance: string) { let flat = []; if (componentManifest.configs) { + componentsWithConfigs.push(currentComponent); + let currentComponentJson:any = {}; + currentComponentJson.components = {}; + currentComponentJson.components[currentComponent] = componentManifest.configs; + jsonConfig = merger.merge( jsonConfig, currentComponentJson); + const flattener = new objUtils.Flattener(); flattener.setSeparator('_'); flattener.setKeepArrays(true); @@ -190,20 +168,49 @@ export function generateInstanceEnvFromYamlConfig(haInstance: string) { componentFileArray.push(`ZWE_configs_${key}=${envs['ZWE_components_'+componentAlpha+'_'+key]}`); } }); - + + componentFileArray = componentFileArray.map((row)=> { return row.endsWith('=null') ? row.substring(0, row.length-5)+'=' : row }); const componentFileContent = componentFileArray.join('\n'); rc = xplatform.storeFileUTF8(`${folderName}/.instance-${haInstance}.env`, xplatform.AUTO_DETECT, componentFileContent); if (rc) { - common.printFormattedError("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); + common.printFormattedError("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); std.exit(140); return; } }); + // we want this, but not at the top level. + let hostname = jsonConfig.hostname; + + let haConfig = jsonConfig; + if (haInstance && jsonConfig.haInstances && jsonConfig.haInstances[haInstance]) { + haConfig = merger.merge(jsonConfig.haInstances[haInstance], jsonConfig); + } + + haConfig.haInstance = { + id: haInstance, + hostname: hostname + }; + delete jsonConfig.hostname; + + componentsWithConfigs.forEach((componentName)=> { + let componentConfig = merger.merge(haConfig, { configs: jsonConfig.components[componentName] }); + xplatform.storeFileUTF8(`${zwePrivateWorkspaceEnvDir}/${componentName}/.configs-${haInstance}.json`, xplatform.AUTO_DETECT, JSON.stringify(componentConfig, null, 2)); + }); + + xplatform.storeFileUTF8(`${zwePrivateWorkspaceEnvDir}/.zowe.json`, xplatform.AUTO_DETECT, JSON.stringify(jsonConfig, null, 2)); + xplatform.storeFileUTF8(`${zwePrivateWorkspaceEnvDir}/.zowe-${haInstance}.json`, xplatform.AUTO_DETECT, JSON.stringify(haConfig, null, 2)); + + if (!fs.fileExists(`${zwePrivateWorkspaceEnvDir}/.zowe.json`)) { + common.printFormattedError("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); + std.exit(140); + } + + envFileArray = envFileArray.map((row)=> { return row.endsWith('=null') ? row.substring(0, row.length-5)+'=' : row }); let envFileContent = envFileArray.join('\n'); let rc = xplatform.storeFileUTF8(`${zwePrivateWorkspaceEnvDir}/.instance-${haInstance}.env`, xplatform.AUTO_DETECT, envFileContent); if (rc) { - common.printFormattedError("ZWELS", "bin/libs/config.ts,generate_instance_env_from_yaml_config", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); + common.printFormattedError("ZWELS", "bin/libs/config.ts,generateInstanceEnvFromYamlConfig", `ZWEL0140E: Failed to translate Zowe configuration (${cliParameterConfig}).`); std.exit(140); return; } diff --git a/bin/libs/json.ts b/bin/libs/json.ts index 70243b8901..8e269e8374 100644 --- a/bin/libs/json.ts +++ b/bin/libs/json.ts @@ -66,93 +66,10 @@ export function shellReadYamlConfig(yamlFile: string, parentKey: string, key: st } } -//NOTE: PARMLIB only supported when destination is zowe.yaml -export function readYaml(file: string, key: string) { - const ZOWE_CONFIG=config.getZoweConfig(); - const utils_dir=`${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/utils`; - const jq=`${utils_dir}/njq/src/index.js`; - const fconv=`${utils_dir}/fconv/src/index.js`; - - common.printTrace(`- readYaml load content from ${file}`); - if (std.getenv('ZWE_CLI_PARAMETER_CONFIG') == file) { - return fakejq.jqget(ZOWE_CONFIG, key); - } else { - const ZWE_PRIVATE_YAML_CACHE=shell.execOutSync('sh', '-c', `node "${fconv}" --input-format=yaml "${file}" 2>&1`); - let code=ZWE_PRIVATE_YAML_CACHE.rc; - common.printTrace(` * Exit code: ${code}`); - if (code != 0) { - common.printError(" * Output:"); - common.printError(stringlib.paddingLeft(ZWE_PRIVATE_YAML_CACHE.out, " ")); - return; - } - - common.printTrace(`- readYaml ${key} from yaml content`); - const result=shell.execOutSync('sh', '-c', `echo "${ZWE_PRIVATE_YAML_CACHE}" | node "${jq}" -r "${key}" 2>&1`); - code=result.rc; - common.printTrace(` * Exit code: ${code}`); - common.printTrace(" * Output:"); - if (result.out) { - common.printTrace(stringlib.paddingLeft(result.out, " ")); - } - - return result.out - } -} - -export function readJson(file: string, key: string):any { - const ZOWE_CONFIG=config.getZoweConfig(); - const utils_dir=`${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/utils`; - const jq=`${utils_dir}/njq/src/index.js`; - - common.printTrace(`- readJson ${key} from ${file}`); - let result=shell.execOutSync('sh', '-c', `cat "${file}" | node "${jq}" -r "${key}" 2>&1`); - const code = result.rc; - common.printTrace(` * Exit code: ${code}`); - common.printTrace(` * Output:`); - if ( result.out ) { - common.printTrace(stringlib.paddingLeft(result.out, " ")); - } - - return result.out; -} - export function readJsonString(input: string, key: string): any { return fakejq.jqget(JSON.parse(input), key); } -//NOTE: PARMLIB only supported when destination is zowe.yaml -export function updateYaml(file: string, key: string, val: any, expectedSample: string) { - const ZOWE_CONFIG=config.getZoweConfig(); - const utils_dir=`${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/utils`; - const config_converter=`${utils_dir}/config-converter/src/cli.js` - - - common.printMessage(`- update "${key}" with value: ${val}`); - if (std.getenv('ZWE_CLI_PARAMETER_CONFIG') == file) { - updateZoweYaml(file, key, val); - } else { - // TODO what would we write thats not the zowe config? this sounds like an opportunity to disorganize. - let result=shell.execOutSync('sh', '-c', `node "${config_converter}" yaml update "${file}" "${key}" "${val}"`); - const code = result.rc; - if (code == 0) { - common.printTrace(` * Exit code: ${code}`); - common.printTrace(` * Output:`); - if (result.out) { - common.printTrace(stringlib.paddingLeft(result.out, " ")); - } - } else { - common.printError(` * Exit code: ${code}`); - common.printError(" * Output:"); - if (result.out) { - common.printError(stringlib.paddingLeft(result.out, " ")); - } - common.printErrorAndExit(`Error ZWEL0138E: Failed to update key ${key} of file ${file}.`, undefined, 138); - } - - zosfs.ensureFileEncoding(file, expectedSample); - } -} - export function updateZoweYaml(file: string, key: string, val: any) { common.printMessage(`- update zowe config ${file}, key: "${key}" with value: ${val}`); let [ success, updateObj ] = fakejq.jqset({}, key, val); @@ -164,34 +81,3 @@ export function updateZoweYaml(file: string, key: string, val: any) { common.printError(` * Error`); } } - -//TODO: PARMLIB not supported. -export function deleteYaml(file: string, key: string, expectedSample: string) { - const ZOWE_CONFIG=config.getZoweConfig(); - const utils_dir=`${ZOWE_CONFIG.zowe.runtimeDirectory}/bin/utils`; - const config_converter=`${utils_dir}/config-converter/src/cli.js` - - common.printMessage(`- delete \"${key}\"`); - let result=shell.execOutSync('sh', '-c', `node "${config_converter}" yaml delete "${file}" "${key}"`); - const code = result.rc; - if (code == 0) { - common.printTrace(` * Exit code: ${code}`); - common.printTrace(` * Output:`); - if (result.out) { - common.printTrace(stringlib.paddingLeft(result.out, " ")); - } - } else { - common.printError(` * Exit code: ${code}`); - common.printError(" * Output:"); - if (result.out) { - common.printError(stringlib.paddingLeft(result.out, " ")); - } - common.printErrorAndExit(`Error ZWEL0138E: Failed to delete key ${key} of file ${file}.`, undefined, 138); - } - - zosfs.ensureFileEncoding(file, expectedSample); -} - -export function deleteZoweYaml(file: string, key: string) { - deleteYaml(file, key, "zowe:"); -} diff --git a/bin/libs/network.sh b/bin/libs/network.sh index 56ffbc7a66..a97c04f33c 100644 --- a/bin/libs/network.sh +++ b/bin/libs/network.sh @@ -87,7 +87,7 @@ get_netstat() { is_port_available() { port="${1}" - if [ "${ZWE_zowe_network_validatePortFree:-$ZWE_zowe_environments_ZWE_NETWORK_VALIDATE_PORT_FREE}" = "false" ]; then + if [ "${ZWE_zowe_network_server_validatePortFree:-$ZWE_zowe_environments_ZWE_NETWORK_VALIDATE_PORT_FREE}" = "false" ]; then print_message "Port validation skipped due to zowe.network.validatePortFree=false" return 0 fi @@ -102,7 +102,7 @@ is_port_available() { case $(uname) in "OS/390") - vipa_ip=${ZWE_zowe_network_vipaIp:-$ZWE_zowe_environments_ZWE_NETWORK_VIPA_IP} + vipa_ip=${ZWE_zowe_network_server_vipaIp:-$ZWE_zowe_environments_ZWE_NETWORK_VIPA_IP} if [ -n "${vipa_ip}" ]; then result=$(${netstat} -B ${vipa_ip}+${port} -c SERVER 2>&1) else diff --git a/bin/libs/network.ts b/bin/libs/network.ts index f6395fc7a7..deeef9e045 100644 --- a/bin/libs/network.ts +++ b/bin/libs/network.ts @@ -45,7 +45,7 @@ export function getNetstat(): string|undefined { export function isPortAvailable(port: number): boolean { const netstat=getNetstat(); - const skipValidate = (std.getenv('ZWE_zowe_network_validatePortFree') ? std.getenv('ZWE_zowe_network_validatePortFree') : std.getenv('ZWE_zowe_environments_ZWE_NETWORK_VALIDATE_PORT_FREE')) == 'false'; + const skipValidate = (std.getenv('ZWE_zowe_network_server_validatePortFree') ? std.getenv('ZWE_zowe_network_server_validatePortFree') : std.getenv('ZWE_zowe_environments_ZWE_NETWORK_VALIDATE_PORT_FREE')) == 'false'; if (skipValidate) { common.printMessage("Port validation skipped due to zowe.network.validatePortFree=false"); return true; @@ -61,9 +61,9 @@ export function isPortAvailable(port: number): boolean { let lines; switch (os.platform) { case 'zos': - const vipaIp = std.getenv('ZWE_zowe_network_vipaIp') ? std.getenv('ZWE_zowe_network_vipaIp') : std.getenv('ZWE_zowe_environments_ZWE_NETWORK_VIPA_IP'); + const vipaIp = std.getenv('ZWE_zowe_network_server_vipaIp') ? std.getenv('ZWE_zowe_network_server_vipaIp') : std.getenv('ZWE_zowe_environments_ZWE_NETWORK_VIPA_IP'); if (vipaIp !== undefined) { - retVal=shell.execOutSync('sh', '-c', `${netstat} -B ${std.getenv('ZWE_zowe_network_vipaIp')}+${port} -c SERVER 2>&1`); + retVal=shell.execOutSync('sh', '-c', `${netstat} -B ${vipaIp}+${port} -c SERVER 2>&1`); } else { retVal=shell.execOutSync('sh', '-c', `${netstat} -c SERVER -P ${port} 2>&1`); } diff --git a/manifest.json.template b/manifest.json.template index aacde2e4e6..6e09dd2e47 100644 --- a/manifest.json.template +++ b/manifest.json.template @@ -1,6 +1,6 @@ { "name": "Zowe", - "version": "2.15.0", + "version": "2.16.0", "description": "Zowe is an open source project created to host technologies that benefit the Z platform from all members of the Z community (Integrated Software Vendors, System Integrators and z/OS consumers). Zowe, like Mac or Windows, comes with a set of APIs and OS capabilities that applications build on and also includes some applications out of the box. Zowe offers modern interfaces to interact with z/OS and allows you to work with z/OS in a way that is similar to what you experience on cloud platforms today. You can use these interfaces as delivered or through plug-ins and extensions that are created by clients or third-party vendors.", "license": "EPL-2.0", "homepage": "https://zowe.org", diff --git a/smpe/bld/service/promoted-apar.txt b/smpe/bld/service/promoted-apar.txt index 07ec28cc3e..dacba17f67 100644 --- a/smpe/bld/service/promoted-apar.txt +++ b/smpe/bld/service/promoted-apar.txt @@ -1,3 +1,6 @@ +IO29349 +IO29350 +IO29351 IO29346 IO29347 IO29348 diff --git a/smpe/bld/service/promoted-close.txt b/smpe/bld/service/promoted-close.txt index ee6b38e692..2b678fc7fa 100644 --- a/smpe/bld/service/promoted-close.txt +++ b/smpe/bld/service/promoted-close.txt @@ -1,3 +1,48 @@ + IO29349 - + PROBLEM SUMMARY: + **************************************************************** + * USERS AFFECTED: All Zowe users * + **************************************************************** + * PROBLEM DESCRIPTION: Update Zowe FMID AZWE002 to match the * + * community release * + **************************************************************** + * RECOMMENDATION: Apply provided service * + **************************************************************** + The Zowe community version was updated to 2.15.0. + This PTF provides the community changes in SMP/E format. + Follow this link for more details on the community changes: + https://docs.zowe.org/stable/ + + IO29350 - + PROBLEM SUMMARY: + **************************************************************** + * USERS AFFECTED: All Zowe users * + **************************************************************** + * PROBLEM DESCRIPTION: Update Zowe FMID AZWE002 to match the * + * community release * + **************************************************************** + * RECOMMENDATION: Apply provided service * + **************************************************************** + The Zowe community version was updated to 2.15.0. + This PTF provides the community changes in SMP/E format. + Follow this link for more details on the community changes: + https://docs.zowe.org/stable/ + + IO29351 - + PROBLEM SUMMARY: + **************************************************************** + * USERS AFFECTED: All Zowe users * + **************************************************************** + * PROBLEM DESCRIPTION: Update Zowe FMID AZWE002 to match the * + * community release * + **************************************************************** + * RECOMMENDATION: Apply provided service * + **************************************************************** + The Zowe community version was updated to 2.15.0. + This PTF provides the community changes in SMP/E format. + Follow this link for more details on the community changes: + https://docs.zowe.org/stable/ + IO29346 - PROBLEM SUMMARY: **************************************************************** diff --git a/smpe/bld/service/promoted-hold.txt b/smpe/bld/service/promoted-hold.txt index 3337b60c7a..41f010ffcc 100644 --- a/smpe/bld/service/promoted-hold.txt +++ b/smpe/bld/service/promoted-hold.txt @@ -1,3 +1,28 @@ +++HOLD(UO90049) SYSTEM FMID(AZWE002) REASON(ACTION) DATE(24068) + COMMENT( + **************************************************************** + * Affected function: Zowe servers * + **************************************************************** + * Description: stop servers * + **************************************************************** + * Timing: pre-APPLY * + **************************************************************** + * Part: ZWESLSTC and ZWESISTC * + **************************************************************** + Stop the Zowe servers before installing this update. + + **************************************************************** + * Affected function: Zowe servers * + **************************************************************** + * Description: start servers * + **************************************************************** + * Timing: post-APPLY * + **************************************************************** + * Part: ZWESLSTC and ZWESISTC * + **************************************************************** + Start the Zowe servers after installing this update. + + ). ++HOLD(UO90047) SYSTEM FMID(AZWE002) REASON(ACTION) DATE(24026) COMMENT( **************************************************************** diff --git a/smpe/bld/service/promoted-ptf.txt b/smpe/bld/service/promoted-ptf.txt index 08242dbddd..f6a1a9488e 100644 --- a/smpe/bld/service/promoted-ptf.txt +++ b/smpe/bld/service/promoted-ptf.txt @@ -1,3 +1,5 @@ +UO90049 +UO90050 UO90047 UO90048 UO90045 diff --git a/smpe/bld/service/ptf-bucket.txt b/smpe/bld/service/ptf-bucket.txt index 0f4b8c00a3..e9945042ce 100644 --- a/smpe/bld/service/ptf-bucket.txt +++ b/smpe/bld/service/ptf-bucket.txt @@ -21,4 +21,7 @@ #UO90033 UO90034 - IO29289 IO29290 IO29291 - Tue Oct 24 19:49:48 UTC 2023 #UO90045 UO90046 - IO29343 IO29344 IO29345 - Thu Dec 14 16:23:26 UTC 2023 #UO90047 UO90048 - IO29346 IO29347 IO29348 - Fri Jan 26 17:21:09 UTC 2024 -UO90049 UO90050 - IO29349 IO29350 IO29351 +#UO90049 UO90050 - IO29349 IO29350 IO29351 - Fri Mar 8 19:42:44 UTC 2024 +UO90057 UO90058 - IO29424 IO29425 IO29426 +UO90059 UO90060 - IO29428 IO29429 IO29430 +UO90061 UO90062 - IO29431 IO29432 IO29433