Skip to content

[CLI-3590] Rename tableflow topic [create | delete] to [enable | disable] and add [create | delete] as aliases #3090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

sgagniere
Copy link
Member

@sgagniere sgagniere commented May 8, 2025

Release Notes

Breaking Changes

  • PLACEHOLDER

New Features

  • Rename confluent tableflow topic create to confluent tableflow topic enable, and add create as an alias to preserve existing workflows and avoid a breaking change
  • Rename confluent tableflow topic delete to confluent tableflow topic disable, and add delete as an alias to preserve existing workflows and avoid a breaking change

Bug Fixes

  • Improve error messages for various delete commands

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
  • I have verified this PR in Confluent Platform on-premises environment, if applicable.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

Rename Cloud commands confluent tableflow topic [create | delete] to confluent tableflow topic [enable | disable], but keep create and delete as aliases to prevent breaking changes.

In order to make the wording of outputs and error messages consistent with the delete -> disable change, the bulk deletion code has been updated to not hardcode "delete" in strings. Some code duplication has been removed as well.

This has also improved output strings for the plugin uninstall command, which now uses uninstall instead of delete in the confirmation prompts and error messages.

This PR also adds some new integration tests for schema-registry kek [delete | undelete] to 1) improve test coverage and 2) make sure that removing duplicate code in the bulk deletion code didn't alter these outputs.

Finally, I removed some redundant error wrapping.

Blast Radius

The blast radius of the primary change should be 0, since aliases have been added to preserve the existing behavior. Any issues with the updates to the bulk deletion code could affect the wording of confirmation prompts and deletion error messages of any delete command (although the actual behavior should not be affected).

References

Test & Review

  • Added new integration tests for confluent tableflow topic [enable | disable] and kept existing integration tests for create and delete to check the validity of those aliases.
  • Added new integration tests for confluent sr kek [delete | undelete] and on-prem confluent kafka link delete to test the wording of the confirmation prompts.

Manual Testing:
Enable:

confluent tableflow topic enable test-tableflow-topic --retention-ms 604900000 --storage-type MANAGED                                     
+-------------------------+----------------------+
| Kafka Cluster           | lkc-xq5vrx           |
| Topic Name              | test-tableflow-topic |
| Enable Compaction       | true                 |
| Enable Partitioning     | true                 |
| Environment             | env-7y5pjj           |
| Record Failure Strategy | SUSPEND              |
| Retention Ms            | 604900000            |
| Storage Type            | MANAGED              |
| Suspended               | false                |
| Table Formats           | ICEBERG              |
| Phase                   | PENDING              |
+-------------------------+----------------------+

Create (Alias):

confluent tableflow topic create test-tableflow-topic-2 --retention-ms 604900000 --storage-type MANAGED                                        
+-------------------------+------------------------+
| Kafka Cluster           | lkc-xq5vrx             |
| Topic Name              | test-tableflow-topic-2 |
| Enable Compaction       | true                   |
| Enable Partitioning     | true                   |
| Environment             | env-7y5pjj             |
| Record Failure Strategy | SUSPEND                |
| Retention Ms            | 604900000              |
| Storage Type            | MANAGED                |
| Suspended               | false                  |
| Table Formats           | ICEBERG                |
| Phase                   | PENDING                |
+-------------------------+------------------------+

Disable:

confluent tableflow topic disable test-tableflow-topic test-tableflow-topic-2
Are you sure you want to disable topics "test-tableflow-topic" and "test-tableflow-topic-2"? (y/n): y
Requested to disable topics "test-tableflow-topic" and "test-tableflow-topic-2".

Delete (alias; after recreating/re-enabling the two topics):

confluent tableflow topic delete test-tableflow-topic test-tableflow-topic-2
Are you sure you want to delete topics "test-tableflow-topic" and "test-tableflow-topic-2"? (y/n): y
Requested to delete topics "test-tableflow-topic" and "test-tableflow-topic-2".

Help output for enable, showing alias:

confluent tableflow topic enable -h
Enable a topic.

Usage:
  confluent tableflow topic enable <name> [flags]

Aliases:
  enable, create

Examples:
Enable a BYOS Tableflow topic related to a Kafka cluster.

  $ confluent tableflow topic enable my-tableflow-topic --cluster lkc-123456 --retention-ms 604800000 --storage-type BYOS --provider-integration cspi-stgce89r7 --bucket-name bucket_1

Enable a confluent managed Tableflow topic related to a Kafka cluster.

  $ confluent tableflow topic enable my-tableflow-topic --cluster lkc-123456 --retention-ms 604800000 --storage-type MANAGED

Flags:
      --cluster string                   Kafka cluster ID.
      --retention-ms string              Specify the max age of snapshots (Iceberg) or versions (Delta) (snapshot/version expiration) to keep on the table in milliseconds for the Tableflow enabled topic. (default "604800000")
      --storage-type string              Specify the storage type of the Kafka cluster, one of MANAGED or BYOS. (default "MANAGED")
      --provider-integration string      Specify the provider integration id.
      --bucket-name string               Specify the name of the AWS S3 bucket.
      --table-formats string             Specify the table formats, one of DELTA or ICEBERG. (default "ICEBERG")
      --record-failure-strategy string   Specify the record failure strategy, one of SUSPEND or SKIP. (default "SUSPEND")
      --context string                   CLI context name.
      --environment string               Environment ID.
  -o, --output string                    Specify the output format as "human", "json", or "yaml". (default "human")

Global Flags:
  -h, --help            Show help for this command.
      --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
  -v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

Help output for disable, showing alias:

confluent tableflow topic disable -h
Disable topics.

Usage:
  confluent tableflow topic disable <name-1> [name-2] ... [name-n] [flags]

Aliases:
  disable, delete

Examples:
Disable a Tableflow topic "my-tableflow-topic" related to a Kafka cluster "lkc-123456".

  $ confluent tableflow topic disable my-tableflow-topic --cluster lkc-123456

Flags:
      --cluster string       Kafka cluster ID.
      --force                Skip the deletion confirmation prompt.
      --context string       CLI context name.
      --environment string   Environment ID.

Global Flags:
  -h, --help            Show help for this command.
      --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
  -v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent

This comment has been minimized.

return fmt.Errorf(errors.DeleteResourceErrorMsg, resource.NetworkLinkService, id, err)
}
return nil
return c.V2Client.DeleteNetworkLinkService(environmentId, id)
Copy link
Member Author

Choose a reason for hiding this comment

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

The Delete (and DeleteWithoutMessage) functions already wrap these errors w/ a message nearly identical to DeleteResourceErrorMsg, so these changes are to remove redundant phrasing from error messages like Error: failed to delete n-abc123: failed to delete network "n-abc123": ...

@sgagniere sgagniere marked this pull request as ready for review June 5, 2025 20:00
@sgagniere sgagniere requested a review from a team as a code owner June 5, 2025 20:00
@sgagniere sgagniere changed the title [CLI-3590] Rename tableflow topic create to enable and add create as an alias [CLI-3590] Rename tableflow topic [create | delete] to [enable | disable] and add [create | delete] as aliases Jun 5, 2025
@sonarqube-confluent
Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 97.70% Coverage (77.20% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: cli

View in SonarQube

Copy link
Member

@cqin-confluent cqin-confluent left a comment

Choose a reason for hiding this comment

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

Great job on this! Everything looks good to me 👍

@sgagniere
Copy link
Member Author

Going to wait on merging this one.

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.

2 participants