Skip to content

fix(sql): show bridge badge for Iceberg-tiered topics before sync#2531

Open
c-julin wants to merge 1 commit into
masterfrom
ux-1330-sql-bridge-badge-unsynced
Open

fix(sql): show bridge badge for Iceberg-tiered topics before sync#2531
c-julin wants to merge 1 commit into
masterfrom
ux-1330-sql-bridge-badge-unsynced

Conversation

@c-julin

@c-julin c-julin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

The SQL editor's Bridge query badge now appears for any Iceberg-tiered topic, including ones that haven't synced to Iceberg yet.

Why

The badge was gated on the presence of an Iceberg lag metric, not on whether the topic is actually Iceberg-tiered:

// sql-workspace.tsx (before)
const tx = bridgeTxLag.data?.results?.[0]?.value?.value;
const commit = bridgeCommitLag.data?.results?.[0]?.value?.value;
if (tx === undefined && commit === undefined) {
  return; // → run.bridge undefined → badge hidden
}

A freshly-tiered topic that hasn't started translating yet emits no iceberg_topic_translation_lag / iceberg_topic_commit_lag series, so bridge resolved to undefined and the query — with every row served from the topic tail — was misclassified as a plain query and showed no badge. This is exactly the case where the bridge is doing the most work.

Fix

Decouple bridge classification from lag display:

  • Classify bridge-ness from the authoritative redpanda.iceberg.mode config via useTopicIcebergQuery (already used by the catalog tree), independent of lag-metric availability.
  • Lag values default to 0 when their series is absent; the lag timeline stays hidden until real lag appears (unchanged totalLag === 0 guard), but the badge now shows for any tiered topic.
  • Bonus correctness: a non-tiered topic now correctly shows no badge because the config says so, not because a metric happened to be missing.

Testing

  • tsgo --noEmit clean
  • SQL unit tests pass (sql.test.tsx)
  • No new lint errors introduced

…-1330]

The SQL editor's "Bridge query" badge was gated on the presence of an
Iceberg lag metric series rather than on whether the queried topic is
actually Iceberg-tiered. A freshly-tiered topic that hasn't started
translating yet emits no `iceberg_topic_translation_lag` /
`iceberg_topic_commit_lag` series, so `bridge` resolved to undefined and
the query — every row served from the topic tail — looked like a plain
query.

Classify bridge-ness from the authoritative `redpanda.iceberg.mode`
config (via useTopicIcebergQuery, already used by the catalog tree),
independent of lag-metric availability. Lag values default to 0 when
their series is absent; the lag timeline stays hidden until real lag
appears, but the badge now shows for any tiered topic.
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Registry drift detected

App: frontend · Scope: diff vs origin/master · Files: 1

Count
⚠️ Outdated registry components 3
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0
Components needing attention
Status Component Uses Detail
⚠️ outdated badge installed 1.11.1 → latest 2.1.1
⚠️ outdated button installed 1.11.1 → latest 2.1.1
⚠️ outdated resizable installed 1.11.1 → latest 2.1.1

Refresh command:

bunx shadcn@latest add @redpanda/badge @redpanda/button @redpanda/resizable --overwrite

Generated by lookout audit-changes.

@c-julin c-julin changed the title fix(sql): show bridge badge for Iceberg-tiered topics before sync [UX-1330] fix(sql): show bridge badge for Iceberg-tiered topics before sync Jun 24, 2026
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.

1 participant