:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(hogli): release 0.2.0 with real release notes (#88767)
Raúl Negrón-Otero2d5fee05f40f
diff --git a/.github/workflows/publish-hogli.yml b/.github/workflows/publish-hogli.ymlindex 20e8eff414eb..ba8803fb1fc6 100644--- a/.github/workflows/publish-hogli.yml+++ b/.github/workflows/publish-hogli.yml@@ -51,6 +51,14 @@ jobs:exit 1fi+ - name: Extract release notes from the changelog+ shell: bash+ env:+ TAG_REF: ${{ github.ref_name }}+ run: |+ tag_version="${TAG_REF#hogli-v}"+ python tools/hogli/scripts/release_notes.py "$tag_version" > /tmp/hogli-release-notes.md+- name: Build sdist and wheelrun: uv build tools/hogli --out-dir dist@@ -79,5 +87,5 @@ jobs:uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0with:files: dist/*- generate_release_notes: true+ body_path: /tmp/hogli-release-notes.mdprerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}diff --git a/tools/hogli/CHANGELOG.md b/tools/hogli/CHANGELOG.mdnew file mode 100644index 000000000000..002bc4348029--- /dev/null+++ b/tools/hogli/CHANGELOG.md@@ -0,0 +1,40 @@+# Changelog++Notable changes to the `hogli` package. The format follows+[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow+[semantic versioning](https://semver.org/spec/v2.0.0.html).++`publish-hogli.yml` reads the section matching the tagged version and uses it as+the GitHub Release body, so add the entry here before you cut the tag.++## 0.2.0++### Added++- `hogli run <command>` runs a command with the environment the manifest resolves.+- `telemetry:on`, `telemetry:off`, and `telemetry:status` are now built in. They previously lived outside the package.+- `config.env.files` in `hogli.yaml` loads dotenv files before every command. Shell variables always win, and a missing file is skipped.+- `config.env.secrets` resolves secret references through whichever wrapper binary you name. 1Password is no longer built in.+- `needs_secrets: true` on a manifest entry opts a command into the secret wrapper. Commands that do not need secrets skip the extra process.+- `untracked: true` on a manifest entry keeps a command out of telemetry.+- `telemetry.add_command_properties()` attaches custom properties to the `command_completed` event.+- Events carry `hogli_version` and `is_nested`. `command_completed` carries `outcome`, which separates a signal kill from a real failure.+- Package metadata now declares support for Python 3.13.++### Changed++- Breaking: `ctx.meta["hogli.devenv"]` no longer reaches `command_completed`. Use `telemetry.add_command_properties()` instead.+- Breaking: `meta:check` now also fails on manifest entries whose `bin_script` does not exist. A manifest that passed under 0.1.0 can fail here.+- Breaking: events no longer set `$groups: {"project": "hogli"}`.+- CI detection covers GitHub Actions, Jenkins, GitLab, CircleCI, and Buildkite in addition to `CI`. Telemetry stays off in all of them, and the first-run notice no longer prints into build logs.+- `command_started` sends as soon as it is queued, so a long command that is killed still reports.++### Fixed++- hogli no longer replaces the calling process when it runs embedded as a library or under `CliRunner`. Only the `hogli` script and `python -m hogli` can exec into the secret wrapper.+- `flush()` waits on in-flight sends against a shared deadline, so one hung request cannot stall both the post-command flush and the one at exit.+- Telemetry failures no longer break commands or raise during process exit.++## 0.1.0++First release.diff --git a/tools/hogli/README.md b/tools/hogli/README.mdindex 3bf151000e8b..1a1605845791 100644--- a/tools/hogli/README.md+++ b/tools/hogli/README.md@@ -390,7 +390,9 @@ metadata:Releases are published to PyPI via `.github/workflows/publish-hogli.yml`,triggered by pushing a `hogli-v*` tag from `master`.-1. Bump `version` in `tools/hogli/pyproject.toml` and merge to `master`.+1. Bump `version` in `tools/hogli/pyproject.toml`, run `uv lock` (hogli is a uv+ workspace member), add a `## <version>` section to `tools/hogli/CHANGELOG.md`,+ and merge to `master`.2. From `master`, tag and push:```bash@@ -398,11 +400,14 @@ triggered by pushing a `hogli-v*` tag from `master`.git push origin hogli-v0.1.1```-The workflow verifies the tag matches the `pyproject.toml` version, builds-the sdist and wheel with `uv build`, smoke-tests the wheel in a fresh-venv, publishes via PyPI trusted publishing (OIDC) — no API tokens —-and creates a GitHub Release with auto-generated notes from the commits-since the previous tag.+The workflow verifies the tag matches the `pyproject.toml` version, extracts+that version's section from `CHANGELOG.md`, builds the sdist and wheel with+`uv build`, smoke-tests the wheel in a fresh venv, publishes via PyPI trusted+publishing (OIDC) with no API tokens, and creates a GitHub Release whose body+is the changelog section.++A tag with no matching changelog section fails the run before anything is+published.To re-trigger after a failed publish, dispatch the workflow against theexisting tag — no need to retag:diff --git a/tools/hogli/pyproject.toml b/tools/hogli/pyproject.tomlindex 39c0dd410594..5008a4a4989a 100644--- a/tools/hogli/pyproject.toml+++ b/tools/hogli/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "hogli"-version = "0.1.0"+version = "0.2.0"description = "Developer CLI framework with YAML-based command definitions"readme = "README.md"license = "MIT"@@ -52,5 +52,5 @@ packages = ["src/hogli"][tool.pytest.ini_options]testpaths = ["tests"]-pythonpath = ["src"]+pythonpath = ["src", "scripts"]addopts = "-p no:warnings -p no:django"diff --git a/tools/hogli/scripts/release_notes.py b/tools/hogli/scripts/release_notes.pynew file mode 100755index 000000000000..fbb79066b37b--- /dev/null+++ b/tools/hogli/scripts/release_notes.py@@ -0,0 +1,51 @@+#!/usr/bin/env python3+"""Print one version's section of a Keep a Changelog file."""++from __future__ import annotations++import re+import sys+import argparse+from pathlib import Path++DEFAULT_CHANGELOG = Path(__file__).resolve().parent.parent / "CHANGELOG.md"+++def extract_section(changelog: str, version: str) -> str:+ """Return the body under the ``## <version>`` heading, heading excluded.++ Accepts the Keep a Changelog heading variants: a bare version, a linked+ version, and either one followed by a release date.+ """+ heading = re.compile(rf"^##\s+\[?{re.escape(version)}\]?(\s|$)")+ body: list[str] = []+ in_section = False++ for line in changelog.splitlines():+ if in_section:+ if line.startswith("## "):+ break+ body.append(line)+ elif heading.match(line):+ in_section = True++ return "\n".join(body).strip()+++def main() -> int:+ parser = argparse.ArgumentParser(description="Print one version's section of a changelog.")+ parser.add_argument("version", help="Version to extract, without a leading 'v'.")+ parser.add_argument("--changelog", type=Path, default=DEFAULT_CHANGELOG)+ args = parser.parse_args()++ section = extract_section(args.changelog.read_text(), args.version)+ if not section:+ sys.stderr.write(f"{args.changelog} has no section for version {args.version}\n")+ return 1++ sys.stdout.write(f"{section}\n")+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/tools/hogli/tests/test_release_notes.py b/tools/hogli/tests/test_release_notes.pynew file mode 100644index 000000000000..4add623fd1d2--- /dev/null+++ b/tools/hogli/tests/test_release_notes.py@@ -0,0 +1,54 @@+from __future__ import annotations++import tomllib+from pathlib import Path++from parameterized import parameterized+from release_notes import DEFAULT_CHANGELOG, extract_section++CHANGELOG = """\+# Changelog++## 0.3.0++- newest++{heading}++- the body+- more body++## 0.1.0++- oldest+"""+++class TestExtractSection:+ @parameterized.expand(+ [+ ("bare", "## 0.2.0"),+ ("linked", "## [0.2.0]"),+ ("dated", "## 0.2.0 - 2026-08-25"),+ ("linked_and_dated", "## [0.2.0] - 2026-08-25"),+ ]+ )+ def test_reads_body_for_heading_variant(self, _name: str, heading: str) -> None:+ assert extract_section(CHANGELOG.format(heading=heading), "0.2.0") == "- the body\n- more body"++ def test_stops_before_the_next_version(self) -> None:+ assert "oldest" not in extract_section(CHANGELOG.format(heading="## 0.2.0"), "0.2.0")++ def test_absent_version_reads_empty(self) -> None:+ assert extract_section(CHANGELOG.format(heading="## 0.2.0"), "9.9.9") == ""++ def test_version_is_not_matched_as_a_prefix(self) -> None:+ assert extract_section("## 0.2.10\n\n- ten\n", "0.2.1") == ""+++def test_packaged_version_has_a_changelog_section() -> None:+ pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"+ version = tomllib.loads(pyproject.read_text())["project"]["version"]+ assert extract_section(DEFAULT_CHANGELOG.read_text(), version), (+ f"CHANGELOG.md has no '## {version}' section; publish-hogli.yml fails on a tag without one"+ )diff --git a/uv.lock b/uv.lockindex b4b447eef885..cff6f14e103d 100644--- a/uv.lock+++ b/uv.lock@@ -3131,7 +3131,7 @@ wheels = [[[package]]name = "hogli"-version = "0.1.0"+version = "0.2.0"source = { editable = "tools/hogli" }dependencies = [{ name = "click" },