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.7500 (5 commits)
  • ๐Ÿ‘ค Human dev: ~$201 (2.0h @ $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.5.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.5-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rebuild-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 033cf9c175775f0cc5b7c5074bf41ab713165d3490ca3ea7d82ba4578ce2e20f
MD5 bdec9e38cb607046664cecc25590aa4c
BLAKE2b-256 2e18455852398e38cf75f084bf229b7f1289cec222b925bdcd60ab7e0bbb9f56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rebuild-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 19739869bb337208f4bb585979c955a6064def32b4a22bb659abf816fa93b8c1
MD5 1b68240ac0c3b4efa04a9de03ef96bea
BLAKE2b-256 c5d34bdacba9a90e23a34ecdf64d6517c87f286d94c8312e52872e21dce066d4

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