Skip to content

[ORC- 8867]feat: add confluent-jdbc connection #3092

Merged
rveerannagowda (rveerannagowda) merged 9 commits intomainfrom
ORC-8867
May 14, 2025
Merged

[ORC- 8867]feat: add confluent-jdbc connection #3092
rveerannagowda (rveerannagowda) merged 9 commits intomainfrom
ORC-8867

Conversation

@rveerannagowda
Copy link
Copy Markdown
Contributor

@rveerannagowda rveerannagowda (rveerannagowda) commented May 13, 2025

Release Notes

New Features

  • Add new flink connection type confluent-jdbc.

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 Cloud devel
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

Add confluent-jdbc as a new flink connection type for Confluent Cloud.

Blast Radius

Confluent Platform customers using confluent flink connection subcommand would be affected

References

JIRA ticket: https://confluentinc.atlassian.net/browse/ORC-8867

Test & Review

Creating connection of type confluent-jdbc


dist/confluent_darwin_arm64/confluent flink connection create mysql-customer-db1 \
  --cloud gcp \
  --region us-central1 \
  --type confluent_jdbc \
  --endpoint 'jdbc:mysql://customer-db.example.com:3306/customerdb' \
  --username 'readonly_user' \
  --password 'secret123'

+---------------+------------------------------------------------------+
| Creation Date | 2025-05-09 01:51:16.510925                           |
|               | +0000 UTC                                            |
| Name          | mysql-customer-db1                                   |
| Environment   | env-030qn9                                           |
| Cloud         | gcp                                                  |
| Region        | us-central1                                          |
| Type          | CONFLUENT_JDBC                                       |
| Endpoint      | jdbc:mysql://customer-db.example.com:3306/customerdb |
| Data          | <REDACTED>                                           |
| Status        |                                                      |
+---------------+------------------------------------------------------+

Listing Connections of type confluent-jdbc


dist/confluent_darwin_arm64/confluent flink connection list --cloud GCP --region us-central1 --type confluent-jdbc 
          Creation Date          |        Name        | Environment | Cloud |   Region    |      Type      |                       Endpoint                       |    Data    | Status | Status Detail  
---------------------------------+--------------------+-------------+-------+-------------+----------------+------------------------------------------------------+------------+--------+----------------
  2025-05-12 18:42:40.967551     | mysql-customer-db1 | env-rgdkk   | GCP   | us-central1 | CONFLUENT-JDBC | jdbc:mysql://customer-db.example.com:3306/customerdb | <REDACTED> |        |                
  +0000 UTC                      |                    |             |       |             |                |                                                      |            |        |            

Updating Connection :


dist/confluent_darwin_arm64/confluent flink connection update mysql-customer-db1 --cloud GCP --region us-central1 --username 'readonly_user' --password 'secret123'

+---------------+------------------------------------------------------+
| Creation Date | 2025-05-12 18:42:40.967551                           |
|               | +0000 UTC                                            |
| Name          | mysql-customer-db1                                   |
| Environment   | env-rgdkk                                            |
| Cloud         | GCP                                                  |
| Region        | us-central1                                          |
| Type          | CONFLUENT-JDBC                                       |
| Endpoint      | jdbc:mysql://customer-db.example.com:3306/customerdb |
| Data          | <REDACTED>                                           |
| Status        |                                                      |
+---------------+------------------------------------------------------+

Deleting Connection

 dist/confluent_darwin_arm64/confluent flink connection delete mysql-customer-db1 --cloud GCP --region us-central1                                           
Are you sure you want to delete Flink connection "mysql-customer-db1"? (y/n): y
Deleted Flink connection "mysql-customer-db1".

Copilot AI review requested due to automatic review settings May 13, 2025 05:06
@confluent-cla-assistant
Copy link
Copy Markdown

🎉 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.

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

This PR introduces "confluent-jdbc" as a new Flink connection type for Confluent Cloud. Key changes include:

  • Adding test cases in test/flink_test.go for the new connection type.
  • Updating golden files for connection help, list, and error messages to include "confluent-jdbc".
  • Modifying connection type mappings in pkg/flink/utils.go and vocabulary in cmd/lint/main.go.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/flink_test.go Added test case for creating a confluent-jdbc connection.
test/fixtures/output/flink/connection/update-help.golden Updated help text to include confluent-jdbc username/password.
test/fixtures/output/flink/connection/list/*.golden Updated list and error messages to include confluent-jdbc.
test/fixtures/output/flink/connection/create/*.golden Added golden output for confluent-jdbc connection creation.
pkg/flink/utils.go Extended connection type arrays and mappings for confluent-jdbc.
cmd/lint/main.go Included confluent-jdbc into the allowed vocabulary.

@sonarqube-confluent

This comment has been minimized.

@rveerannagowda
Copy link
Copy Markdown
Contributor Author

PASS
failed to remove temporary directory: remove C:\Users\SEMAPH~1\AppData\Local\Temp\ccloud-schema\google\protobuf\descriptor.proto: The process cannot access the file because it is being used by another process.
FAIL	github.com/confluentinc/cli/v4/pkg/serdes	2.774s

Flaky test unrelated to code failing :https://confluent.slack.com/archives/CG6BW233L/p1738097461887909

@rveerannagowda rveerannagowda (rveerannagowda) changed the title Orc 8867 [ORC- 8867]feat: add confluent-jdbc connection May 13, 2025
--password string Specify password for the type: "mongodb" or "couchbase".
--username string Specify username for the type: "mongodb", "couchbase", or "confluent-jdbc".
--password string Specify password for the type: "mongodb", "couchbase", or "confluent-jdbc".
--auth string Specify auth for the type: "confluent-jdbc".
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need auth? Is username, password not enough?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

confluent flink connection create mysql_customer_db 
--cloud aws --region us-east-2 --environment env-o2zynj
--type confluent-jdbc
--endpoint 'jdbc:mysql://customer-db.example.com:3306/customerdb'
--auth basic 
--username 'readonly_user'
--password 'secret123'

I was trying to follow whats the command line is there in the product doc .Have added auth as optional and username and password as required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not think we need auth now as we have not decided on private network approach yet, maybe we can add them later.

Copy link
Copy Markdown
Contributor Author

@rveerannagowda rveerannagowda (rveerannagowda) May 13, 2025

Choose a reason for hiding this comment

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

Thanks for the clarification ! Removed it

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent

This comment has been minimized.

1 similar comment
@sonarqube-confluent
Copy link
Copy Markdown

Passed

Analysis Details

1 Issue

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

Coverage and Duplications

  • Coverage No coverage information (76.90% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: cli

View in SonarQube

@tmalikconfluent
Copy link
Copy Markdown
Contributor

The overall PR looks great! We should add more results to testing section though, such as creating a connection maybe? Also, the release notes are customer facing and should be precise.Please refer to release notes of other CLI PRs for reference.

@rveerannagowda rveerannagowda (rveerannagowda) merged commit f92afc6 into main May 14, 2025
2 of 3 checks passed
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.

5 participants