Repository navigation
MS SQL Server Destination implementation - #3195
Conversation
Sherif A. Nada (sherifnada)
left a comment
There was a problem hiding this comment.
LGTM but requesting changes to confirm we're not forgetting a required param
| config.get("username").asText(), | ||
| config.get("password").asText())); | ||
|
|
||
| if (config.has("ssl") && config.get("ssl").asBoolean()) { |
There was a problem hiding this comment.
ssl on v1, nice!
There was a problem hiding this comment.
the SSL stuff is great. I think we need at least one test to check it. There are 2 options here:
- just right a one off unit test that runs check connection with SSL turned on and sanity check that it works.
- add a test in TestDestination that only runs if the destination is configurable with SSL. it would similarly probably just run check connection.
i don't have a really strong preference either way. 1 is probably easier 🤷♀️
M. Marx (marcosmarxm)
left a comment
There was a problem hiding this comment.
I was very curious about the implementation of a target, so I was super 🕵️ leave some comments in general LGTM
Charles (cgardens)
left a comment
There was a problem hiding this comment.
one question about why database is being removed from the implementation. after that's resolved i think this is good to go! nice work.
Sherif A. Nada (sherifnada)
left a comment
There was a problem hiding this comment.
I believe we're using params not declared in spec.json so double checking on this.
| additionalParameters.add("ssl=true"); | ||
| additionalParameters.add("sslmode=require"); | ||
| additionalParameters.add("encrypt=true"); | ||
| if (config.has("trustServerCertificate") && config.get("trustServerCertificate").asBoolean()) { |
There was a problem hiding this comment.
where would these params come from? I don't see this in spec.json
There was a problem hiding this comment.
This has been added to spec.json
| additionalParameters.add("trustServerCertificate=true"); | ||
| } else { | ||
| additionalParameters.add("trustServerCertificate=false"); | ||
| additionalParameters.add("trustStore=" + config.get("trustStoreName").asText()); |
There was a problem hiding this comment.
this is not declared in spec.json
There was a problem hiding this comment.
This has now been added to spec.json.
|
/test connector=destination-mssql
|
Charles (cgardens)
left a comment
There was a problem hiding this comment.
nice! a few more comments (each is described in more detail in line):
- SSL needs to be in the spec.
- SSL needs a test
- we shouldn't need to implement
getDatabase
| if (config.has("trustServerCertificate") && config.get("trustServerCertificate").asBoolean()) { | ||
| additionalParameters.add("trustServerCertificate=true"); | ||
| } else { | ||
| additionalParameters.add("trustServerCertificate=false"); |
There was a problem hiding this comment.
how is this getting set? it seems like you want to add some fields for users to optionally configure. if so you need to add them in the spec.json. ping me if the relationship between the 2 isn't clear and i can walk through it!
There was a problem hiding this comment.
This has now been added to spec.json.
| config.get("username").asText(), | ||
| config.get("password").asText())); | ||
|
|
||
| if (config.has("ssl") && config.get("ssl").asBoolean()) { |
There was a problem hiding this comment.
the SSL stuff is great. I think we need at least one test to check it. There are 2 options here:
- just right a one off unit test that runs check connection with SSL turned on and sanity check that it works.
- add a test in TestDestination that only runs if the destination is configurable with SSL. it would similarly probably just run check connection.
i don't have a really strong preference either way. 1 is probably easier 🤷♀️
Charles (cgardens)
left a comment
There was a problem hiding this comment.
Great! 3 other things you need to do in order to get this ready (other than what is mentioned in the comments below:
- Please make sure you add a documentation page. You can use the postgres one as an example.
- Add this destination to https://github.com/airbytehq/airbyte/blob/master/airbyte-config/init/src/main/resources/seed/destination_definitions.yaml so that this new destination will appear in the UI by default.
- Actually run a sync in the UI manually with this destination to sanity check that the E2E experience is good!
| import org.testcontainers.containers.MSSQLServerContainer; | ||
| import org.testcontainers.utility.DockerImageName; | ||
|
|
||
| public class MSSQLIntegrationTestSSL extends TestDestination { |
There was a problem hiding this comment.
can you create an issue that we should figure out a way to consolidate SSL tests for destinations, so that we don't have top copy and paste test classes like this. definitely don't think we need to worry about doing this right now, but i want us to keep track of it.
| "ssl": { | ||
| "title": "SSL Connection", | ||
| "description": "Encrypt data using SSL.", | ||
| "type": "boolean", | ||
| "default": false, | ||
| "order": 6 | ||
| }, | ||
| "trustServerCertificate": { | ||
| "title": "Trust Server Certificate", | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Whether or not to implicitly trust the server certificate without verification. (Useful for local test databases.)", | ||
| "examples": [true, false], | ||
| "order": 7 | ||
| }, | ||
| "trustStoreName": { | ||
| "title": "Trust Store Name", | ||
| "type": "string", | ||
| "description": "The full path (including filename) to the certificate trustStore file, which contains the list of certificates that the client trusts.", | ||
| "order": 8 | ||
| }, | ||
| "trustStorePassword": { | ||
| "title": "Trust Store Password", | ||
| "type": "string", | ||
| "description": "The password used to check the integrity of the trustStore data.", | ||
| "order": 9 | ||
| }, | ||
| "hostNameInCertificate": { | ||
| "title": "Host Name In Certificate", | ||
| "type": "string", | ||
| "description": "Specifies the host name of the server. The value of this property must match the subject property of the certificate.", | ||
| "order": 10 | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This seems like it should be a oneOf for clarity. I would suggest replacing this configuration with something that looks like this:
"ssl_method": {
"title": "SSL Method",
"type": "object",
"description": "Encryption method to use when communicating with the database",
"order": 6,
"oneOf": [
{
"title": "Unencrypted",
"additionalProperties": false,
"description": "Data transfer will not be encrypted.",
"required": ["ssl_method"],
"properties": {
"ssl_method": {
"type": "string",
"enum": ["unencrypted"],
"default": "unencrypted"
}
}
},
{
"title": "Encrypted (trust server certificate)",
"additionalProperties": false,
"description": "Use the cert provided by the server.",
"required": ["ssl_method"],
"properties": {
"ssl_method": {
"type": "string",
"enum": ["encrypted_trust_server_certificate"],
"default": "encrypted_trust_server_certificate"
}
}
},
{
"title": "Encrypted (verify certificate)",
"additionalProperties": false,
"description": "Data transfer will not be encrypted.",
"required": ["ssl_method", "trustStoreName", "trustStorePassword"],
"properties": {
"ssl_method": {
"type": "string",
"enum": ["encrypted_verify_certificate"],
"default": "encrypted_verify_certificate"
},
"trustStoreName": {
"title": "Trust Store Name",
"type": "string",
"description": "The full path (including filename) to the certificate trustStore file, which contains the list of certificates that the client trusts.",
"order": 8
},
"trustStorePassword": {
"title": "Trust Store Password",
"type": "string",
"description": "The password used to check the integrity of the trustStore data.",
"order": 9
},
"hostNameInCertificate": {
"title": "Host Name In Certificate",
"type": "string",
"description": "Specifies the host name of the server. The value of this property must match the subject property of the certificate.",
"order": 10
}
}
}
]
}
This displays in the UI as follows:
What do you think? If you adopt this configuration, you'll have to adjust how the config is parsed in the MSSQLDestination and the config that gets passed in the test suites.
Sherif A. Nada (sherifnada)
left a comment
There was a problem hiding this comment.
LGTM with requested changes from charles
Co-authored-by: Charles <giardina.charles@gmail.com>
Adding the destination to the list Reworking SSL configuration to move internal information out of config
Charles (cgardens)
left a comment
There was a problem hiding this comment.
Looks good. I think you're ready to ship it.
To deploy this you need to add this command as a comment in this PR:
/publish connector=connectors/source-mssql
You can see an example of this here. That will publish your docker container to docker hub. Once that succeeds, re-run the build in the PR. That should get you past the current build failure (which is just checking that the connector is published).
|
/publish connector=connectors/destination-mssql
|
After addressing the requested changes, GitHub is glitching, saying there are changes to address. Dismissing the review to get it to go away.



No description provided.