Revert "[APIE-1040] Add generic --wait framework; refactor Flink stat… - #3386
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Reverts the previously introduced generic --wait framework and related Flink statement --wait enhancements, returning Flink statement create to a simpler retry.Retry(...) polling approach and removing associated test/mock coverage.
Changes:
- Removes
pkg/wait(implementation + unit tests) and switches Flink statement create--waitback topkg/retry.Retry. - Removes
--wait-timeoutfrom Flink statement create (cloud + on-prem) and updates help goldens accordingly. - Simplifies Flink test-server handlers and drops the integration fixtures/cases that exercised timeout/failed/transition behaviors.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/flink/command_statement_create.go | Reverts cloud --wait implementation to retry.Retry; removes --wait-timeout; updates help text. |
| internal/flink/command_statement_create_onprem.go | Reverts on-prem --wait implementation to retry.Retry; removes --wait-timeout; updates help text. |
| pkg/wait/wait.go | Deletes the generic polling framework. |
| pkg/wait/wait_test.go | Deletes unit tests for the polling framework. |
| test/flink_test.go | Removes integration cases for --wait timeout and failed-phase behavior. |
| test/flink_onprem_test.go | Removes the on-prem --wait integration case. |
| test/test-server/flink_gateway_router.go | Removes mock statement phases used by the deleted integration tests; always returns COMPLETED. |
| test/test-server/flink_onprem_handler.go | Removes the running-wait-stmt mock behavior used by the deleted on-prem integration test. |
| test/fixtures/output/flink/statement/create-help.golden | Updates help output to remove --wait-timeout and reflect new --wait description. |
| test/fixtures/output/flink/statement/create-help-onprem.golden | Updates on-prem help output to remove --wait-timeout and reflect new --wait description. |
| test/fixtures/output/flink/statement/create-missing-sql-failure.golden | Updates flags listing to remove --wait-timeout. |
| test/fixtures/output/flink/statement/create-missing-compute-pool-failure.golden | Updates flags listing to remove --wait-timeout. |
| test/fixtures/output/flink/statement/create-wait-timeout.golden | Deletes the --wait-timeout timeout golden output. |
| test/fixtures/output/flink/statement/create-wait-failed.golden | Deletes the failed-phase golden output. |
| test/fixtures/output/flink/statement/create-wait-onprem.golden | Deletes the on-prem wait golden output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cmd.Flags().Bool("wait", false, "Block until the statement is running or has failed.") | ||
| cmd.Flags().StringSlice("property", []string{}, "A mechanism to pass properties in the form key=value when creating a Flink statement.") |
| if statement.Status.GetPhase() == "PENDING" { | ||
| return fmt.Errorf(`statement phase is "%s"`, statement.Status.GetPhase()) | ||
| } |
| if err != nil { | ||
| return err | ||
| } |
| cmd.Flags().String("flink-configuration", "", "The file path to hold the Flink configuration for the statement.") | ||
| cmd.Flags().Bool("wait", false, "Block until the statement reaches a terminal state.") | ||
| cmd.Flags().Duration("wait-timeout", flinkStatementCreateWaitTimeout, "Maximum time to wait when --wait is set.") | ||
| cmd.Flags().Bool("wait", false, "Boolean flag to block until the statement is running or has failed.") | ||
| addCmfFlagSet(cmd) |
| if polledStatement.GetStatus().Phase == "PENDING" { | ||
| return fmt.Errorf(`statement phase is "%s"`, polledStatement.GetStatus().Phase) | ||
| } |
| if err != nil { | ||
| return err | ||
| } |
| {args: `flink statement create my-statement-2 --sql "INSERT * INTO table;" --cloud aws --region eu-west-1 --service-account sa-123456`, fixture: "flink/statement/create-without-compute-pool.golden"}, | ||
| {args: `flink statement create my-statement --sql "INSERT * INTO table;" --compute-pool lfcp-123456`, fixture: "flink/statement/create-service-account-warning.golden"}, | ||
| {args: `flink statement create my-statement --sql "INSERT * INTO table;" --compute-pool lfcp-123456 --service-account sa-123456 --wait`, fixture: "flink/statement/create-wait.golden"}, |
| {args: `flink statement create test-stmt --environment default --sql "SELECT * FROM test_table" --compute-pool test-pool -o yaml`, fixture: "flink/statement/create-success-yaml.golden"}, | ||
| {args: `flink statement create test-stmt --environment default --sql "SELECT * FROM test_table" --compute-pool test-pool --flink-configuration test/fixtures/input/flink/statement/flink-configuration.json`, fixture: "flink/statement/create-success.golden"}, | ||
| {args: `flink statement create test-stmt --environment default --sql "SELECT * FROM test_table" --compute-pool test-pool --flink-configuration test/fixtures/input/flink/statement/flink-configuration.yaml`, fixture: "flink/statement/create-success.golden"}, |
| c.addDatabaseFlag(cmd) | ||
| cmd.Flags().Bool("wait", false, "Block until the statement reaches a terminal state.") | ||
| cmd.Flags().Duration("wait-timeout", flinkStatementCreateWaitTimeout, "Maximum time to wait when --wait is set.") | ||
| cmd.Flags().Bool("wait", false, "Block until the statement is running or has failed.") |
| cmd.Flags().String("flink-configuration", "", "The file path to hold the Flink configuration for the statement.") | ||
| cmd.Flags().Bool("wait", false, "Block until the statement reaches a terminal state.") | ||
| cmd.Flags().Duration("wait-timeout", flinkStatementCreateWaitTimeout, "Maximum time to wait when --wait is set.") | ||
| cmd.Flags().Bool("wait", false, "Boolean flag to block until the statement is running or has failed.") |
|




…ement create (#3361)"
This reverts commit eabeb1c.
Release Notes
Breaking Changes
New Features
Bug Fixes
Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Temporary revert for this release.
Blast Radius
References
Test & Review