: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(ci): release agent on harness changes (#104226)
Alessandro Pogliaghi04917c82bdfa
diff --git a/.github/workflows/desktop-agent-tag.yml b/.github/workflows/desktop-agent-tag.ymlindex b73ab29ff470..739fd4b9616f 100644--- a/.github/workflows/desktop-agent-tag.yml+++ b/.github/workflows/desktop-agent-tag.yml@@ -6,6 +6,7 @@ on:- masterpaths:- 'products/desktop/packages/agent/**'+ - 'products/desktop/packages/harness/**'- '.github/workflows/desktop-agent-tag.yml'- '.github/workflows/desktop-agent-release.yml'workflow_dispatch:@@ -53,13 +54,15 @@ jobs:MAJOR=$(echo "$VERSION_PART" | cut -d. -f1)MINOR=$(echo "$VERSION_PART" | cut -d. -f2)- # Count commits touching the agent package since the base tag. In the+ # Count commits touching the agent or harness package since the base tag. In the# monorepo an unscoped count would include every PostHog commit and# inflate patch numbers meaninglessly.- PATCH=$(git rev-list "$LATEST_TAG"..HEAD --count -- products/desktop/packages/agent)+ PATCH=$(git rev-list "$LATEST_TAG"..HEAD --count -- \+ products/desktop/packages/agent \+ products/desktop/packages/harness)if [ "$PATCH" -eq 0 ]; then- echo "No agent commits since $LATEST_TAG. Nothing to release."+ echo "No agent or harness commits since $LATEST_TAG. Nothing to release."exit 0fidiff --git a/products/desktop/docs/UPDATES.md b/products/desktop/docs/UPDATES.mdindex 0a811df58bc3..cb4436c57154 100644--- a/products/desktop/docs/UPDATES.md+++ b/products/desktop/docs/UPDATES.md@@ -67,6 +67,12 @@ A tag ruleset protects `desktop-v*` and `agent-v*` tags, because pushing one pubOnly a repository admin can push a base tag.`desktop-tag.yml` and `desktop-agent-tag.yml` push release tags through the Releaser GitHub App, which the ruleset allows.+## Agent package releases++Agent releases are separate from desktop app releases. Changes to `products/desktop/packages/agent` or `products/desktop/packages/harness` on `master` trigger an agent release.+The patch version counts commits that change either package since the agent base tag. A commit that changes both packages counts once.+See the [agent release process](../packages/agent/README.md#releasing) for the tag and publish steps.+## Checking current versionSee what version would be released:diff --git a/products/desktop/packages/agent/README.md b/products/desktop/packages/agent/README.mdindex 436f7c456972..2579e385d8d3 100644--- a/products/desktop/packages/agent/README.md+++ b/products/desktop/packages/agent/README.md@@ -276,11 +276,11 @@ ACP defines standard methods like `session/prompt`, `session/update`, and `sessiReleases are automatic. There is no manual version bump: `package.json` stays at `0.0.0-dev` and the release workflow sets the version from the tag.-1. A merge to `master` that changes a file in this package runs `.github/workflows/desktop-agent-tag.yml`.-2. It pushes the tag `agent-vX.Y.Z`. `Z` is the number of commits to this package since the base tag `agent-vX.Y.0`.+1. A merge to `master` that changes a file in this package or `products/desktop/packages/harness` runs `.github/workflows/desktop-agent-tag.yml`.+2. It pushes the tag `agent-vX.Y.Z`. `Z` counts commits that change either package since the base tag `agent-vX.Y.0`. A commit that changes both packages counts once.3. The tag push runs `.github/workflows/desktop-agent-release.yml`, which builds, tests and publishes to npm with provenance, then rebuilds the sandbox base images.-A merge that changes nothing in this package adds no new version.+A merge that changes neither package adds no new version.A change to either agent workflow file still runs the tag job, so it releases any package commits that have no tag yet.The publish job runs in the `npm-posthog-agent` GitHub environment, which only deploys from `agent-v*` tags.