TEST-INFRA: [ci-pipeline-design] Implement conditional execution to skip jobs based on file changes #1702

Open
opened 2026-04-02 23:31:30 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/ci-conditional-job-execution-on-file-changes
  • Commit Message: feat(ci): implement conditional job execution based on file path filters
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The ci.yml workflow currently runs all jobs on every push and pull request, regardless of which files have changed. This leads to unnecessary resource consumption and longer pipeline execution times. For example, if only documentation files are changed, there is no need to run the full test suite. Implementing path-based conditional execution is a key CI optimization that reduces wasted runner capacity and improves developer feedback loop speed.

Expected Behavior

The CI pipeline should selectively execute jobs based on which files were modified in a given push or pull request:

  • The docs job should only run when files under docs/ have changed.
  • The lint, typecheck, security, quality, and tests jobs should only run when Python source files (e.g. src/**, features/**, robot/**, noxfile.py) have changed.
  • The docker job should only run when the Dockerfile has changed.
  • All jobs should still run on pushes to master to ensure the main branch is always fully validated.

Subtasks

  • Investigate using the paths and paths-ignore filters available in Forgejo/GitHub Actions workflow syntax for conditional job execution.
  • Modify .forgejo/workflows/ci.yml to add paths filters to the on: push and on: pull_request triggers for relevant jobs.
  • Ensure the docs job is only triggered when files in docs/ change.
  • Ensure lint, typecheck, security, quality, and tests jobs are only triggered when Python source files change.
  • Ensure the docker job is only triggered when Dockerfile changes.
  • Ensure all jobs still run unconditionally on pushes to master.
  • Update features/ci_workflow_validation.feature to assert that path filters are present and correctly configured for each job.
  • Verify that jobs are correctly skipped when irrelevant files are changed (manual or automated verification).
  • Run nox (all default sessions) and fix any errors.
  • Verify coverage >= 97% via nox -s coverage_report.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • .forgejo/workflows/ci.yml uses paths filters so that jobs are skipped when unrelated files change.
  • features/ci_workflow_validation.feature is updated to cover the new path filter configuration.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `task/ci-conditional-job-execution-on-file-changes` - **Commit Message**: `feat(ci): implement conditional job execution based on file path filters` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The `ci.yml` workflow currently runs all jobs on every push and pull request, regardless of which files have changed. This leads to unnecessary resource consumption and longer pipeline execution times. For example, if only documentation files are changed, there is no need to run the full test suite. Implementing path-based conditional execution is a key CI optimization that reduces wasted runner capacity and improves developer feedback loop speed. ## Expected Behavior The CI pipeline should selectively execute jobs based on which files were modified in a given push or pull request: - The `docs` job should only run when files under `docs/` have changed. - The `lint`, `typecheck`, `security`, `quality`, and `tests` jobs should only run when Python source files (e.g. `src/**`, `features/**`, `robot/**`, `noxfile.py`) have changed. - The `docker` job should only run when the `Dockerfile` has changed. - All jobs should still run on pushes to `master` to ensure the main branch is always fully validated. ## Subtasks - [ ] Investigate using the `paths` and `paths-ignore` filters available in Forgejo/GitHub Actions workflow syntax for conditional job execution. - [ ] Modify `.forgejo/workflows/ci.yml` to add `paths` filters to the `on: push` and `on: pull_request` triggers for relevant jobs. - [ ] Ensure the `docs` job is only triggered when files in `docs/` change. - [ ] Ensure `lint`, `typecheck`, `security`, `quality`, and `tests` jobs are only triggered when Python source files change. - [ ] Ensure the `docker` job is only triggered when `Dockerfile` changes. - [ ] Ensure all jobs still run unconditionally on pushes to `master`. - [ ] Update `features/ci_workflow_validation.feature` to assert that path filters are present and correctly configured for each job. - [ ] Verify that jobs are correctly skipped when irrelevant files are changed (manual or automated verification). - [ ] Run `nox` (all default sessions) and fix any errors. - [ ] Verify coverage >= 97% via `nox -s coverage_report`. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - `.forgejo/workflows/ci.yml` uses `paths` filters so that jobs are skipped when unrelated files change. - `features/ci_workflow_validation.feature` is updated to cover the new path filter configuration. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:32:05 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#1702
No description provided.