Skip to content

CICD Smoke Tests Release Automation

elb-pr edited this page Apr 7, 2026 · 2 revisions

CI/CD: Smoke Tests & Release Automation

This page details the automated workflows governing the quality assurance and distribution of the Claude Sleuth toolkit. The project utilizes GitHub Actions to ensure cross-version Python compatibility and to automate the generation of release notes from project metadata.

Continuous Integration (CI)

The CI pipeline, defined in .github/workflows/ci.yml, serves as a "smoke test" suite. It is triggered on every push to the main branch and on all pull requests targeting main.

Multi-Version Test Matrix

The workflow executes a test matrix across three Python versions: 3.10, 3.11, and 3.12 .github/workflows/ci.yml:16 . This ensures that the toolkit remains functional as users upgrade their local environments.

Execution Flow

The test job follows a linear progression to validate the environment and script integrity:

  1. Environment Setup: Initializes the specific Python version and leverages pip caching to accelerate subsequent runs.
  2. Core Installation: Installs the package in editable mode (pip install -e .), which registers the CLI entry points .github/workflows/ci.yml:31 .
  3. CLI Availability Check: Verifies that the primary orchestration scripts respond to help/list commands. This ensures that task_runner.py, template_builder.py, and setup.py are free of syntax errors and can initialize their argument parsers.
  4. Dependency Import Verification: A critical step that attempts to import major libraries (e.g., pandas, httpx, rich, bs4) to confirm that the pyproject.toml dependencies are correctly resolved and installed.

CI Data Flow and Verification

The following diagram illustrates how the CI workflow bridges the GitHub Actions environment to the codebase entities.

CI Workflow to Code Entity Mapping

graph TD
    subgraph "GitHub Actions Runner"
        A["ci.yml"] --> B["Setup Python Matrix"]
        B --> C["pip install -e ."]
    end

    subgraph "Codebase Entities (skills/claude-sleuth/)"
        C --> D["scripts/task_runner.py"]
        C --> E["scripts/template_builder.py"]
        C --> F["scripts/setup.py"]
    end

    subgraph "Verification Commands"
        D -- "run" --> G["--help"]
        E -- "run" --> H["--help"]
        F -- "run" --> I["--list"]
    end

    subgraph "Import Check"
        J["python -c 'import...'"] --> K["requests"]
        J --> L["pandas"]
        J --> M["rich"]
    end
Loading

Release Automation

The release process is fully automated via .github/workflows/release.yml. It is triggered whenever a git tag following the semantic versioning pattern v* (e.g., v1.0.2) is pushed to the repository.

Automated Changelog Parsing

The workflow automates the extraction of release notes from CHANGELOG.md using awk and sed. This ensures that the GitHub Release description perfectly matches the documentation in the repository.

  1. Version Extraction: The v prefix is stripped from the tag name (e.g., v1.2.0 becomes 1.2.0) .github/workflows/release.yml:28 .
  2. Section Isolation: The workflow uses awk to find the block of text starting with the header for the current version (e.g., ## [1.2.0]) and ending at the next version header .github/workflows/release.yml:29 .
  3. Note Cleaning: The header and trailing lines are trimmed using head and tail to provide a clean body for the release notes .github/workflows/release.yml:29 .

GitHub Release Creation

The softprops/action-gh-release action is used to finalize the release.

Release Data Pipeline

This diagram shows the transformation of a Git Tag into a formal GitHub Release via text processing of the project's changelog.

Release Automation Logic

graph LR
    subgraph "Git Event"
        T["git tag v1.x.x"] --> R["release.yml"]
    end

    subgraph "Text Processing (awk/sed)"
        R --> V["Extract VERSION_BARE"]
        V --> P["Parse CHANGELOG.md"]
        P --> N["Isolate ## [VERSION_BARE] section"]
    end

    subgraph "GitHub API"
        N --> G["Create Release"]
        G --> B["Set 'body' from NOTES"]
        G --> PR["Set 'prerelease' flag"]
    end
Loading

Workspace Maintenance

The project maintains a .gitignore file to ensure that local investigation data and temporary build artifacts do not leak into the repository or CI environment.

Category Patterns Purpose
Investigation Data outputs/, .sleuth-progress.json Prevents case-specific data from being committed .gitignore:2, 35 .
Large Assets assets/sanctions/ Sanctions lists are downloaded on-demand and excluded from git .gitignore:5 .
Python Artifacts __pycache__/, *.egg-info/, dist/ Standard Python build and cache exclusions.
Virtual Envs venv/, .venv/ Ensures clean environments for every user.
Browser Data playwright-browsers/ Excludes binary browser engines used by evidence_preservation.py .gitignore:34 .

Clone this wiki locally