Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: update release pipeline for v3/v4 support

Steffen Schmitzcf0472794d84
diff --git a/.agents/skills/git-workflow/SKILL.md b/.agents/skills/git-workflow/SKILL.md
index 730a803724..cbb69932ac 100644
--- a/.agents/skills/git-workflow/SKILL.md
+++ b/.agents/skills/git-workflow/SKILL.md
@@ -43,9 +43,23 @@ operations.
## Release
-- Release workflow is managed at root with `pnpm run release`.
-- Promote `main` to `production` via
+- Releases are cut with `pnpm run release`, run on the branch being released.
+ Allowed release branches are `main` and `v3`
+ (`scripts/release-preflight.sh` owns the allowlist).
+- `main` is the current line and the only branch that ships to Langfuse
+ Cloud. `v3` is the OSS maintenance line: a release from it produces a tag,
+ GitHub release, and Docker images, but never a Cloud deploy.
+- On any `vX.Y.Z` tag push, `.github/workflows/release.yml` promotes `main`
+ to `production` only if the tagged commit is an ancestor of `main`;
+ maintenance-branch tags skip promotion. The production migration
+ confirmation in the release preflight likewise only runs for `main`.
+- Promote `main` to `production` without a release via
`.github/workflows/promote-main-to-production.yml` or
- `pnpm run release:cloud`.
+ `pnpm run release:cloud` (both main-only).
+- At v4 GA, flip the latest-release markers: in `pipeline.yml`, move the
+ Docker `latest` tag gate from `refs/tags/v3` to `refs/tags/v4` on `main`
+ and disable it on the `v3` branch; set `release-it.github.makeLatest:
+ false` in the `v3` branch's root `package.json` so maintenance releases
+ stop claiming the GitHub "Latest release" badge.
- Do not change release/versioning flow without updating this skill and the
impacted package guides.
diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml
index 6e2120bd4f..cdcbe1ecd0 100644
--- a/.github/workflows/pipeline.yml
+++ b/.github/workflows/pipeline.yml
@@ -9,6 +9,7 @@ on:
push:
branches:
- "main"
+ - "v3" # OSS maintenance branch — releases are cut from it like from main
tags:
- "v*"
merge_group:
@@ -1048,11 +1049,11 @@ jobs:
run: exit 1
working-directory: .
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- if: failure() && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
+ if: failure() && github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v3' || startsWith(github.ref, 'refs/tags/'))
with:
persist-credentials: false
- name: Notify Slack
- if: failure() && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
+ if: failure() && github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v3' || startsWith(github.ref, 'refs/tags/'))
uses: ./.github/actions/notify-slack-failure
with:
title: "❌ CI Failed"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index d0fbeead71..ec196b3da2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -3,7 +3,7 @@ on:
push:
# Pattern matched against refs/tags
tags:
- - "v3.[0-9]+.[0-9]+" # Semantic version tags
+ - "v[0-9]+.[0-9]+.[0-9]+" # Semantic version tags (any major line)
permissions: {}
@@ -18,7 +18,23 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GH_ACCESS_TOKEN }}
persist-credentials: false
+ # Releases can be cut from `main` and from OSS maintenance branches
+ # (e.g. `v3`). Only tags whose commit is on `main` may promote to
+ # production — a maintenance-branch tag must never deploy whatever
+ # happens to be on `main` to Langfuse Cloud.
+ - name: Check released commit is on main
+ id: guard
+ run: |
+ git fetch origin main
+ RELEASED_COMMIT="$(git rev-parse "${GITHUB_REF_NAME}^{commit}")"
+ if git merge-base --is-ancestor "$RELEASED_COMMIT" origin/main; then
+ echo "promote=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "::notice::${GITHUB_REF_NAME} is not on main (maintenance-branch release) — skipping production promotion"
+ echo "promote=false" >> "$GITHUB_OUTPUT"
+ fi
- name: Push to production
+ if: steps.guard.outputs.promote == 'true'
run: git push "https://x-access-token:${GH_ACCESS_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" +main:production
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
diff --git a/scripts/release-cloud.sh b/scripts/release-cloud.sh
index 7ba209681d..347fc243ae 100755
--- a/scripts/release-cloud.sh
+++ b/scripts/release-cloud.sh
@@ -25,6 +25,9 @@ trigger_cloud_promotion() {
}
main() {
+ # Cloud promotion always ships `main`. The shared preflight also accepts
+ # OSS maintenance branches (e.g. `v3`), so pin this entry point to main.
+ ensure_on_main_branch
run_release_preflight
trigger_cloud_promotion
}
diff --git a/scripts/release-preflight.sh b/scripts/release-preflight.sh
index 953e2b2252..9e8dbd2331 100755
--- a/scripts/release-preflight.sh
+++ b/scripts/release-preflight.sh
@@ -1,17 +1,20 @@
#!/usr/bin/env bash
-# Shared safety gates run before any path that promotes main to production.
-# Sourced by release-cloud.sh and invoked standalone by the `release` script so
-# both entry points enforce the same preconditions:
-# - the release is cut from `main`
-# - local `main` matches `origin/main`
-# - any migrations on main but not yet on production are confirmed as applied
+# Shared safety gates run before any path that cuts a release or promotes
+# main to production. Sourced by release-cloud.sh and invoked standalone by
+# the `release` script so both entry points enforce the same preconditions:
+# - the release is cut from an allowed release branch (`main` or `v3`)
+# - the local branch matches its origin counterpart
+# - for `main` releases only: any migrations on main but not yet on
+# production are confirmed as applied (`main` is the only branch that
+# promotes to Langfuse Cloud; `v3` releases are OSS-only)
# Helpers (log/fail/require_command) are exposed for sourcing callers to reuse.
set -euo pipefail
LOG_PREFIX="${LOG_PREFIX:-release}"
MIGRATION_CONFIRMATION_TOKEN="applied"
+RELEASE_BRANCHES=("main" "v3")
log() {
echo "[${LOG_PREFIX}] $*"
@@ -29,27 +32,44 @@ require_command() {
fi
}
+current_branch() {
+ git rev-parse --abbrev-ref HEAD
+}
+
ensure_on_main_branch() {
- local current_branch
- current_branch="$(git rev-parse --abbrev-ref HEAD)"
- if [[ "$current_branch" != "main" ]]; then
- fail "Current branch is '$current_branch'. Switch to 'main' before running this command."
+ local branch
+ branch="$(current_branch)"
+ if [[ "$branch" != "main" ]]; then
+ fail "Current branch is '$branch'. Switch to 'main' before running this command."
fi
}
-ensure_main_matches_origin() {
- git fetch origin main
+ensure_on_release_branch() {
+ local branch
+ branch="$(current_branch)"
+ for allowed in "${RELEASE_BRANCHES[@]}"; do
+ if [[ "$branch" == "$allowed" ]]; then
+ return 0
+ fi
+ done
+ fail "Current branch is '$branch'. Releases can only be cut from: ${RELEASE_BRANCHES[*]}."
+}
+
+ensure_branch_matches_origin() {
+ local branch
+ branch="$(current_branch)"
+ git fetch origin "$branch"
- local local_main_sha
- local origin_main_sha
- local_main_sha="$(git rev-parse HEAD)"
- origin_main_sha="$(git rev-parse origin/main)"
+ local local_sha
+ local origin_sha
+ local_sha="$(git rev-parse HEAD)"
+ origin_sha="$(git rev-parse "origin/${branch}")"
- if [[ "$local_main_sha" != "$origin_main_sha" ]]; then
- fail "Local main ($local_main_sha) is not in sync with origin/main ($origin_main_sha)."
+ if [[ "$local_sha" != "$origin_sha" ]]; then
+ fail "Local ${branch} ($local_sha) is not in sync with origin/${branch} ($origin_sha)."
fi
- log "Local main is in sync with origin/main ($local_main_sha)."
+ log "Local ${branch} is in sync with origin/${branch} ($local_sha)."
}
fetch_production_branch() {
@@ -102,8 +122,17 @@ confirm_migrations_are_applied() {
}
run_release_preflight() {
- ensure_on_main_branch
- ensure_main_matches_origin
+ ensure_on_release_branch
+ ensure_branch_matches_origin
+
+ # Only `main` promotes to Langfuse Cloud production. Releases from other
+ # branches never reach the production databases, so confirming migrations
+ # against origin/production would be meaningless there.
+ if [[ "$(current_branch)" != "main" ]]; then
+ log "Skipping production migration check: releases from '$(current_branch)' are OSS-only and never promote to production."
+ return 0
+ fi
+
fetch_production_branch
local prisma_migrations