-
Notifications
You must be signed in to change notification settings - Fork 6
fix: ensure scheduled runs always use latest splunk version #459
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
Changes from all commits
ec895d4
e744612
f8138a5
acb2b8b
729eb0b
281a30b
2d95cc8
d47313c
b8988e7
4ddbfe5
583d119
829d381
d1a040c
4f5c3ca
0b70226
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -373,15 +373,24 @@ jobs: | |
| - id: determine_splunk | ||
| env: | ||
| wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }} | ||
| run: | | ||
| if [[ "$wfe_run_on_splunk_latest" == "" ]]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now wfe_run_on_splunk_latest is set to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, the previous logic never recalculated because the input defaulted to false, which is why the condition was refactored to explicitly evaluate branch and event instead of relying on an empty value. |
||
| 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')) }}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the variable is never empty, this block never runs and the value is never recalculated based on the branch or event. That means the logic below is effectively skipped every time
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, this was the core issue, and the fix ensures the value is always recomputed based on schedule, input, branch, and event as required by Jira.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is old commit which is removed this empty input code in the latest finalized commit. |
||
| run: | | ||
| if [[ "${{ github.event_name }}" == "schedule" ]]; then | ||
| wfe_run_on_splunk_latest="true" | ||
|
|
||
| else | ||
| if [[ "${{ github.base_ref }}" == "main" || "${{ github.ref_name }}" == "main" ]] || \ | ||
| [[ "${{ github.ref_name }}" == "develop" && "${{ github.event_name }}" == "push" ]]; then | ||
| wfe_run_on_splunk_latest="false" | ||
| else | ||
| wfe_run_on_splunk_latest="true" | ||
poojpat2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fi | ||
| fi | ||
| if [[ "$wfe_run_on_splunk_latest" == "true" ]]; then | ||
| echo "matrixSplunk=${{ toJson(steps.matrix.outputs.latestSplunk) }}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "matrixSplunk=${{toJson(steps.matrix.outputs.supportedSplunk) }}" >> "$GITHUB_OUTPUT" | ||
| echo "matrixSplunk=${{ toJson(steps.matrix.outputs.supportedSplunk) }}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: job summary | ||
| run: | | ||
| splunk_version_list=$(echo '${{ steps.determine_splunk.outputs.matrixSplunk }}' | jq -r '.[].version') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is removed, then input inputs.wfe-run-on-splunk-latest is never referenced in the workflow, meaning it's reduntant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example run supposed to run on all Splunk versions supported: https://github.com/splunk/test-addonfactory-repo/actions/runs/21628063395
https://github.com/splunk/test-addonfactory-repo/blob/refs/heads/mkolasinski-splunk-patch-3/.github/workflows/build-test-release.yml#L29