Skip to content

Enforce long running pipeline to run only on set schedule on master b…#4209

Open
sivakami-projects wants to merge 1 commit intomasterfrom
enable-only-scheduled-runs
Open

Enforce long running pipeline to run only on set schedule on master b…#4209
sivakami-projects wants to merge 1 commit intomasterfrom
enable-only-scheduled-runs

Conversation

@sivakami-projects
Copy link
Contributor

Enforce only scheduled runs to run on the long running test pipeline.
Long running swiftv2 cluster test pipeline, runs data path tests on a pre-created swiftv2 cluster. Multiple runs run simultaneously on the same cluster, it could lead to failures as the pods created by one test could use all the available nics on the cluster, leaving the other runs to fail.

Enforced this by adding a check to validate if the current run is on master branch and if it is a scheduled run.

Reason for Change:

Issue Fixed:

Requirements:

Notes:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds enforcement to ensure the long running SwiftV2 cluster test pipeline only executes on scheduled runs on the master branch. This prevents concurrent test runs that could interfere with each other by exhausting available NICs on the shared test cluster.

Changes:

  • Added a ValidateScheduledRun stage that checks Build.Reason is "Schedule" and Build.SourceBranch is "refs/heads/master"
  • Updated AKSClusterAndNetworking stage to depend on ValidateScheduledRun
  • Added an unused variable declaration for isScheduledMasterRun

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml Adds validation stage with runtime checks and updates stage dependencies
.pipelines/swiftv2-long-running/pipeline.yaml Defines unused compile-time variable for scheduled master run detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +12 to +16
variables:
# Enforce scheduled runs only on master branch
- name: isScheduledMasterRun
value: ${{ and(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}

Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The variable 'isScheduledMasterRun' is defined but never used in the pipeline. This variable appears to be redundant since the validation logic is implemented directly in the ValidateScheduledRun stage using shell script checks. Consider removing this unused variable declaration to avoid confusion.

Suggested change
variables:
# Enforce scheduled runs only on master branch
- name: isScheduledMasterRun
value: ${{ and(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +62
dependsOn: ValidateScheduledRun
condition: and(succeeded(), eq(${{ parameters.runSetupStages }}, true))
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

When runSetupStages is false, the datapath test stages will bypass the ValidateScheduledRun stage. This happens because:

  1. AKSClusterAndNetworking stage has condition and(succeeded(), eq(parameters.runSetupStages, true)) which causes it to be skipped when runSetupStages is false
  2. The datapath test stages depend on AKSClusterAndNetworking (lines 207-213 in long-running-pipeline-template.yaml)
  3. The datapath test stages have condition or(eq(parameters.runSetupStages, false), succeeded()) which allows them to run even when their dependency is skipped

This means when runSetupStages is false, tests will run without validation, defeating the purpose of this PR. To fix this, the datapath test stages should explicitly include ValidateScheduledRun in their dependencies when runSetupStages is false.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant