Skip to content

feat(ci): accelerate devops ci performance with worker auto-scaling, test hotspot isolation, and zero-blocking dispatch #260

Closed

Description

@dan-petty

Problem Statement

devops ci currently takes ~3m 15s to complete. Profiling revealed three primary bottlenecks:

  1. Hardcoded --maxprocesses=4 throttling pytest xdist workers, leaving up to 75% of available CPU cores idle on multi-core systems.
  2. Pathological unit tests with unmocked socket/network probes and unbounded workspace directory traversal (test_k8s_bootstrap_success taking 78s, test_repomap_cli taking 70s, test_ci.py taking 46s), consuming over 250s of CPU time.
  3. Synchronous sequential execution of docs_fix (DocGenerator.check_docs) running for 16.5s before background concurrent tasks (including pytest) are launched.

Acceptance Criteria

  1. Dynamically scale pytest xdist workers based on available CPU cores (min(os.cpu_count() or 4, 16)), removing the hardcoded --maxprocesses=4 limit.
  2. Isolate test hotspots with proper mocking:
    • Mock devops_cli.commands.k8s.networking.configure_urls in tests/test_k8s_context.py (dropping from 78s to <0.05s).
    • Pass isolated tmp_path target in tests/test_ai_repomap.py (dropping from 70s to <0.1s).
    • Mock workspace fingerprinting in tests/test_ci.py (dropping from 46s to <0.05s).
  3. Reorder pipeline dispatch so that pytest is launched immediately without waiting for synchronous docs checks.
  4. Maintain 100% test pass rate, code coverage >= 90%, and strict complexity M <= 10.

Activity

  1. added this to the v0.2.20 milestone on Sep 18, 2026
  2. added
    type/feature
    scope/cli
    priority/p0-critical
    on Sep 18, 2026
  3. dan-petty commented on Sep 18, 2026

    @dan-petty
    OwnerAuthor

    Closed via PR #261.

  4. added a commit that references this issue on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p0-criticalscope/clitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions