Consolidate static analysis jobs into a matrix-driven CI job #9528

Open
opened 2026-04-14 21:35:07 +00:00 by HAL9000 · 8 comments
Owner

Summary

  • Collapse the nearly identical lint, format, typecheck, security, and complexity jobs into a single matrix-driven job that parameterizes the Nox session.
  • Reduce workflow duplication and make it easier to add new static checks or update shared bootstrap logic.

Problem Statement

  • In .forgejo/workflows/ci.yml, the lint, typecheck, security, and quality jobs all run the same container, package installs, uv/nox bootstrap, cache configuration, and log upload steps. They differ only in the Nox session invoked and the artifact name.
  • Each job copies ~40 lines of YAML, so any change to the environment (e.g. adding pip install --upgrade pip, changing cache keys, or adding apt-get packages) must be edited in four places. The nightly-quality workflow repeats the same pattern yet again.
  • Status reporting is fragmented: the top-level status-check job simply relays the four job results, but the duplication makes it harder to discover which step failed and extends workflow maintenance time.

Recommendation

  • Replace the four standalone jobs with a single job, e.g. static-checks, that uses strategy.matrix to drive the Nox session and artifact name. Example matrix entries:
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: lint
            nox_session: lint
            artifact: ci-logs-lint
          - name: typecheck
            nox_session: typecheck
            artifact: ci-logs-typecheck
          - name: security
            nox_session: security_scan
            artifact: ci-logs-security
          - name: quality
            nox_session: complexity
            artifact: ci-logs-quality
    
    and update the run step to honor the matrix variables while teeing output to build/ for artifact uploads. If the lint task still needs to run both lint and format -- --check, supply those commands in a small conditional wrapper keyed on ${{ matrix.name }}.
  • Emit artifacts using ${{ matrix.artifact }} so each run keeps a dedicated log bundle, preserving the current diagnostics behavior.
  • Keep the downstream status-check job but switch it to depend on the single matrix job (needs: static-checks) alongside the other long-running jobs (tests, docker, helm).
  • Apply the same pattern to nightly-quality.yml, allowing the scheduled workflow to reuse the matrix job or call a reusable workflow shared with ci.yml.

Duplicate Check


Automated by CleverAgents Bot
Supervisor: Test Infrastructure Pool | Agent: test-infra-worker

## Summary - Collapse the nearly identical lint, format, typecheck, security, and complexity jobs into a single matrix-driven job that parameterizes the Nox session. - Reduce workflow duplication and make it easier to add new static checks or update shared bootstrap logic. ## Problem Statement - In `.forgejo/workflows/ci.yml`, the `lint`, `typecheck`, `security`, and `quality` jobs all run the same container, package installs, uv/nox bootstrap, cache configuration, and log upload steps. They differ only in the Nox session invoked and the artifact name. - Each job copies ~40 lines of YAML, so any change to the environment (e.g. adding `pip install --upgrade pip`, changing cache keys, or adding `apt-get` packages) must be edited in four places. The `nightly-quality` workflow repeats the same pattern yet again. - Status reporting is fragmented: the top-level `status-check` job simply relays the four job results, but the duplication makes it harder to discover which step failed and extends workflow maintenance time. ## Recommendation - Replace the four standalone jobs with a single job, e.g. `static-checks`, that uses `strategy.matrix` to drive the Nox session and artifact name. Example matrix entries: ```yaml strategy: fail-fast: false matrix: include: - name: lint nox_session: lint artifact: ci-logs-lint - name: typecheck nox_session: typecheck artifact: ci-logs-typecheck - name: security nox_session: security_scan artifact: ci-logs-security - name: quality nox_session: complexity artifact: ci-logs-quality ``` and update the run step to honor the matrix variables while teeing output to `build/` for artifact uploads. If the lint task still needs to run both `lint` and `format -- --check`, supply those commands in a small conditional wrapper keyed on `${{ matrix.name }}`. - Emit artifacts using `${{ matrix.artifact }}` so each run keeps a dedicated log bundle, preserving the current diagnostics behavior. - Keep the downstream `status-check` job but switch it to depend on the single matrix job (`needs: static-checks`) alongside the other long-running jobs (tests, docker, helm). - Apply the same pattern to `nightly-quality.yml`, allowing the scheduled workflow to reuse the matrix job or call a reusable workflow shared with `ci.yml`. ### Duplicate Check - [Open issues search: "matrix static checks" query](https://git.cleverthis.com/cleveragents/cleveragents-core/issues?q=matrix+static+checks) - [Closed issues search: "matrix static checks" query](https://git.cleverthis.com/cleveragents/cleveragents-core/issues?q=matrix+static+checks&state=closed) - [Cross-area search: "matrix nox" query](https://git.cleverthis.com/cleveragents/cleveragents-core/issues?q=matrix+nox) --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure Pool | Agent: test-infra-worker
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

[AUTO-OWNR-1] Triage Decision: Verified — MoSCoW/Should Have

Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion.

Milestone: v3.8.0
Priority: Medium


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

Automated by CleverAgents Bot
Agent: automation-tracking-manager

[AUTO-OWNR-1] **Triage Decision: Verified — MoSCoW/Should Have** Core A2A server handler implementation for v3.8.0. Should Have for server milestone completion. **Milestone:** v3.8.0 **Priority:** Medium --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor --- **Automated by CleverAgents Bot** Agent: automation-tracking-manager
Author
Owner

🏷️ Triage Decision — [AUTO-OWNR-1]

Status: Verified

Issue Type: CI/Infrastructure
MoSCoW: Could Have — CI consolidation is a nice-to-have improvement
Priority: Low

Rationale: Consolidating static analysis jobs into a matrix-driven CI job is a CI maintenance improvement. Could Have because it reduces CI complexity but doesn't affect functionality.

Labels to apply: State/Verified, MoSCoW/Could have, Priority/Low, Type/Task


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

## 🏷️ Triage Decision — [AUTO-OWNR-1] **Status:** ✅ Verified **Issue Type:** CI/Infrastructure **MoSCoW:** Could Have — CI consolidation is a nice-to-have improvement **Priority:** Low **Rationale:** Consolidating static analysis jobs into a matrix-driven CI job is a CI maintenance improvement. Could Have because it reduces CI complexity but doesn't affect functionality. **Labels to apply:** State/Verified, MoSCoW/Could have, Priority/Low, Type/Task --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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.

Dependencies

No dependencies set.

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