Skip to content

Commit 11302a3

Browse files
chore(release): merge develop to main (#386)
### Description This release include: - upgrade tests fixes - spl2 content tests adjustments - conditions limiting tests execution to latest splunk - fix for setup job to properly install dependencies in edge cases - fix for pre-publish job to pass arguments to publish job instead of failing a workflow ### Checklist - [ ] `README.md` has been updated or is not required - [x] push trigger tests - [ ] manual release test - [ ] automated releases test - [x] pull request trigger tests - [x] schedule trigger tests - [ ] workflow errors/warnings reviewed and addressed ### Testing done https://github.com/splunk/splunk-add-on-for-amazon-web-services/actions/runs/13651290635 https://github.com/splunk/splunk-add-on-for-amazon-web-services/actions/runs/13568681041/attempts/1 PR to main scenario: https://github.com/splunk/splunk-add-on-for-salesforce/actions/runs/13568730203 PR to develop scenario: https://github.com/splunk/splunk-add-on-for-microsoft-cloud-services/actions/runs/13568715908 release scenario: https://github.com/splunk/test-addonfactory-repo/actions/runs/13566246210
2 parents 3e207e9 + 9023beb commit 11302a3

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ on:
4848
["ubuntu:14.04", "ubuntu:16.04","ubuntu:18.04","ubuntu:22.04", "ubuntu:24.04", "redhat:8.4", "redhat:8.5", "redhat:8.6", "redhat:8.8"]
4949
upgrade-tests-ta-versions:
5050
required: false
51-
description: "List with TA versions (in 'X.X.X' format) that should be used as starting points for upgrade tests. If not provided,
52-
the latest TA version will be used. Example: ['7.6.0', '7.7.0']"
51+
description: "List with TA versions (in 'X.X.X' format) that should be used as starting points for upgrade tests. Example: ['7.6.0', '7.7.0']"
5352
type: string
5453
default: >-
55-
["latest"]
54+
[""]
55+
wfe-run-on-splunk-latest:
56+
required: false
57+
description: "Forces WFE tests to run only on the latest Splunk when set to true. When set to false - will run on all supported Splunk versions required for the release. When not set - default behavior."
58+
type: string
59+
default: "false"
5660
secrets:
5761
GH_TOKEN_ADMIN:
5862
description: Github admin token
@@ -127,7 +131,7 @@ jobs:
127131
execute-modinput-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_modinput_functional_labeled }}
128132
execute-ucc-modinput-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_ucc_modinput_functional_labeled }}
129133
execute-scripted_inputs-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_scripted_inputs_labeled }}
130-
execute-upgrade-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_upgrade_test_labeled }}
134+
execute-upgrade-labeled: ${{ steps.configure-tests-on-labels.outputs.execute_upgrade_labeled }}
131135
exit-first: ${{ steps.configure-tests-on-labels.outputs.exit-first }}
132136
s3_bucket_k8s: ${{ steps.k8s-environment.outputs.s3_bucket }}
133137
argo_server_domain_k8s: ${{ steps.k8s-environment.outputs.argo_server_domain }}
@@ -270,15 +274,20 @@ jobs:
270274
- id: matrix
271275
uses: splunk/addonfactory-test-matrix-action@v3.0
272276
- id: determine_splunk
277+
env:
278+
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
273279
run: |
274-
if [ "${{ github.event_name }}" == "schedule" ]; then
280+
if [[ "$wfe_run_on_splunk_latest" == "" ]]; then
281+
wfe_run_on_splunk_latest="${{ github.event_name == 'schedule' || !((github.base_ref == 'main' || github.ref_name == 'main') || ((github.base_ref == 'develop' || github.ref_name == 'develop') && github.event_name == 'push')) }}"
282+
fi
283+
if [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
275284
echo "matrixSplunk=${{ toJson(steps.matrix.outputs.latestSplunk) }}" >> "$GITHUB_OUTPUT"
276285
else
277286
echo "matrixSplunk=${{toJson(steps.matrix.outputs.supportedSplunk) }}" >> "$GITHUB_OUTPUT"
278287
fi
279288
- name: job summary
280289
run: |
281-
splunk_version_list=$(echo '${{ steps.matrix.outputs.supportedSplunk }}' | jq -r '.[].version')
290+
splunk_version_list=$(echo '${{ steps.determine_splunk.outputs.matrixSplunk }}' | jq -r '.[].version')
282291
sc4s_version_list=$(echo '${{ steps.matrix.outputs.supportedSC4S }}' | jq -r '.[].version')
283292
echo -e "## Summary of Versions Used\n- **Splunk versions used:** (${splunk_version_list})\n- **SC4S versions used:** (${sc4s_version_list})\n- Browser: Chrome" >> "$GITHUB_STEP_SUMMARY"
284293
fossa-scan:
@@ -978,17 +987,17 @@ jobs:
978987
shell: bash
979988
run: |
980989
python3.7 -m pip install poetry==1.5.1
990+
export POETRY_REPOSITORIES_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_URL=https://github.com/splunk/addonfactory-ucc-test.git
991+
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_USERNAME=${{ secrets.SA_GH_USER_NAME }}
992+
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_PASSWORD=${{ secrets.GH_TOKEN_ADMIN }}
993+
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
994+
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
981995
- name: modinput-test-prerequisites
982996
if: steps.download-openapi.conclusion != 'skipped'
983997
shell: bash
984998
env:
985999
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
9861000
run: |
987-
export POETRY_REPOSITORIES_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_URL=https://github.com/splunk/addonfactory-ucc-test.git
988-
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_USERNAME=${{ secrets.SA_GH_USER_NAME }}
989-
export POETRY_HTTP_BASIC_SPLUNK_ADD_ON_UCC_MODINPUT_TEST_PASSWORD=${{ secrets.GH_TOKEN_ADMIN }}
990-
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
991-
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
9921001
poetry install --only modinput
9931002
if [ -f "tests/ucc_modinput_functional/tmp/openapi.json" ]; then
9941003
poetry run ucc-test-modinput -o tests/ucc_modinput_functional/tmp/openapi.json -t ${{ steps.download-openapi.outputs.download-path }}/tmp/
@@ -1244,8 +1253,7 @@ jobs:
12441253
- name: Run spl2 tests
12451254
run: |
12461255
echo "Running SPL2 Tests"
1247-
cp -R /spl2-processor-cli/* .
1248-
pytest -s --junitxml test-results/report.xml --log-file=spl2_tests.log --pyargs spl2_testing_framework.cli_based_spl2_tests
1256+
spl2_tests_run cli -o log_cli=true --log-cli-level=INFO --verbose --junitxml test-results/report.xml
12491257
- name: Test Report
12501258
id: test_report
12511259
uses: dorny/test-reporter@v1.9.1
@@ -2354,7 +2362,7 @@ jobs:
23542362
summary-ucc_modinput*
23552363
23562364
run-upgrade-tests:
2357-
if: ${{ !cancelled() && needs.build.result == 'success' && needs.test-inventory.outputs.upgrade == 'true' }}
2365+
if: ${{ !cancelled() && needs.build.result == 'success' && needs.test-inventory.outputs.upgrade == 'true' && needs.setup-workflow.outputs.execute-upgrade-labeled == 'true' }}
23582366
needs:
23592367
- build
23602368
- test-inventory
@@ -2563,7 +2571,7 @@ jobs:
25632571
- name: Parse JUnit XML
25642572
if: ${{ !cancelled() }}
25652573
run: |
2566-
sudo apt-get update
2574+
apt-get update
25672575
apt-get install -y libxml2-utils
25682576
junit_xml_path="${{ needs.setup.outputs.directory-path }}/test-results"
25692577
junit_xml_file=$(find "$junit_xml_path" -name "*.xml" -type f 2>/dev/null | head -n 1)
@@ -2889,9 +2897,11 @@ jobs:
28892897
pre-publish:
28902898
if: ${{ !cancelled() }}
28912899
# The following line will rename 'pre-publish' to 'pre-publish-not_main_pr' when PR is created towards main branch
2892-
# It is necessary to avoid confusion caused by githubactions considering pre-publish for both push to develop branch
2900+
# It is necessary to avoid confusion caused by github actions considering pre-publish for both push to develop branch
28932901
# and pull_request to main branch events.
28942902
name: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' && 'pre-publish' || 'pre-publish-not_main_pr' }}
2903+
outputs:
2904+
run-publish: ${{ steps.check.outputs.run-publish }}
28952905
needs:
28962906
- validate-custom-version
28972907
- meta
@@ -2921,17 +2931,14 @@ jobs:
29212931
if [[ "$RUN_PUBLISH" != *'false'* ]]
29222932
then
29232933
echo "run-publish=true" >> "$GITHUB_OUTPUT"
2934+
echo "Publish conditions are met."
29242935
else
29252936
echo "run-publish=false" >> "$GITHUB_OUTPUT"
2937+
echo "Publish conditions are not met."
29262938
fi
2927-
- name: exit without publish
2928-
if: ${{ steps.check.outputs.run-publish == 'false' || ( github.event.action == 'labeled') }}
2929-
run: |
2930-
echo "Expand check step to see which job has failed pre-publish step."
2931-
exit 1
29322939
29332940
publish:
2934-
if: ${{ !cancelled() && needs.pre-publish.result == 'success' && (github.event_name == 'push' || needs.validate-custom-version.result == 'success') }}
2941+
if: ${{ !cancelled() && needs.pre-publish.outputs.run-publish == 'true' && (github.event_name == 'push' || needs.validate-custom-version.result == 'success') }}
29352942
name: ${{ github.event.inputs.custom-version == '' && 'publish' || 'publish-custom-version' }}
29362943
needs:
29372944
- pre-publish

0 commit comments

Comments
 (0)