Skip to content

update flink statement warnings UI based on new response structure#3254

Merged
Noel Cothren (noeldevelops) merged 24 commits intomainfrom
ncothren/3067-statement-warnings
Apr 15, 2026
Merged

update flink statement warnings UI based on new response structure#3254
Noel Cothren (noeldevelops) merged 24 commits intomainfrom
ncothren/3067-statement-warnings

Conversation

@noeldevelops
Copy link
Copy Markdown
Member

@noeldevelops Noel Cothren (noeldevelops) commented Feb 3, 2026

Summary of Changes

  • Display statement warnings that are returned with new API
  • Preserves legacy format for statement warnings inside of Details, but prefers new warnings structure when available
  • Rearranges the way error, info, warnings details are surfaced in the Statement Results Viewer header section & simplifies the HTML/CSS for this element
  • Closes Integrate new Statement Warnings feature #3067

Click-testing instructions

Changes are visible in the VS Code Flink Statement Results viewer when there are Statement Details, Errors, or Warnings. The new API is under a feature flag, so requires internal access to our Staging environment where the flag is enabled. There are detailed testing scenarios for the internal team in shared docs.

  1. Run a Flink statement that you know will produce a warning or error to see the new UI elements
  2. OR Stop a statement that is running to see the Info message "This statement was stopped manually."
  3. OR, mock some warnings: in flink-statement-results.ts file, set this.hasWarnings to true & add an array of mocks e.g.
 this.formattedWarnings = this.derive(() => {
      const mockWarnings = [ {
          severity: "LOW",
          message: "This is a low severity warning for testing purposes.",
          reason: "LOW_SEVERITY_TEST",
          createdAt: "2025-11-14T15:00:00Z",
          isCritical: false,
        }, ...

Optional: Any additional details or context that should be provided?

  • Feature flag for the new warnings API is not enabled in production yet; we'll stay backward compatible for the foreseeable future
  • ⚠️ Note: not all these boxes will be shown at once -- normally just 1 or two items returned
Light
light
Dark
dark

Pull request checklist

Please check if your PR fulfills the following (if applicable):

Tests

  • Added new
  • Updated existing
  • Deleted existing

Release notes

  • Does anything in this PR need to be mentioned in the user-facing CHANGELOG?

@airlock-confluentinc airlock-confluentinc Bot force-pushed the ncothren/3067-statement-warnings branch from 741864d to 99f59ae Compare February 25, 2026 17:54
@noeldevelops Noel Cothren (noeldevelops) changed the title [WIP] #3067 statement warnings api #3067 statement warnings api Mar 3, 2026
@noeldevelops Noel Cothren (noeldevelops) changed the title #3067 statement warnings api [#3067] update statement warnings UI based on new response structure Mar 3, 2026
@noeldevelops Noel Cothren (noeldevelops) changed the title [#3067] update statement warnings UI based on new response structure update flink statement warnings UI based on new response structure Mar 3, 2026
Copilot AI review requested due to automatic review settings March 3, 2026 20:34
@noeldevelops Noel Cothren (noeldevelops) review requested due to automatic review settings March 3, 2026 20:34
Copilot AI review requested due to automatic review settings March 3, 2026 21:54
@airlock-confluentinc airlock-confluentinc Bot force-pushed the ncothren/3067-statement-warnings branch from 4660052 to 22ba7e8 Compare March 3, 2026 21:54
@noeldevelops Noel Cothren (noeldevelops) review requested due to automatic review settings March 3, 2026 21:54
Copilot AI review requested due to automatic review settings March 3, 2026 22:09
@noeldevelops Noel Cothren (noeldevelops) review requested due to automatic review settings March 3, 2026 22:09
Copilot AI review requested due to automatic review settings March 3, 2026 22:15
@noeldevelops Noel Cothren (noeldevelops) review requested due to automatic review settings March 3, 2026 22:15
Copilot AI review requested due to automatic review settings March 3, 2026 23:03
@noeldevelops Noel Cothren (noeldevelops) review requested due to automatic review settings March 3, 2026 23:03
@noeldevelops Noel Cothren (noeldevelops) marked this pull request as ready for review March 3, 2026 23:08
@noeldevelops Noel Cothren (noeldevelops) requested a review from a team as a code owner March 3, 2026 23:08
Copilot AI review requested due to automatic review settings March 3, 2026 23:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Flink Statement Results webview to surface statement warnings using the new structured warnings field from the getSqlv1Statement response, while remaining backward compatible with legacy [Warning] text embedded in status.detail.

Changes:

  • Add warning parsing utilities to prefer structured API warnings and fall back to legacy [Warning] parsing.
  • Extend statement models/results manager/webview view model to pass warnings through to the results viewer.
  • Refactor results viewer “details/warnings” header UI into a unified list with updated HTML/CSS rendering.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/webview/flink-statement-results.ts Builds a unified detailItems list combining error/info detail text with structured/legacy warnings.
src/webview/flink-statement-results.html Reworks the header details UI to render multiple detail items with severity styling.
src/models/flinkStatement.ts Adds a warnings getter that extracts structured warnings or parses legacy detail warnings.
src/flinkSql/warningParser.ts New helper module to parse legacy warnings, prefer structured warnings, and strip [Warning] blocks from detail.
src/flinkSql/warningParser.test.ts Unit tests for warning parsing/extraction/stripping behavior.
src/flinkSql/flinkStatementResultsManager.ts Includes statement warnings in the data returned to the webview.
src/flinkSql/flinkStatementResultsManager.test.ts Updates expected statement meta to include warnings.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/flinkSql/warningParser.ts Outdated
Comment thread src/webview/flink-statement-results.html
Comment thread src/webview/flink-statement-results.html Outdated
@noeldevelops Noel Cothren (noeldevelops) marked this pull request as draft March 5, 2026 14:50
Copy link
Copy Markdown
Member Author

@noeldevelops Noel Cothren (noeldevelops) left a comment

Choose a reason for hiding this comment

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

Claude wrote & posted this :)
"Self-review: found a few items to address."

Comment thread src/webview/flink-statement-results.ts Outdated
Comment thread src/flinkSql/warningParser.ts Outdated
Comment thread src/webview/flink-statement-results.ts Outdated
@sonarqube-confluent
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Clarifies that the type assertion should be removed once the OpenAPI
spec includes the warnings field on statement status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove hasWarnings, hasCriticalWarnings, and formattedWarnings signals
that were not referenced in the template or elsewhere. Inline the
formatting logic directly into the detailItems derivation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge identical .detail-item.error/.detail-item.critical and
.detail-severity.error/.detail-severity.critical rules into
combined selectors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
detailText was only consumed by detailItems, making it an unnecessary
intermediate signal. Inline the logic to simplify the reactive graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ate format

- Remove .replace(/\n/g, "<br>") since data-text + pre-wrap handles newlines
- Extract duplicated legacy warning regex into shared LEGACY_WARNING_PATTERN
- Use .toLocaleString() instead of String() for warning timestamps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@airlock-confluentinc airlock-confluentinc Bot force-pushed the ncothren/3067-statement-warnings branch from ab708d6 to 83b6e36 Compare April 13, 2026 15:04
@noeldevelops Noel Cothren (noeldevelops) marked this pull request as ready for review April 13, 2026 15:18
@shouples Dave Shoup (shouples) self-assigned this Apr 13, 2026
Copy link
Copy Markdown
Contributor

@shouples Dave Shoup (shouples) left a comment

Choose a reason for hiding this comment

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

LGTM and works well from what I was able to clicktest in our various environments, just one minor question but shouldn't block merging

Comment thread src/flinkSql/warningParser.ts Outdated
Comment on lines +9 to +15
/** API warning shape from the new structured warnings field */
export interface StatementWarning {
readonly severity: string;
readonly created_at: Date | null;
readonly reason: string;
readonly message: string;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason we don't use SqlV1StatementWarning directly? Looks like the only difference is some of these values are set as readonly but I don't think any call points try to mutate these properties after we get the response back

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah good catch. I'm updating now to use the client type. created_at is the only thing that needs a little fix, incoming...

@sonarqube-confluent
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Copy link
Copy Markdown
Contributor

@shouples Dave Shoup (shouples) left a comment

Choose a reason for hiding this comment

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

👏

@noeldevelops Noel Cothren (noeldevelops) merged commit 98a80b8 into main Apr 15, 2026
13 of 14 checks passed
@noeldevelops Noel Cothren (noeldevelops) deleted the ncothren/3067-statement-warnings branch April 15, 2026 13:11
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.

Integrate new Statement Warnings feature

3 participants