# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2026-06-10

### Added
- **SSM secret resolution**: `${ssm:/path/to/param}` references in secret-bearing config fields (GitHub token, notification URLs/headers/bodies, health-check URL) resolve from AWS SSM Parameter Store with decryption at release time. No AWS credentials needed when unused or in `--dry-run`.
- **CloudFront invalidation step**: new optional `[cloudfront]` config (`distribution_id`, `paths` defaulting to `/*`) adds a `cloudfront-invalidate` step after the Kubernetes rollout; `--skip-cloudfront` flag to bypass.
- `aws-sdk-ssm` and `aws-sdk-cloudfront` dependencies now power real features instead of being unused.

## [0.3.0] - 2026-06-10

### Added
- `apiforge rollback` auto-detects the rollback target when `--to` is omitted: newest version older than the currently deployed image tag, sourced from successful audit-history releases with semver git tags as fallback.
- `rollback` now verifies the configured health check after the rollout and supports `--yes` to skip the confirmation prompt.
- Live terminal spinners for pipeline steps with streaming progress from Docker build/push, Kubernetes rollout (replica counts), and health-check attempts. Renders only on interactive terminals; CI/piped output keeps the plain line format, and JSON output on stdout stays clean.
- `apiforge init` adds `.apiforge/` to `.gitignore`.

### Fixed
- Apiforge's own `.apiforge/` state directory no longer trips the `require_clean` preflight check (first release's audit write used to block every subsequent release).
- `release --output json` now emits only the JSON document on stdout; the release plan and step progress go to stderr, so output can be piped straight into `jq`/CI parsers.
- `${VAR}` environment variable references in `apiforge.toml` (GitHub token/repository, Slack/webhook notification fields, health-check URL) are now resolved at config load; missing variables fail fast naming the variable.
- Notifications now use the Slack and generic webhook notification steps, fire on both success and failure (honoring `notify_on`), and sanitize error text. Previously only an inline Slack-only success path existed.
- Audit records now capture the real outcome: per-step name/status/duration, total duration, and `success`/`failed`/`rolled_back` status. Failed releases are recorded, so `history --filter failed` works (and includes rolled-back releases).
- `--dry-run` no longer writes audit records or creates `.apiforge/` (dry-runs are side-effect free).
- Removed double Kubernetes rollback: only `k8s-update` reverts the deployment revision; `k8s-rollout` rollback is a no-op, preventing an over-rollback to two revisions back.
- `k8s-rollout` no longer divides by zero when a deployment is scaled to 0 replicas.
- `git-commit` only stages `CHANGELOG.md` when the changelog step actually ran, fixing failures with `--no-changelog` or missing changelog files.
- Changelog generation inserts new sections before existing release sections (header/description stay on top) and includes full history on the first release instead of an empty section.
- `history` applies status filters before the `--limit`, and no longer creates the audit directory just to read it.
- `release --output json` now includes step names, textual statuses, `rolled_back`, and `error` fields.
- `[github].create_release = false` is now honored (release step is skipped).
- Fixed potential panic when truncating multi-byte webhook URLs in `config validate` output.
- Release workflow action versions aligned with CI (checkout@v6, upload-artifact@v7, download-artifact@v8).
- CONTRIBUTING.md MSRV corrected to Rust 1.91.1.

## [0.2.6] - 2026-05-21

### Fixed
- rustfmt formatting across dry-run previews and config validation output.
- README MSRV badge and prerequisite text aligned to Rust 1.91.1+.
- cargo-audit config updated to ignore RUSTSEC-2026-0104 (transitive rustls-webpki CRL parsing panic).

## [0.2.5] - 2026-05-21

### Fixed
- CI action versions updated to latest (checkout@v6, upload-artifact@v7, download-artifact@v8).
- MSRV documentation updated to reflect Rust 1.91.1 minimum.
- Security audit configuration stabilized with documented advisory ignores.
- Changelog timestamp formatting improved.

## [0.2.4] - 2026-04-12

### Fixed
- Release workflow now targets `macos-15-intel` for `x86_64-apple-darwin` so the amd64 macOS artifact builds on a native Intel runner.
- Prevents x86_64 macOS link failures caused by building that target on arm64-hosted `macos-latest`.

## [0.2.3] - 2026-04-12

### Fixed
- Release workflow now uses `macos-latest` for both macOS targets to avoid unavailable `macos-13` runner cancellations.
- macOS release builds now install OpenSSL and pkg-config before compiling to prevent `openssl-sys` detection failures.

## [0.2.2] - 2026-04-12

### Fixed
- Release workflow Linux ARM64 build now uses a native ARM runner (`ubuntu-24.04-arm`) instead of cross-compiling through a container lacking OpenSSL dev libraries.
- Release workflow installs Linux build dependencies (`pkg-config`, `libssl-dev`) before compiling to avoid OpenSSL discovery failures.

## [0.2.1] - 2026-04-12

### Fixed
- Release workflow macOS build matrix now uses native runners per architecture:
  - `x86_64-apple-darwin` on `macos-13`
  - `aarch64-apple-darwin` on `macos-14`

## [0.2.0] - 2026-04-10

### Highlights
- End-to-end rollback coverage across git, GitHub release, Kubernetes, and audit flows.
- Production hardening with git operation timeouts, retry logic, and bounded audit storage.
- Cross-platform and developer-experience improvements through Docker context updates, CI automation, and richer diagnostics.

### Added
- Git operation timeout configuration in `[git]`:
  - `fetch_timeout_secs`
  - `push_timeout_secs`
  - `operation_timeout_secs`
- Timeout-aware Git preflight/push rollback flow to prevent stuck remote operations.
- Audit store retry wrapper for transient sled I/O failures.
- Audit retention/compaction support to prevent unbounded local audit growth.
- Orchestrator integration tests covering:
  - successful pipeline execution,
  - rollback ordering,
  - rollback-disabled behavior,
  - dry-run execution path.
- Retry utility edge-case tests (retry exhaustion, zero-retry behavior, profile checks).
- Criterion benchmark target (`cargo bench --bench performance`) for:
  - semver bumping/formatting,
  - template rendering,
  - environment variable resolution.
- Health-checkable demo API container and CLI runtime Dockerfile.
- GitHub Actions CI/release workflows and Dependabot automation.

### Changed
- Docker build context creation now runs in blocking worker threads to avoid blocking async runtime threads.
- Docker build context loading preallocates by file size for large contexts to reduce allocation churn.
- Shared version-read logic extracted into a dedicated utility module.
- `BumpType` now uses `FromStr` trait implementation.
- Regex-heavy validations and sanitization paths optimized to avoid repeated compilation.

### Fixed
- Rollback paths for git commit/changelog/tag push edge cases.
- Health check config validation (`health_check.interval > 0`).
- Cross-platform Docker context archive generation (removed shell `tar` dependency).
- Audit store path handling and flush reliability.

### Documentation
- Expanded README with:
  - git timeout config fields,
  - end-to-end configuration examples,
  - benchmark command usage.
- Added crate/module-level rustdoc for core public APIs.
