Hive Hive
Sign in

fix(server): handle legacy Xcode builds environment filter

GitHub issue · Closed

Metadata
Source
tuist/tuist #11578
Updated
Jul 5, 2026
Details

What changed

  • Normalizes the Xcode builds analytics environment query parameter so only ci and local are preserved; missing, legacy, or malformed values fall back to any.
  • Adds a defensive fallback to TuistWeb.XcodeBuildsLive.environment_label/1 so unexpected values render as Any instead of raising.
  • Adds a LiveView regression test for ?analytics-environment=all.
  • Regenerates server/priv/gettext/dashboard_builds.pot with mix gettext.extract so the dashboard builds gettext template stays in sync.

Why

Sentry reported TUIST-12H, a production FunctionClauseError in TuistWeb.XcodeBuildsLive.environment_label/1 while rendering the Xcode builds page. The label helper only handled "any", "local", "ci", and boolean values, while the filtering path already treated "all" as an unfiltered value.

Root cause

The page could receive a legacy or malformed analytics environment value that was safe for filtering but unsafe for rendering. When that value reached the environment dropdown label, the function had no matching clause and the LiveView render crashed.

Impact

Users with legacy or unexpected environment query values can load the Xcode builds dashboard normally. Unknown values behave like the default Any filter rather than taking down the page.

Validation

  • git diff --check origin/main..HEAD
  • MIX_ENV=test mix gettext.extract from server/ to regenerate dashboard_builds.pot
  • In the original workspace, in-memory compilation of TuistWeb.XcodeBuildsLive against the existing test build passed.
  • In the original workspace, smoke-checked TuistWeb.XcodeBuildsLive.environment_label("all") == "Any" with minimal Gettext config.
  • GitHub Actions on PR #11578 passed for all non-skipped checks at 5429b70f7: Server (Format, Gettext, Test, Docker build, Seed, Credo, Security, esbuild, Swift Tests (XCActivityLogParser)), CodeQL, Gradle Cache Acceptance, Secret Scanning, CLA, and Review.

Fixes TUIST-12H

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.