-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Adds TLS check to mongodb destination and migrates util constants #18892
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
Conversation
Affected Connector ReportNOTE
|
Connector | Version | Changelog | Publish |
---|---|---|---|
source-mongodb-strict-encrypt |
0.1.19 |
⚠ (doc not found) |
⚠ (not in seed) |
source-mongodb-v2 |
0.1.19 |
✅ | ✅ |
- See "Actionable Items" below for how to resolve warnings and errors.
⚠ Destinations (2)
Connector | Version | Changelog | Publish |
---|---|---|---|
destination-mongodb |
0.1.9 |
✅ | ✅ |
destination-mongodb-strict-encrypt |
0.1.9 |
✅ | ⚠ (not in seed) |
- See "Actionable Items" below for how to resolve warnings and errors.
Actionable Items
(click to expand)
Category | Status | Actionable Item |
---|---|---|
Version | ❌ mismatch |
The version of the connector is different from its normal variant. Please bump the version of the connector. |
⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
|
Changelog | ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
❌ changelog missing |
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog. | |
Publish | ⚠ not in seed |
The connector is not in the seed file (e.g. source_definitions.yaml ), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug. |
❌ diff seed version |
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version. |
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Currently this is a duplicate of the same file within destination-mongodb-strict-encrypt module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tuliren just wanted to check, is there anything stopping me from moving the MongodbDestinationStrictEncrypt
file from the destination-mongodb-strict-encrypt
module instead of creating a copy of the MongodbDestinationStrictEncrypt
in the non-strict-encrypt variant?
Currently hesitated to move the strict-encrypt
variant since a duplicate file exists for the source-postgres
and source-postgres-strict-encrypt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving the
MongodbDestinationStrictEncrypt
file from thedestination-mongodb-strict-encrypt
module
After moving the strict encrypt class from the strict-encrypt
module to the normal module, will the strict-encrypt
module still have a mainClass
in its build.gradle
file? If yes, this would be the perfect solution for now. We won't have the duplicated class problem.
/test connector=connectors/destination-mongodb
Build FailedTest summary info:
|
/test connector=connectors/destination-s3-strict-encrypt
Build FailedTest summary info:
|
/test connector=connectors/destination-mongodb
Build FailedTest summary info:
|
/test connector=connectors/destination-mongodb
Build FailedTest summary info:
|
e6d3c64
to
cc5ab7b
Compare
/test connector=connectors/destination-mongodb
Build PassedTest summary info:
|
/test connector=connectors/destination-mongodb-strict-encrypt
Build FailedTest summary info:
|
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.db.jdbc.JdbcUtils; | ||
|
||
public class MongoDbDestinationUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility of combining this with MongoDbSourceUtils to prevent code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, initially I didn't do that simply because it was in different packages but looking at this right now I see there's a MongoUtils.java
where these changes and your changes can live. I'll work on moving the changes over to that utility file
final MongoInstanceType instance = MongoInstanceType.fromValue(instanceConfig.get(MongoDbDestinationUtils.INSTANCE).asText()); | ||
// If the MongoDb destination connector is not set up to use a TLS connection, then check should fail | ||
if (instance.equals(MongoInstanceType.STANDALONE) && !MongoDbDestinationUtils.tlsEnabledForStandaloneInstance(config, instanceConfig)) { | ||
return new AirbyteConnectionStatus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't urgent - can you hold off until I merge the PR that adds the config exception handling? That way - you can just throw a ConfigErrorException instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll probably rework the MongodbDestinationUtils
and MongodbSourceUtils
into MongoUtils.java
in the meantime. Your changes for that PR config exception should be ready to merge unless there's something else you needed to follow up on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's still a degree of integration test mangling that I need to do for that PR. To unblock you and others I have #18989 (which you already commented on)
I'll going to break that PR into smaller parts, but overall you should be unblocked on that front soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That PR is merged, so you should be able to throw a ConfigErrorException here now
cc5ab7b
to
08af15d
Compare
94df360
to
2b1f9fe
Compare
/test connector=connectors/source-mongodb-strict-encrypt
Build PassedTest summary info:
|
/test connector=connectors/destination-mongodb
Build PassedTest summary info:
|
/test connector=connectors/destination-mongodb-strict-encrypt
Build FailedTest summary info:
|
/test connector=connectors/destination-mongodb-strict-encrypt
Build PassedTest summary info:
|
/publish connector=connectors/destination-mongodb run-tests=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
/publish connector=connectors/destination-mongodb-strict-encrypt run-tests=false auto-bump-version=false
if you have connectors that successfully published but failed definition generation, follow step 4 here |
…8892) * Adds TLS check to mongodb destination and migrates util constants * Migrates MongodbSourceUitls to general purprose Utils file * Updates expected_spec.json to include SSH tunnel * Bumps connector version and removes connector from being hidden in UI * auto-bump connector version Co-authored-by: Octavia Squidington III <[email protected]>
What
Closes #16279
How
Follows https://github.com/airbytehq/airbyte/pull/17590/files which adds the ability to check for Mongodb
STANDALONE
instances of MongoDB and reaffirm that the connection whentls
flag is present is marked astrue
Migrates some of the shared constants into an already pre-existing MongoUtils file
Recommended reading order
MongodbDestinationStrictEncrypt.java
MongoUtils.java
MongodbDestinationStrictEncryptAcceptanceTest.java
MongodbDestination.java
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Yes, customers who have the
tls
flag disabled or set to false will experience breaking changes when running theircheck
method. This is expected and within reason as the user should not be able to set their connection to insecure traffic within Airbyte CloudPre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.