diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f837d7c..473a4b28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,6 +93,34 @@ uv run ty check hindsight_api # Type check 3. Run tests to ensure nothing breaks 4. Submit a PR with a clear description of changes +## Release Process + +The project uses `scripts/release.sh` for creating releases. This script automates the entire release workflow: + +1. Bumps version in all components (API, clients, CLI, control plane, Helm) +2. **Regenerates OpenAPI spec and client SDKs** (Python, TypeScript, Rust) +3. Updates documentation versioning +4. Creates a commit and git tag +5. Pushes to GitHub (triggers CI/CD to publish packages) + +### Usage + +```bash +./scripts/release.sh +``` + +**Example:** +```bash +./scripts/release.sh 0.5.0 +``` + +### Important for Developers + +- During development, version bumps in `__init__.py` do NOT require client regeneration +- Clients are only regenerated during releases +- Do not manually run `./scripts/generate-clients.sh` unless testing generation changes +- Client version comments will reflect the API version from the latest release + ## Reporting Issues Open an issue on GitHub with: diff --git a/hindsight-docs/sidebars.ts b/hindsight-docs/sidebars.ts index 7c00d395..5b37b0b5 100644 --- a/hindsight-docs/sidebars.ts +++ b/hindsight-docs/sidebars.ts @@ -170,6 +170,11 @@ const sidebars: SidebarsConfig = { id: 'sdks/cli', label: 'CLI', }, + { + type: 'doc', + id: 'sdks/embed', + label: 'Embedded SDK', + }, ], }, { diff --git a/hindsight-docs/versioned_sidebars/version-0.4-sidebars.json b/hindsight-docs/versioned_sidebars/version-0.4-sidebars.json index 3256c651..78d8ec66 100644 --- a/hindsight-docs/versioned_sidebars/version-0.4-sidebars.json +++ b/hindsight-docs/versioned_sidebars/version-0.4-sidebars.json @@ -167,6 +167,11 @@ "type": "doc", "id": "sdks/cli", "label": "CLI" + }, + { + "type": "doc", + "id": "sdks/embed", + "label": "Embedded SDK" } ] }, diff --git a/scripts/release.sh b/scripts/release.sh index 6e6c46fd..28241795 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -167,6 +167,22 @@ else print_warn "update-docs-version.sh not found, skipping docs update" fi +# Regenerate OpenAPI spec and clients with new version +print_info "Regenerating OpenAPI spec and client SDKs..." +if ./scripts/generate-openapi.sh && ./scripts/generate-clients.sh; then + print_info "✓ OpenAPI spec and clients regenerated" +else + print_error "Failed to regenerate clients" + print_warn "You may need to fix this manually before committing" + read -p "Continue anyway? (y/n) " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + print_error "Release cancelled. Rolling back changes..." + git checkout . + exit 1 + fi +fi + # Show changes print_info "Changes to be committed:" git diff @@ -193,6 +209,7 @@ PATCH_VERSION=$(echo "$VERSION" | sed -E 's/^[0-9]+\.[0-9]+\.([0-9]+)$/\1/') COMMIT_MSG="Release v$VERSION - Update version to $VERSION in all components +- Regenerate OpenAPI spec and client SDKs - Python packages: hindsight-api, hindsight-dev, hindsight-all, hindsight-litellm, hindsight-embed - Python client: hindsight-clients/python - TypeScript client: hindsight-clients/typescript