Skip to content

Conversation

@poojpat2
Copy link

Description

Fix scheduled runs incorrectly executing on all supported Splunk versions.

@poojpat2 poojpat2 requested a review from a team as a code owner January 29, 2026 18:13
@github-actions
Copy link

github-actions bot commented Jan 29, 2026

CLA Assistant Lite bot All contributors have signed the COC ✍️ ✅
Posted by the CLA Assistant Lite bot.

@poojpat2
Copy link
Author

I have read the Code of Conduct and I hereby accept the Terms

@poojpat2
Copy link
Author

recheck

@mkolasinski-splunk
Copy link
Contributor

@poojpat2 please provide links to test runs, best for couple of scenarios:

  1. scheduled run
  2. PR towards main
  3. PR towards develop
  4. push towards develop

features: PYTHON39
- id: determine_splunk
env:
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poojpat2
Copy link
Author

poojpat2 commented Feb 3, 2026

All the jobs are working as per description mentioned in jira.
The details of the executed jobs are provided below:

  1. scheduled run : https://github.com/splunk/test-addonfactory-repo/actions/runs/21639249437
  2. PR towards main : https://github.com/splunk/test-addonfactory-repo/actions/runs/21636162587
  3. PR towards develop :https://github.com/splunk/test-addonfactory-repo/actions/runs/21635836696
  4. push towards develop : https://github.com/splunk/test-addonfactory-repo/actions/runs/21635912203
  5. https://github.com/splunk/test-addonfactory-repo/actions/runs/21664018661 (when explicitly forced to true)

@poojpat2 poojpat2 changed the title Fix Splunk version for scheduled jobs fix(ci): ensure scheduled runs always use latest splunk version Feb 4, 2026
if [[ "${{ github.event_name }}" == "schedule" ]]; then
wfe_run_on_splunk_latest="true"
elif [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
wfe_run_on_splunk_latest="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks if wfe_run_on_splunk_latest is equal to true, and if it is, it sets wfe_run_on_splunk_latest to true again?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit input=true ALWAYS forces latest

Copy link
Contributor

@mbruzda-splunk mbruzda-splunk Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the variable is already true, this just sets it to true again, so it’s effectively a no op

Copy link
Author

@poojpat2 poojpat2 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the calling workflow if dveloper/other user explicitly provide "wfe_run_on_splunk_latest=true" input then below condition will trigger in the sceduled jobs.

elif [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
wfe_run_on_splunk_latest="true"

- name: run-btool-check
id: run-btool-check
timeout-minutes: 10
timeout-minutes: 20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is related to fixing schedule runs. Please create a separate branch for this. Let's not set a practice to work on everything on a single branch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.I will create seperate branch.

required: false
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."
type: string
default: "false"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is set to false by default

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's set to "false" only

env:
wfe_run_on_splunk_latest: ${{ inputs.wfe-run-on-splunk-latest }}
run: |
if [[ "$wfe_run_on_splunk_latest" == "" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now wfe_run_on_splunk_latest is set to false at the top of the workflow, so this condition never passes

Copy link
Author

Choose a reason for hiding this comment

The 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: ${{ inputs.wfe-run-on-splunk-latest }}
run: |
if [[ "$wfe_run_on_splunk_latest" == "" ]]; then
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')) }}"
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think wfe_run_on_splunk_latest would be calculated correctly if we actually reached this code block?

Copy link
Author

Choose a reason for hiding this comment

The 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.

elif [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
wfe_run_on_splunk_latest="true"
elif [[ "${{ github.base_ref }}" == "main" || "${{ github.ref_name }}" == "main" ]] || \
[[ ("${{ github.base_ref }}" == "develop" || "${{ github.ref_name }}" == "develop")]]; then
Copy link
Contributor

@mbruzda-splunk mbruzda-splunk Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line has a syntax bus in bash script. [[ ( is fine, but you’re missing spaces and you have )]] jammed together. This might work anyway, but readability suffers

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll correct the spacing in the condition to improve readability.

@poojpat2 poojpat2 changed the title fix(ci): ensure scheduled runs always use latest splunk version fix: ensure scheduled runs always use latest splunk version Feb 6, 2026
Comment on lines 379 to 380
elif [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
wfe_run_on_splunk_latest="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif [[ "$wfe_run_on_splunk_latest" == "true" ]]; then
wfe_run_on_splunk_latest="true"

These two lines look redundant, please remove them

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I’ve removed the redundant lines as suggested.

@poojpat2 poojpat2 force-pushed the workflow_scheduleruns branch from 47a89f6 to 0b70226 Compare February 10, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants