Skip to content

fix(config): skip empty CI release variables - #2042

Open
ajeya-krishna wants to merge 2 commits into
langfuse:mainfrom
ajeya-krishna:fix/skip-empty-release-env-vars
Open

ajeya-krishna wants to merge 2 commits into
langfuse:mainfrom
ajeya-krishna:fix/skip-empty-release-env-vars

Conversation

@ajeya-krishna

@ajeya-krishna ajeya-krishna commented Oct 22, 2026 •

Copy link
Copy Markdown

What does this PR do?

Problem

An empty CI variable such as RENDER_GIT_COMMIT prevents release autodetection
from reaching a populated GITHUB_SHA, leaving the detected release empty.

Solution

Skip empty CI values, preserving the order and contents of nonempty values.
Add helper regressions and a real-client initialization test.

How we tested it

The six new cases had 3 failures before the fix and all pass after it.
41 targeted tests passed; full unit suite: 969 passed, 2 skipped.

Type of change

  • Bug fix

Verification

uv run --frozen pytest tests/unit/test_environment.py tests/unit/test_initialization.py tests/unit/test_resource_manager.py
uv run --frozen ruff check .
uv run --frozen ruff format --check .
uv run --frozen mypy langfuse --no-error-summary
LANGFUSE_PUBLIC_KEY=test-public-key LANGFUSE_SECRET_KEY=test-secret-key \
LANGFUSE_BASE_URL=http://localhost:3000 \
uv run --frozen pytest -q -n 4 --dist worksteal tests/unit

Python 3.12. No e2e/server or live-provider tests run; this is a local configuration
helper. The full unit run uses dummy credentials, not a live account.

Checklist

  • Diff reviewed using code_review.md.
  • Tests added for the behavior change.
  • No docs/examples/environment-template change needed.
  • No generated files edited.
  • No credentials committed.

AI-assisted implementation and regression testing with Codex.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Skips empty CI release values so release detection can reach the next populated variable.

  • Langfuse finds the first nonempty release value from CI.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "fix(config): skip empty CI release varia..." · Reviewed by Greptile

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@CLAassistant

CLAassistant commented Oct 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chrikrah chrikrah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajeya-krishna From my perspective this can be merged at d9c85a2. Both callers, client.py:335 and resource_manager.py:631, already skip an empty LANGFUSE_RELEASE with or, and only the helper stopped on "".

$ pytest tests/unit/test_environment.py tests/unit/test_initialization.py -q -p no:cacheprovider   # Python 3.12
26 passed in 2.92s                                    # d9c85a2
3 failed, 23 passed in 2.53s                          # environment.py from d2222a5, tests kept
FAILED tests/unit/test_environment.py::test_get_common_release_envs[all-empty]
FAILED tests/unit/test_environment.py::test_get_common_release_envs[skip-empty]
FAILED tests/unit/test_initialization.py::TestClientInitialization::test_empty_ci_release_falls_back_to_next_variable

non-blocking: when every CI variable is empty, the base helper returned "". The if v is not None filter at resource_manager.py:638 kept it, so the resource had an empty release attribute. At head the attribute goes away. Does a server-side filter or the UI read that empty release?

ajeya-krishna commented Oct 28, 2026 •

Copy link
Copy Markdown
Author

@chrikrah Thanks for checking this. Omitting the release attribute when all CI variables are empty is intentional: it now matches the existing behavior when those variables are unset, instead of exporting an empty release. I verified the actual _init_tracer_provider() resource for unset, all-empty, and empty-then-populated inputs; the first two omit the attribute and the last preserves github-sha. All 41 environment, initialization, and resource-manager tests pass at d9c85a2.

I haven't verified server/UI handling of an explicitly empty release, so I can't claim those filters are equivalent. No additional code change proposed; the all-empty helper case is already covered by the PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants