Back to all reviewers

CI conditional job handling

calcom/cal.com
Based on 2 comments
Yaml

When implementing CI workflows with path-based filtering, ensure that conditional jobs don't inadvertently block PR merges when they don't execute. Maintain proper path filtering to run jobs only when relevant files change, but account for scenarios where filtered jobs are listed as required dependencies.

CI/CD Yaml

Reviewer Prompt

When implementing CI workflows with path-based filtering, ensure that conditional jobs don’t inadvertently block PR merges when they don’t execute. Maintain proper path filtering to run jobs only when relevant files change, but account for scenarios where filtered jobs are listed as required dependencies.

For workflows with path filtering, use if conditions or separate the conditional jobs from required job lists to prevent blocking PRs that don’t trigger those specific workflows.

Example of problematic configuration:

# atoms-e2e.yml - runs only on specific paths
on:
  pull_request:
    paths:
      - 'packages/atoms/**'

# pr.yml - requires atoms job even when it doesn't run
jobs:
  required-checks:
    needs: [
      e2e-embed,
      e2e-atoms,  # This blocks PRs when atoms-e2e doesn't run
    ]

Instead, handle conditional dependencies appropriately by either using conditional requirements or separating path-specific jobs from universal requirements.

2
Comments Analyzed
Yaml
Primary Language
CI/CD
Category

Source Discussions