Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for running tests on Splunk build with OpenSSL3 #332

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ jobs:
matrix_supportedSC4S: ${{ steps.matrix.outputs.supportedSC4S }}
matrix_supportedModinputFunctionalVendors: ${{ steps.matrix.outputs.supportedModinputFunctionalVendors }}
matrix_supportedUIVendors: ${{ steps.matrix.outputs.supportedUIVendors }}
openssl3_splunk: ${{steps.openssl3_splunk.outputs.splunk}}
openssl3_sc4s: ${{steps.openssl3_splunk.outputs.sc4s}}
permissions:
contents: write
packages: read
Expand All @@ -233,6 +235,11 @@ jobs:
persist-credentials: false
- id: matrix
uses: splunk/addonfactory-test-matrix-action@v2.1
- name: OpenSSL3-splunk
id: openssl3_splunk
run: |
echo "splunk={\"version\":\"splunk-9.4-OpenSSL3-1c4ff4fc48b6\", \"build\":\"1c4ff4fc48b6\", \"islatest\":false, \"isoldest\":false}" >> "$GITHUB_OUTPUT"
echo "sc4s={\"version\":\"3.30.1\", \"docker_registry\":\"ghcr.io/splunk/splunk-connect-for-syslog/container3\"}" >> "$GITHUB_OUTPUT"
- name: job summary
run: |
splunk_version_list=$(echo '${{ steps.matrix.outputs.supportedSplunk }}' | jq -r '.[].version')
Expand Down Expand Up @@ -1003,6 +1010,11 @@ jobs:
matrix:
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
sc4s: ${{ fromJson(needs.meta.outputs.matrix_supportedSC4S) }}
openssl3_splunk: [ false ]
include:
- splunk: ${{ fromJson(needs.meta.outputs.openssl3_splunk) }}
sc4s: ${{ fromJson(needs.meta.outputs.openssl3_sc4s) }}
openssl3_splunk: true
container:
image: ghcr.io/splunk/workflow-engine-base:4.1.0
env:
Expand Down Expand Up @@ -1271,7 +1283,11 @@ jobs:
matrix:
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
sc4s: ${{ fromJson(needs.meta.outputs.matrix_supportedSC4S) }}

openssl3_splunk: [ false ]
include:
- splunk: ${{ fromJson(needs.meta.outputs.openssl3_splunk) }}
sc4s: ${{ fromJson(needs.meta.outputs.openssl3_sc4s) }}
openssl3_splunk: true
container:
image: ghcr.io/splunk/workflow-engine-base:4.1.0
env:
Expand Down Expand Up @@ -1528,6 +1544,10 @@ jobs:
browser: [ "chrome" ]
vendor-version: ${{ fromJson(needs.meta.outputs.matrix_supportedUIVendors) }}
marker: ${{ fromJson(inputs.ui_marker) }}
openssl3_splunk: [ false ]
include:
- splunk: ${{ fromJson(needs.meta.outputs.openssl3_splunk) }}
browser: "chrome"
container:
image: ghcr.io/splunk/workflow-engine-base:4.1.0
env:
Expand Down Expand Up @@ -1805,6 +1825,11 @@ jobs:
modinput-type: [ "modinput_functional" ]
vendor-version: ${{ fromJson(needs.meta.outputs.matrix_supportedModinputFunctionalVendors) }}
marker: ${{ fromJson(inputs.marker) }}
openssl3_splunk: [ false ]
include:
- splunk: ${{ fromJson(needs.meta.outputs.openssl3_splunk) }}
modinput-type: [ "modinput_functional" ]
openssl3_splunk: true
container:
image: ghcr.io/splunk/workflow-engine-base:4.1.0
env:
Expand Down
Binary file added events.pickle
Binary file not shown.
12 changes: 12 additions & 0 deletions pytest_splunk_addon.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
2024-09-03 13:21:53,179 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:21:53,188 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
2024-09-03 13:22:02,138 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:22:02,145 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
2024-09-03 13:22:05,387 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:22:05,395 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
2024-09-03 13:22:07,295 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:22:07,301 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
2024-09-03 13:22:09,090 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:22:09,096 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
2024-09-03 13:22:15,389 - WARNING - plugin.py - pytest_configure - Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
2024-09-03 13:22:15,396 - INFO - pytest_splunk_addon_data_parser.py - _get_path_to_samples - Samples path is: package/samples
46 changes: 46 additions & 0 deletions runbooks/backporting-changes-to-older-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Runbook to backport changes to previous versions of `addonfactory-workflow-addon-release`
`addonfactory-workflow-addon-release` is utilized by all supported TAs. While it is strongly recommended to use the latest minor version of the reusable action, not all TAs consistently follow this guideline. As a result, there are cases when crucial updates introduced in the latest reusable workflow version need to be backported to its older versions that are still in use.

This runbook shows a real example of backporting changes correlated to `ta-automation-k8s-manifests`. In the example:
- current version of `addonfactory-workflow-addon-release` is `v4.17.0`
- there was a bug in `ta-automation-k8s-manifests` affecting all TAs
- there is a need to make a fix and release `v4.17.1` containing fixed `ta-automation-k8s-manifests` version ([PR](https://github.com/splunk/addonfactory-workflow-addon-release/pull/329))
- there is need to backport it to `v4.16` (the old version which is still in use by some TAs)
- the latest patch release of `v4.16` is `v4.16.14`
### Steps
- make release `v4.17.1` with necessary changes
- fetch all existing tags from `addonfactory-workflow-addon-release`:
```
git checkout main
git pull
git fetch --tags
```
- checkout to the latest tag of the minor release you want to backport the changes to
```
git checkout v4.16.14
```
- create a new branch based on the tag you are currently checked out to
```
git checkout -b fix/bump-k8s-manifest-version
```
- changes made in `ta-automation-k8s-manifests` were correlated with changes in `addonfactory-workflow-addon-release`, so there is a need to backport **only necessary** changes to `v4.16`. There are two ways to do that: by cherrypicking specific commits (and resolving the conflicts if they exist) or by commiting necessary changes manually.
- for example make necessary changes and commit them:
```
git add .github/workflows/reusable-build-test-release.yml
git commit -m "fix: bump k8s-manifest version"
```
- push newly created branch to the remote repository
- ```git push -u origin fix/bump-k8s-manifest-version```
- in GitHub UI:
- navigate to releases
- draft a new release
- `Choose a tag`: type the tag that will be created, i.e. `v4.16.15`
- `Target` - newly created branch `fix/bump-k8s-manifest-version`
- click on `Generate release notes`
- `Title of release` should be `v4.16.15 backport`
- write description of the changes
- uncheck `Set as the latest release` box
- click `Publish release`
- check if the release is available, and it points at the proper version - https://github.com/splunk/addonfactory-workflow-addon-release/tags tag `v4.16` should point to the same commit as tag `v4.16.15`
<img src="images/backporting/compare-tags.png" alt="tags"/>
- run the workflow for some TA using v4.16 to verify if the pipeline works as expected.
Binary file added runbooks/images/backporting/compare-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions splunksplwrapper.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[2024-09-03 13:22:15.390] WARNING - pytest-splunk-addon: Using the default value for --splunk-hec-token which is going to be deprecated. Please provide --splunk-hec-token argument when executing tests.
[2024-09-03 13:22:15.396] INFO - pytest-splunk-addon: Samples path is: package/samples
Loading