TEST-INFRA: [ci-pipeline-design] Implement conditional execution for CI jobs #1859

Open
opened 2026-04-03 00:00:06 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/v3.8.0-ci-conditional-job-execution
  • Commit Message: feat(ci): implement path-based conditional execution for CI jobs
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The entire CI pipeline currently runs on every push to master and develop, regardless of which files were changed. This is inefficient, especially for changes that only affect documentation or other non-code assets. Jobs such as docker and helm are expensive and provide no value when only documentation files are modified.

Implementing path-based filters in .forgejo/workflows/ci.yml using the on.push.paths and on.pull_request.paths keys will allow the CI system to skip irrelevant jobs, reducing unnecessary CI runs and conserving runner resources.

Expected Behavior

CI jobs that are not relevant to the changed files should be skipped automatically. For example:

  • The docker and helm jobs should not run when only documentation files (e.g. docs/**, *.md) are changed.
  • Source-code jobs (lint, typecheck, unit tests, etc.) should continue to run whenever Python source files or configuration files are modified.

Acceptance Criteria

  • The CI pipeline uses path-based filters to conditionally execute jobs where appropriate.
  • The docker and helm jobs are skipped when only documentation files are changed.
  • All jobs that should run on source-code changes continue to do so correctly.
  • No regressions are introduced in the existing CI pipeline behaviour.

Supporting Information

  • Parent Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing)
  • Related issue: #1793 (Implement conditional test execution based on code changes)
  • Implementation target: .forgejo/workflows/ci.yml

Subtasks

  • Analyse the CI pipeline to identify all jobs that can be safely skipped based on changed file paths.
  • Define path filter sets (e.g. docs-only paths, source-code paths, Helm/Docker paths).
  • Add on.push.paths and on.pull_request.paths filters to the appropriate jobs in .forgejo/workflows/ci.yml.
  • Verify that documentation-only commits skip the docker and helm jobs.
  • Verify that source-code commits still trigger all relevant jobs.
  • Update features/ci_workflow_validation.feature to assert path-based conditional execution behaviour.
  • Run all nox sessions and fix any errors.
  • Verify coverage >= 97%.

Definition of Done

  • .forgejo/workflows/ci.yml uses path-based filters to skip irrelevant jobs for documentation-only changes.
  • The docker and helm jobs are confirmed to be skipped when only docs/** or *.md files are changed.
  • features/ci_workflow_validation.feature is updated to cover the new path-filter behaviour.
  • 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.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `task/v3.8.0-ci-conditional-job-execution` - **Commit Message**: `feat(ci): implement path-based conditional execution for CI jobs` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The entire CI pipeline currently runs on every push to `master` and `develop`, regardless of which files were changed. This is inefficient, especially for changes that only affect documentation or other non-code assets. Jobs such as `docker` and `helm` are expensive and provide no value when only documentation files are modified. Implementing path-based filters in `.forgejo/workflows/ci.yml` using the `on.push.paths` and `on.pull_request.paths` keys will allow the CI system to skip irrelevant jobs, reducing unnecessary CI runs and conserving runner resources. ## Expected Behavior CI jobs that are not relevant to the changed files should be skipped automatically. For example: - The `docker` and `helm` jobs should not run when only documentation files (e.g. `docs/**`, `*.md`) are changed. - Source-code jobs (lint, typecheck, unit tests, etc.) should continue to run whenever Python source files or configuration files are modified. ## Acceptance Criteria - [ ] The CI pipeline uses path-based filters to conditionally execute jobs where appropriate. - [ ] The `docker` and `helm` jobs are skipped when only documentation files are changed. - [ ] All jobs that should run on source-code changes continue to do so correctly. - [ ] No regressions are introduced in the existing CI pipeline behaviour. ## Supporting Information - Parent Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing) - Related issue: #1793 (Implement conditional test execution based on code changes) - Implementation target: `.forgejo/workflows/ci.yml` ## Subtasks - [ ] Analyse the CI pipeline to identify all jobs that can be safely skipped based on changed file paths. - [ ] Define path filter sets (e.g. docs-only paths, source-code paths, Helm/Docker paths). - [ ] Add `on.push.paths` and `on.pull_request.paths` filters to the appropriate jobs in `.forgejo/workflows/ci.yml`. - [ ] Verify that documentation-only commits skip the `docker` and `helm` jobs. - [ ] Verify that source-code commits still trigger all relevant jobs. - [ ] Update `features/ci_workflow_validation.feature` to assert path-based conditional execution behaviour. - [ ] Run all `nox` sessions and fix any errors. - [ ] Verify coverage >= 97%. ## Definition of Done - [ ] `.forgejo/workflows/ci.yml` uses path-based filters to skip irrelevant jobs for documentation-only changes. - [ ] The `docker` and `helm` jobs are confirmed to be skipped when only `docs/**` or `*.md` files are changed. - [ ] `features/ci_workflow_validation.feature` is updated to cover the new path-filter behaviour. - [ ] 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. - [ ] 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-03 00:01:35 +00:00
Author
Owner

Issue triaged by project owner:

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

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. --- **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#1859
No description provided.