Skip to main content

Historical deployment analysis โ€” walk git history, deploy per day, test all endpoints, capture screenshots, restore working fragments

Project description

resplit

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • ๐Ÿค– LLM usage: $0.9000 (6 commits)
  • ๐Ÿ‘ค Human dev: ~$215 (2.2h @ $100/h, 30min dedup)

Generated on 2026-05-01 using openrouter/qwen/qwen3-coder-next


Historical deployment analysis โ€” walk git history day by day, deploy per commit, test all endpoints, capture screenshots, restore working fragments.

Version Python License Tests


What it does

  1. Walk โ€” iterates through git history day by day (configurable range)
  2. Deploy โ€” starts the service per commit (docker-compose / uvicorn / none)
  3. Scan โ€” detects endpoints via deta scan โ†’ OpenAPI โ†’ Traefik labels fallback
  4. Test โ€” runs testql scenarios or falls back to HTTP probe per endpoint
  5. Screenshot โ€” Playwright screenshots per endpoint with retry/timeout
  6. Report โ€” generates report.html + results.json per day + timeline index.html
  7. Restore โ€” extracts the last working day of an endpoint as an isolated project
  8. Dashboard โ€” overlays health% timeline with avg cyclomatic complexity (via toon)

Install

pip install resplit

# with Playwright screenshots
pip install "resplit[screenshots]"
playwright install chromium

# development
pip install -e ".[dev]"

Quick start

# Dry-run: scan last 30 days without deploy
resplit walk . --days 30 --dry-run

# Full walk with docker-compose
resplit walk . --days 30 --deploy docker-compose

# Walk a specific date range
resplit walk /path/to/repo --from 2024-01-01 --to 2024-04-01

# Restore last working version of an endpoint
resplit restore /api/health .

# Generate timeline report from existing results
resplit report

# Generate CC vs health% dashboard
resplit dashboard --repo .

# Show version
resplit version

CLI reference

resplit walk

resplit walk [REPO] [OPTIONS]

  REPO                    Path to git repository (default: .)

Options:
  --days INT              How many days back (default: 30)
  --from TEXT             Start date YYYY-MM-DD
  --to TEXT               End date YYYY-MM-DD
  --output PATH           Output directory (default: .resplit)
  --deploy TEXT           Deploy method: auto|docker-compose|uvicorn|none
  --health-url TEXT       Health check URL (default: http://localhost:8003/api/health)
  --base-url TEXT         Base service URL (default: http://localhost:8003)
  --screenshots / --no-screenshots
                          Take Playwright screenshots (default: true)
  --dry-run               Scan only, no deploy

resplit restore

resplit restore ENDPOINT [REPO] [OPTIONS]

  ENDPOINT                Endpoint path e.g. /api/health

Options:
  --output PATH           Target project directory (default: restored/)
  --results-dir PATH      Walk results directory (default: .resplit)

resplit report

resplit report [OPTIONS]

Options:
  --results-dir PATH      Walk results directory (default: .resplit)

resplit dashboard

resplit dashboard [OPTIONS]

Options:
  --results-dir PATH      Walk results directory (default: .resplit)
  --repo PATH             Repository path for CC extraction via toon (optional)

Output structure

.resplit/
  2024-03-15/
    commit.txt              # sha ยท message ยท author ยท timestamp
    endpoints.json          # detected endpoints
    results.json            # HTTP / testql results per endpoint
    testql-results.json     # raw testql output (if testql available)
    report.html             # per-day HTML report with screenshots
    screenshots/
      GET_api_health.png
      GET_api_items.png
  index.html                # timeline of all days
  dashboard.html            # CC vs health% chart (after resplit dashboard)

Configuration โ€” resplit.yaml

project:
  name: "my-api"
  repo: "."

deploy:
  method: docker-compose          # docker-compose | uvicorn | custom | none
  compose_file: docker-compose.yml
  health_url: http://localhost:8003/api/health
  health_timeout: 60
  health_interval: 2

scan:
  days: 30
  earliest_commit_per_day: true

testql:
  scenarios_dir: testql-scenarios/
  base_url: http://localhost:8003
  timeout: 10

output:
  dir: .resplit
  screenshots: true
  html_report: true

Architecture

resplit/
โ”œโ”€โ”€ resplit/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py              # Typer CLI: walk, restore, report, version, dashboard
โ”‚   โ”œโ”€โ”€ models.py           # Dataclasses: WalkConfig, DayResult, Endpoint, CommitInfo
โ”‚   โ”œโ”€โ”€ git_walker.py       # Day-by-day git history iteration
โ”‚   โ”œโ”€โ”€ deployer.py         # Deploy method detection + docker-compose/uvicorn lifecycle
โ”‚   โ”œโ”€โ”€ endpoint_scanner.py # deta scan โ†’ OpenAPI โ†’ Traefik labels fallback
โ”‚   โ”œโ”€โ”€ tester.py           # testql runner with HTTP probe fallback
โ”‚   โ”œโ”€โ”€ screenshotter.py    # Playwright screenshots with retry/timeout
โ”‚   โ”œโ”€โ”€ reporter.py         # HTML + JSON report per day + timeline index
โ”‚   โ”œโ”€โ”€ restorer.py         # Extract last working endpoint as isolated project
โ”‚   โ””โ”€โ”€ dashboard.py        # CC (toon) vs health% comparative timeline
โ”œโ”€โ”€ tests/                  # 44 tests (pytest)
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ 01-dry-run-walk/
โ”‚   โ”œโ”€โ”€ 02-docker-compose-project/
โ”‚   โ””โ”€โ”€ 03-restore-endpoint/
โ”œโ”€โ”€ testql-scenarios/
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ resplit.yaml.example

Endpoint scanner โ€” 3-level fallback

Level Source What it returns
1 deta scan services โ†’ ports โ†’ health paths
2 /openapi.json full endpoint list from OpenAPI spec
3 docker-compose Traefik labels PathPrefix rules
4 hardcoded fallback GET /api/health

Tester โ€” 2-level fallback

Level Condition Behaviour
1 testql installed + testql_dir set runs .testql.yaml scenarios
2 fallback HTTP GET probe per endpoint

Module summary

Module CCฬ„ Functions Purpose
cli 6.3 8 CLI entry points
models โ€” โ€” Dataclasses only
git_walker 3.3 6 Git history iteration
deployer 3.5 9 Deploy lifecycle
endpoint_scanner 5.5 6 Endpoint detection
tester 4.3 6 Endpoint testing
screenshotter 3.6 5 Screenshots
reporter 6.0 6 HTML/JSON reports
restorer 5.5 5 Endpoint extraction
dashboard 4.5 4 CC vs health chart

Hotspots (CC โ‰ฅ 9): walk (CC=15), report (CC=13), extract_endpoint (CC=9), save_html (CC=9), _scan_via_compose_labels (CC=9)


Dependencies

Runtime: typer>=0.12, rich>=13, gitpython>=3.1, httpx>=0.27, pyyaml>=6, pydantic>=2, deta>=0.1

Optional: playwright>=1.44 (screenshots)

Dev: pytest>=8, pytest-cov, pytest-asyncio, ruff, mypy


Examples

See examples/ for ready-to-run scenarios:


License

Licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rebuild-0.1.6.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rebuild-0.1.6-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file rebuild-0.1.6.tar.gz.

File metadata

  • Download URL: rebuild-0.1.6.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rebuild-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a5a61b4a1e2d72e1af2df324fe215a58e42ec51fdbd4e49adb198519b1c25528
MD5 97177a1c0dce0e0e12911de29f163421
BLAKE2b-256 94faca2ce241f24571093c33b7c93f7e9474f3c15d0e710647337708c0c95825

See more details on using hashes here.

File details

Details for the file rebuild-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: rebuild-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rebuild-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b279467bc5e4feb40bfac37423f702372e5847eb7781c40a2c19a04ee5c3d4
MD5 ca194f9559b2e08357f66c1540e79e5b
BLAKE2b-256 371e01a8fe609710cff1ffd9470429fc74811b43a9956ee22201bf261cac1ce1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page