TEST-INFRA: [ci-pipeline-design] Introduce reusable workflows to reduce CI duplication #3778

Open
opened 2026-04-06 06:16:10 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: task/ci-pipeline-design/reusable-workflows
  • Commit Message: refactor(ci): introduce reusable workflow to eliminate setup step duplication
  • Milestone: Backlog
  • Parent Epic: #1678

Description

The main ci.yml workflow contains a significant amount of boilerplate and duplication across its jobs. Each job (lint, typecheck, security, quality, unit_tests, etc.) repeats the same sequence of steps for:

  1. Installing Node.js
  2. Checking out the repository
  3. Installing uv and nox
  4. Caching the uv package directory

This duplication makes the CI configuration harder to maintain and increases the risk of inconsistencies.

Proposed Solution

To address this, we should introduce a reusable workflow that encapsulates these common setup steps. This workflow can then be called by each of the main jobs, reducing the overall size of ci.yml and centralizing the setup logic.

Subtasks

  • Create a new reusable workflow file (e.g., .forgejo/workflows/setup.yml)
  • Move the common setup steps into the reusable workflow
  • Refactor the ci.yml file to use the new reusable workflow
  • Verify that the CI pipeline continues to function as expected after the changes
  • Run nox (all default sessions), 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.
  • The ci.yml file is refactored to use a reusable workflow for common setup steps.
  • The total number of lines in ci.yml is significantly reduced.
  • The CI pipeline passes successfully after the changes.
  • All nox stages pass.
  • Coverage >= 97%

Duplicate Check

  • Search queries used: "reusable workflow", "ci duplication", "ci boilerplate"
  • Number of results found for each query: 0
  • Why none of the existing issues cover this specific finding: No existing issues were found that address the duplication of setup steps in the CI pipeline.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `task/ci-pipeline-design/reusable-workflows` - **Commit Message**: `refactor(ci): introduce reusable workflow to eliminate setup step duplication` - **Milestone**: Backlog - **Parent Epic**: #1678 ## Description The main `ci.yml` workflow contains a significant amount of boilerplate and duplication across its jobs. Each job (`lint`, `typecheck`, `security`, `quality`, `unit_tests`, etc.) repeats the same sequence of steps for: 1. Installing Node.js 2. Checking out the repository 3. Installing `uv` and `nox` 4. Caching the `uv` package directory This duplication makes the CI configuration harder to maintain and increases the risk of inconsistencies. ## Proposed Solution To address this, we should introduce a reusable workflow that encapsulates these common setup steps. This workflow can then be called by each of the main jobs, reducing the overall size of `ci.yml` and centralizing the setup logic. ## Subtasks - [ ] Create a new reusable workflow file (e.g., `.forgejo/workflows/setup.yml`) - [ ] Move the common setup steps into the reusable workflow - [ ] Refactor the `ci.yml` file to use the new reusable workflow - [ ] Verify that the CI pipeline continues to function as expected after the changes - [ ] Run `nox` (all default sessions), 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. - The `ci.yml` file is refactored to use a reusable workflow for common setup steps. - The total number of lines in `ci.yml` is significantly reduced. - The CI pipeline passes successfully after the changes. - All nox stages pass. - Coverage >= 97% ## Duplicate Check - Search queries used: "reusable workflow", "ci duplication", "ci boilerplate" - Number of results found for each query: 0 - Why none of the existing issues cover this specific finding: No existing issues were found that address the duplication of setup steps in the CI pipeline. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
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#3778
No description provided.