You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(eng-analytics): read stored ci flags as booleans - #131851
Engineering analytics reads that aggregate over a CI flag return a 500 whenever the stored CI views serve them, for example workflow_health.
The weekly CI digest lost its slow PR workflows section to this error (run).
Changes
Reads from the stored CI views cast is_merge_queue, is_rerun_copy and the other boolean flags back to UInt8.
Materialization writes a UInt8 flag to Delta Lake as Int16, and ClickHouse rejects Int16 as an If condition.
The cast happens on read, because a change to the view definition forces a full rebuild of both views.
How did you test this code?
Not run: the endpoint against production data.
Test rationale: the parity test in test_materialized_ci.py now stores the flags as Int16, like production, and runs countIf over each flag. It fails with the production error before the fix.
Release status
This change is behind a feature flag and is not available to users
Merging to master in this repository is managed by Trunk.
To merge this pull request, check the box to the left or comment /trunk merge below.
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here
⚠️Trunk lane — backend Python lane (py:product:engineering_analytics)
This PR is assigned to the backend Python lane (py:product:engineering_analytics). It runs backend Python tests and may merge in parallel with PRs in other lanes.
✅ Duplication (Python) — clean
New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
✅ Duplication (TypeScript) — clean
New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workflow_health.Changes
is_merge_queue,is_rerun_copyand the other boolean flags back toUInt8.UInt8flag to Delta Lake asInt16, and ClickHouse rejectsInt16as anIfcondition.How did you test this code?
Test rationale: the parity test in
test_materialized_ci.pynow stores the flags asInt16, like production, and runscountIfover each flag. It fails with the production error before the fix.Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, claude-opus-5-5
Skills:
/writing-tests,/writing-code-comments,/writing-pr-descriptionsMore context for AI agents
_stored_selectinlogic/materialized_ci.py.