Hive
fix(server): handle legacy Xcode builds environment filter
GitHub issue · Closed
What changed
- Normalizes the Xcode builds analytics environment query parameter so only
ciandlocalare preserved; missing, legacy, or malformed values fall back toany. - Adds a defensive fallback to
TuistWeb.XcodeBuildsLive.environment_label/1so unexpected values render asAnyinstead of raising. - Adds a LiveView regression test for
?analytics-environment=all. - Regenerates
server/priv/gettext/dashboard_builds.potwithmix gettext.extractso 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..HEADMIX_ENV=test mix gettext.extractfromserver/to regeneratedashboard_builds.pot- In the original workspace, in-memory compilation of
TuistWeb.XcodeBuildsLiveagainst 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
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.