-
Notifications
You must be signed in to change notification settings - Fork 4
CICD 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.
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.
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.
The test job follows a linear progression to validate the environment and script integrity:
-
Environment Setup: Initializes the specific Python version and leverages
pipcaching to accelerate subsequent runs. -
Core Installation: Installs the package in editable mode (
pip install -e .), which registers the CLI entry points .github/workflows/ci.yml:31 . -
CLI Availability Check: Verifies that the primary orchestration scripts respond to help/list commands. This ensures that
task_runner.py,template_builder.py, andsetup.pyare free of syntax errors and can initialize their argument parsers. -
Dependency Import Verification: A critical step that attempts to import major libraries (e.g.,
pandas,httpx,rich,bs4) to confirm that thepyproject.tomldependencies are correctly resolved and installed.
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
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.
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.
-
Version Extraction: The
vprefix is stripped from the tag name (e.g.,v1.2.0becomes1.2.0) .github/workflows/release.yml:28 . -
Section Isolation: The workflow uses
awkto 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 . -
Note Cleaning: The header and trailing lines are trimmed using
headandtailto provide a clean body for the release notes .github/workflows/release.yml:29 .
The softprops/action-gh-release action is used to finalize the release.
- Tag & Name: Uses the git tag and prefixes it with "Claude Sleuth".
-
Body: Injects the parsed
NOTESfrom the changelog .github/workflows/release.yml:39 . -
Prerelease Detection: Automatically marks the release as a "Prerelease" if the version tag contains a hyphen (e.g.,
v1.0.0-rc1) .github/workflows/release.yml:41 .
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
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 . |