Ability to submit Flink statements in snapshot mode. - #3425
Open
James Robinson (jlrobins) wants to merge 5 commits into
Open
Ability to submit Flink statements in snapshot mode.#3425James Robinson (jlrobins) wants to merge 5 commits into
James Robinson (jlrobins) wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds per-document support for submitting Confluent Cloud Flink SQL statements in bounded “snapshot” (batch) mode by wiring sql.snapshot.mode: "now" through statement submission and a new Flink SQL CodeLens toggle, plus telemetry and supporting tests.
Changes:
- Introduces
FlinkSnapshotModeand aFlinkStatement.modegetter derived fromspec.properties["sql.snapshot.mode"]. - Extends
submitFlinkStatement()to acceptsnapshotModeand conditionally setsql.snapshot.mode: "now"for batch execution; persists the chosen mode per-document via URI metadata and a new CodeLens toggle/command. - Adds unit tests for the new behavior, plus small developer-experience updates (
launch.json, test docs).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/testResources/flinkStatement.ts | Extends test fixture to optionally include sql.snapshot.mode when creating statements. |
| src/storage/constants.ts | Adds UriMetadataKeys.FLINK_SNAPSHOT_MODE for per-document mode persistence. |
| src/models/flinkStatement.ts | Adds FlinkSnapshotMode enum and FlinkStatement.mode getter derived from statement properties. |
| src/models/flinkStatement.test.ts | Adds unit tests for FlinkStatement.mode behavior (absent/now/unknown values). |
| src/flinkSql/statementUtils.ts | Wires snapshotMode into statement submission properties and persists snapshot mode into URI metadata. |
| src/flinkSql/statementUtils.test.ts | Adds tests for snapshot-mode property wiring and metadata setting. |
| src/commands/flinkStatements.ts | Passes snapshot mode into submission and includes it in submission telemetry. |
| src/commands/documents.ts | Adds toggleSnapshotModeForUriCommand, resets snapshot mode in “Clear Settings”, and registers the new command. |
| src/commands/documents.test.ts | Adds unit tests for the new toggle command and updates reset expectations. |
| src/codelens/flinkSqlProvider.ts | Adds “Mode: Streaming/Snapshot” CodeLens and metadata reader helper. |
| src/codelens/flinkSqlProvider.test.ts | Adds tests for the new CodeLens and getSnapshotModeFromMetadata(). |
| .vscode/launch.json | Prevents double-activation by disabling the marketplace-installed extension during F5 debugging. |
| .claude/rules/testing/unit-tests.md | Documents a macOS-specific local test-host workaround for newer VS Code builds. |
James Robinson (jlrobins)
marked this pull request as ready for review
August 4, 2026 18:40
James Robinson (jlrobins)
enabled auto-merge (squash)
August 5, 2026 20:12
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.




Summary
Adds support for submitting Flink statements in bounded "snapshot" (batch) mode instead of the
default continuous "streaming" mode, via the CCloud REST API's
sql.snapshot.mode: "now"statement property.
FlinkSnapshotModeenum (BATCH/STREAMING) and aFlinkStatement.modegetter thatreads the mode back off a statement's
spec.properties(New propertymodeinFlinkStatement#1849)submitFlinkStatement()accepts an optionalsnapshotModeand setssql.snapshot.mode: "now"on the request when submitting in batch mode (Accept
FlinkSnapshotModeoptarg when submitting new flink statements #1850)new
toggleSnapshotModeForUriCommandand aUriMetadataKeys.FLINK_SNAPSHOT_MODEmetadata key,following the existing compute-pool/database CodeLens pattern (New codelens widget for toggling between batch vs streaming mode (?) #1853)
catalog/database), and defaults to streaming when unset; "Clear Settings" resets it too
snapshot_modeto the existing Flink statement submission telemetryPart of the batch-mode-queries epic (#1848). Follow-up work — surfacing the mode in the
statement tooltip (#1851) and the results viewer (#1852) — is intentionally out of scope here
and will land in a separate PR; the results viewer works unmodified for snapshot-mode statements
today.
While Here
.vscode/launch.json: added--disable-extension confluentinc.vscode-confluentto the "RunExtension" debug config so the marketplace-installed copy of this extension doesn't
double-activate alongside the local
--extensionDevelopmentPathbuild during F5 debugging..claude/rules/testing/unit-tests.md: documented a macOS-specificnpx gulp testfailure modeseen on newer VS Code test-host builds (e.g. 1.131.0) —
@vscode/test-electron@2.3.9expects anElectronbinary that some releases ship renamed toCode, and the localln -sworkaround forthat invalidates the app bundle's code signature, requiring an ad hoc re-sign. Both are dev-loop
fixes only; nothing in the gitignored
.vscode-test/cache is committed.Test plan
npx gulp checknpx gulp lintnpx gulp test— new/updated unit tests in:src/models/flinkStatement.test.ts(modegetter)src/flinkSql/statementUtils.test.ts(submitFlinkStatementproperty wiring,setFlinkDocumentMetadata)src/commands/documents.test.ts(toggleSnapshotModeForUriCommand, updated reset test)src/codelens/flinkSqlProvider.test.ts(new toggle lens,getSnapshotModeFromMetadata)sql.snapshot.modeappears (or doesn't) in the submitted statement's properties in CCloud
Relationships
Closes #1849
Closes #1850
Closes #1853
Part of epic #1848
Screenshots
No changes (yet) to the results viewer, although the snapshot mode statement auto-evolves to COMPLETED state when done. No need to manually stop it. The remaining open tickets in the epic will adjust the results viewer page.