Skip to content

Commit

Permalink
Merge branch 'v2.x/staging' into user/markackert/readme-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkAckert authored Mar 26, 2024
2 parents cc5020d + fa2ec5b commit 66dae1a
Show file tree
Hide file tree
Showing 193 changed files with 10,517 additions and 1,322 deletions.
2 changes: 1 addition & 1 deletion .dependency/zwe_doc_generation/md-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function generateDocumentationForNode(curNode, assembledParentNode) {
docContent += createDocContent(assembledDocNode[docType.fileName].content, docType);
const parentDocContent = createDocContent(assembledDocNode[docType.fileName].parentContent, docType);
if (parentDocContent) {
docContent += SUB_SECTION_HEADER_PREFIX + 'Inherited from parent command' + SEPARATOR + parentDocContent;
docContent += SEPARATOR + SUB_SECTION_HEADER_PREFIX + 'Inherited from parent command' + SEPARATOR + parentDocContent;
}
}

Expand Down
19 changes: 6 additions & 13 deletions .github/scripts/cicd_test/make_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,9 @@ case $install_test_choice in
test_file="$KEYRING_TESTFILE"
;;

"z/OS node v14")
test_file="$ZOS_NODE_V14_TESTFILE"
;;

"z/OS node v16")
test_file="$ZOS_NODE_V16_TESTFILE"
;;

"z/OS node v18")
test_file="$ZOS_NODE_V18_TESTFILE"
test_force_system="zzow04"
test_force_system="zzow08"
;;

"Non-strict Verify External Certificate")
Expand Down Expand Up @@ -91,17 +83,18 @@ if [[ ! -z "$test_force_system" ]]; then
else
if [[ -z "$dont_parse_test_server" ]]; then
if [[ "$test_server" == "Any zzow servers" ]]; then
test_server="zzow0"$(echo $(($RANDOM % 3 + 2)))
test_server="zzow0"$(echo $(($RANDOM % 3 + 6)))
fi
TEST_FILE_SERVER="$test_file($test_server)"
else
any_occurrence=$(echo $test_file | grep -o "(any)" | wc -l)
interim_test_file_server=$test_file
for i in $(seq $any_occurrence); do
interim_test_file_server=$(echo $interim_test_file_server | sed "s#(any)#(zzow0$(echo $(($RANDOM % 3 + 2))))#")
# Generates zzow06, zzow07, zzow08
interim_test_file_server=$(echo $interim_test_file_server | sed "s#(any)#(zzow0$(echo $(($RANDOM % 3 + 6))))#")
done

TEST_FILE_SERVER=$(echo $interim_test_file_server | sed "s#(all)#(zzow02,zzow03,zzow04)#g")
TEST_FILE_SERVER=$(echo $interim_test_file_server | sed "s#(all)#(zzow06,zzow07,zzow08)#g")
fi
fi

Expand All @@ -123,4 +116,4 @@ done
MATRIX_JSON_STRING=$(echo $MATRIX_JSON_STRING | sed 's/,$//g')

MATRIX_JSON_STRING="$MATRIX_JSON_STRING]}"
echo "::set-output name=matrix::$MATRIX_JSON_STRING"
echo "matrix=$MATRIX_JSON_STRING" >>$GITHUB_OUTPUT
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ TEST_SERVER=$(echo "$MATRIX_SERVER" | cut -d "-" -f2)

case $TEST_SERVER in

"zzow02")
TEST_SERVER_NICKNAME=marist-2
;;
"zzow06")
TEST_SERVER_NICKNAME=marist-6
;;

"zzow03")
TEST_SERVER_NICKNAME=marist-3
;;
"zzow07")
TEST_SERVER_NICKNAME=marist-7
;;

"zzow04")
TEST_SERVER_NICKNAME=marist-4
;;
"zzow08")
TEST_SERVER_NICKNAME=marist-8
;;

*)
printf "${RED}[Check 2 ERROR] Something went wrong when parsing test server nickname\n"
exit 1
;;
printf "${RED}[Check 2 ERROR] Something went wrong when parsing test server nickname\n"
exit 1
;;
esac

assert_env_var "TEST_SERVER"
assert_env_var "TEST_SERVER_NICKNAME"
printf "${GREEN}[Check 2/$TOTAL_CHECK] Test server name processing complete!${NC}\n"
printf "${GREEN}[Check 2/$TOTAL_CHECK] Test server name processing complete!${NC}\n"
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
################################################################################

# Set outputs
echo ::set-output name=ZOWE_ARTIFACTORY_FINAL::$ZOWE_ARTIFACTORY_FINAL
echo ::set-output name=ZOWE_ARTIFACTORY_FINAL_FILENAME::$ZOWE_ARTIFACTORY_FINAL_FILENAME
echo ::set-output name=NODE_HOME_PATTERN::/ZOWE/node/node-$ZOS_NODE_VERSION-os390-s390x
echo ::set-output name=TEST_SERVER::$TEST_SERVER
echo ::set-output name=TEST_SERVER_NICKNAME::$TEST_SERVER_NICKNAME
echo ::set-output name=EXTENSION_LIST::$EXTENSION_LIST
echo ::set-output name=ZOWE_CLI_ARTIFACTORY_FINAL::$ZOWE_CLI_ARTIFACTORY_FINAL
echo ZOWE_ARTIFACTORY_FINAL=$ZOWE_ARTIFACTORY_FINAL >>$GITHUB_OUTPUT
echo ZOWE_ARTIFACTORY_FINAL_FILENAME=$ZOWE_ARTIFACTORY_FINAL_FILENAME >>$GITHUB_OUTPUT
echo NODE_HOME_PATTERN=/ZOWE/node/node-$ZOS_NODE_VERSION-os390-s390x >>$GITHUB_OUTPUT
echo TEST_SERVER=$TEST_SERVER >>$GITHUB_OUTPUT
echo TEST_SERVER_NICKNAME=$TEST_SERVER_NICKNAME >>$GITHUB_OUTPUT
echo EXTENSION_LIST=$EXTENSION_LIST >>$GITHUB_OUTPUT
echo ZOWE_CLI_ARTIFACTORY_FINAL=$ZOWE_CLI_ARTIFACTORY_FINAL >>$GITHUB_OUTPUT

# Echo all processed outputs
echo
Expand All @@ -28,4 +28,4 @@ printf "Zowe CLI artifactory path: ${CYAN}$ZOWE_CLI_ARTIFACTORY_FINAL${NC}\n"
printf "Zowe extension list: ${CYAN}$EXTENSION_LIST${NC}\n"
printf "Test server: ${CYAN}$TEST_SERVER${NC}\n"
printf "Test server nickname: ${CYAN}$TEST_SERVER_NICKNAME${NC}\n"
printf "Node home pattern on z/OS: ${CYAN}/ZOWE/node/node-$ZOS_NODE_VERSION-os390-s390x${NC}\n"
printf "Node home pattern on z/OS: ${CYAN}/ZOWE/node/node-$ZOS_NODE_VERSION-os390-s390x${NC}\n"
129 changes: 111 additions & 18 deletions .github/workflows/build-packaging.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: Zowe Build and Packaging

permissions:
id-token: write
issues: write
pull-requests: write
contents: write

on:
push:
branches:
- v2.x/staging
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created, edited]

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -34,6 +43,38 @@ on:
type: string

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
set-run-conditions:
runs-on: ubuntu-latest
needs: pr-comment-check
outputs:
should-build: ${{ steps.check-build.outputs.run_build }}
should-test: ${{ steps.check-test.outputs.run_test}}
steps:
- id: check-build
name: 'export conditional used to determine if we should run a build'
run: |
echo "run_build=${{ (github.event_name != 'issue_comment' || needs.pr-comment-check.outputs.issue_run_ci == 'true') && (github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'Build: None')) }}" >> $GITHUB_OUTPUT
- id: check-test
name: 'export conditional used to determine if we should run a test suite'
run: |
echo "run_test=${{ ( github.event_name == 'push' && contains(github.ref, 'staging') ) || ( (github.event_name == 'pull_request' || github.event_name == 'issue_comment') && !contains(github.event.pull_request.labels.*.name, 'Build: None') && !contains(github.event.pull_request.labels.*.name, 'Test: None') ) }}" >> $GITHUB_OUTPUT
display-dispatch-event-id:
if: github.event.inputs.RANDOM_DISPATCH_EVENT_ID != ''
runs-on: ubuntu-latest
Expand All @@ -49,13 +90,17 @@ 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
with:
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}

- name: '[Prep 2] Setup jFrog CLI'
uses: jfrog/setup-jfrog-cli@v2
Expand Down Expand Up @@ -105,10 +150,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(github.event.pull_request.labels.*.name, '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(github.event.pull_request.labels.*.name, 'Build: SMPE') }}" == "true" ]]; then
echo INPUTS_BUILD_SMPE=true >> $GITHUB_ENV
BUILD_WHAT=$BUILD_WHAT", SMPE"
fi
fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'Build: Kubernetes') }}" == "true" ]]; then
echo INPUTS_BUILD_KUBERNETES=true >> $GITHUB_ENV
BUILD_WHAT=$BUILD_WHAT", K8S"
fi
echo "INPUTS_KEEP_TEMP_PAX_FOLDER=${{ contains(github.event.pull_request.labels.*.name, '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
Expand All @@ -128,9 +200,9 @@ jobs:
echo INPUTS_KEEP_TEMP_PAX_FOLDER=${{ github.event.inputs.KEEP_TEMP_PAX_FOLDER }} >> $GITHUB_ENV
echo ::set-output name=BUILD_WHAT::$BUILD_WHAT
echo BUILD_WHAT=$BUILD_WHAT >> $GITHUB_OUTPUT
- name: '[Prep 7] Comment on PR to indicate build is started'
- name: '[Prep 7] Comment on PR to indicate build is started'
uses: actions/github-script@v5
id: create-comment
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request') && startsWith(env.CURRENT_BRANCH, 'PR-')
Expand Down Expand Up @@ -171,7 +243,7 @@ jobs:
with:
manifest-file-path: ${{ github.workspace }}/manifest.json
default-target-path: .pax/binaryDependencies/
expected-count: 29
expected-count: 30

# this step is not doing a publish, we are just utilizing this actions to get the PUBLISH_TARGET_PATH,
# and it will be used in the next step: [Download 3] Download SMPE build log
Expand All @@ -194,17 +266,17 @@ jobs:
id: pax-prep
run: |
if [ "${{ env.INPUTS_BUILD_SMPE }}" == "true" ] || [ "${{ env.INPUTS_BUILD_PSWI }}" == "true" ] ; then
echo ::set-output name=EXTRA_FILES::zowe-smpe.zip,fmid.zip,pd.htm,smpe-promote.tar,smpe-build-logs.pax.Z,rename-back.sh
echo ::set-output name=BUILD_SMPE::yes
echo EXTRA_FILES=zowe-smpe.zip,fmid.zip,pd.htm,smpe-promote.tar,smpe-build-logs.pax.Z,rename-back.sh >> $GITHUB_OUTPUT
echo BUILD_SMPE=yes >> $GITHUB_OUTPUT
else
echo ::set-output name=EXTRA_FILES::
echo ::set-output name=BUILD_SMPE::
echo EXTRA_FILES= >> $GITHUB_OUTPUT
echo BUILD_SMPE= >> $GITHUB_OUTPUT
fi
if [ "${{ env.INPUTS_KEEP_TEMP_PAX_FOLDER }}" == "true" ] ; then
echo ::set-output name=KEEP_TEMP_FOLDER::yes
echo KEEP_TEMP_FOLDER=yes >> $GITHUB_OUTPUT
else
echo ::set-output name=KEEP_TEMP_FOLDER::
echo KEEP_TEMP_FOLDER= >> $GITHUB_OUTPUT
fi
- name: '[PAX/SMPE Pax 2] Packaging'
Expand Down Expand Up @@ -236,7 +308,7 @@ jobs:
with:
lock-repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
lock-resource-name: zowe-psi-build-zzow03-lock
lock-resource-name: zowe-psi-build-zzow07-lock
lock-avg-retry-interval: 60

- name: '[SMPE Pax 4] Build PSWI'
Expand All @@ -249,6 +321,7 @@ jobs:
env:
ZOSMF_USER: ${{ secrets.ZOWE_PSWI_BUILD_USR }}
ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }}
ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }}
VERSION: ${{ env.P_VERSION }}

- name: '[K8S] Build Kubernetes'
Expand All @@ -264,6 +337,7 @@ jobs:
timeout-minutes: 10
uses: zowe-actions/shared-actions/publish@main
with:
sigstore-sign-artifacts: true
artifacts: |
.pax/zowe.pax
.pax/zowe-smpe.zip
Expand Down Expand Up @@ -318,9 +392,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: |
Expand All @@ -330,6 +406,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(github.event.pull_request.labels.*.name, 'Test: Basic') }}" = "true" ]]; then
TEST_SUITE="Convenience Pax"
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'Test: SMPE') }}" = "true" ]]; then
TEST_SUITE="SMPE PTF"
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'Test: Extended') }}" = "true" ]]; then
TEST_SUITE="Zowe Nightly Tests"
elif [[ "${{ contains(github.event.pull_request.labels.*.name, '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
Expand All @@ -340,7 +433,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'

Expand Down
Loading

0 comments on commit 66dae1a

Please sign in to comment.