Skip to content
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

add CI #60

Merged
merged 34 commits into from
Dec 17, 2020
Merged

add CI #60

merged 34 commits into from
Dec 17, 2020

Conversation

dataders
Copy link
Collaborator

@dataders dataders commented Nov 19, 2020

@dataders
Copy link
Collaborator Author

finally got CircleCI up and running, but one test out of 8 is failing...

=================================== FAILURES ===================================
________________ usecase: test_dbt_snapshot_strategy_check_cols ________________
Unknown error: expected cc_all_snapshot to have 30 rows, but it has 20
assert Decimal('20') == 30
  +Decimal('20')
  -30 in test index 12 (item_type=relation_rows)
----------------------------- Captured stdout call 

@mikaelene
Copy link
Collaborator

Does this work for SQL Server?

@mikaelene
Copy link
Collaborator

finally got CircleCI up and running, but one test out of 8 is failing...

=================================== FAILURES ===================================
________________ usecase: test_dbt_snapshot_strategy_check_cols ________________
Unknown error: expected cc_all_snapshot to have 30 rows, but it has 20
assert Decimal('20') == 30
  +Decimal('20')
  -30 in test index 12 (item_type=relation_rows)
----------------------------- Captured stdout call 

This is also the only test that is run. The other are commented out?

@dataders
Copy link
Collaborator Author

This is also the only test that is run. The other are commented out?

Whoops. I was running just the failing test in order to better document #61. running again now. Can you see the current CI run?

@dataders
Copy link
Collaborator Author

dataders commented Nov 20, 2020

CI is passing the 6/8 integration tests in scope for this PR. The other two tests are related to #61 and #26
image

@mikaelene mikaelene changed the base branch from master to add-CI November 20, 2020 07:14
@mikaelene
Copy link
Collaborator

I'll merge this in an other branch and test it out :-)

@mikaelene
Copy link
Collaborator

I managed to confuse myself with the git branch, commit etc... Why is it so hard to learn and remember all that stuff? I love git but I also hate it :-)

@dataders dataders changed the base branch from add-CI to master November 24, 2020 05:32
Comment on lines +173 to +179
# still confused whether to use "Yes", "yes", "True", or "true"
# to learn more visit
# https://docs.microsoft.com/en-us/sql/relational-databases/native-client/features/using-encryption-without-validation?view=sql-server-ver15
if getattr(credentials, "encrypt", False) is True:
con_str.append(f"Encrypt=Yes")
if getattr(credentials, "trust_cert", False) is True:
con_str.append(f"TrustServerCertificate=Yes")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mikaelene, I think @NandanHegde15 and I figured it out.
not getattr(credentials, "encrypt", False) currently evaluates to False no matter what string was passed to the encrypt param in the profiles.yml. Because any string evaluates to True.

Our fix was to make encrypt and trust_cert both boolean values. it should now work for you if you don't specify these in your profile.

#this prints
if "no!":
 print("foobar")

@dataders
Copy link
Collaborator Author

@mikaelene I think we fixed the scenario in which a user doesn't specify Encrypt or TrustServerCertificate.
https://app.circleci.com/pipelines/github/dbt-msft/dbt-synapse/94/workflows/0344d82c-99c0-46bd-8b6c-1f7939fdda38/jobs/101/steps
image

Comment on lines +35 to +43
### Security
Encryption is not enabled by default, unless you specify it.

To enable encryption, add the following to your target definition. This is the default encryption strategy recommended by MSFT. For more information see [this docs page](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax#using-trustservercertificate?WT.mc_id=DP-MVP-5003930)
```yaml
encrypt: true # adds "Encrypt=Yes" to connection string
trust_cert: false
```
For a fully-secure, encrypted connection, you must enable `trust_cert: false` because `"TrustServerCertificate=Yes"` is default for `dbt-sqlserver` in order to not break already defined targets.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@NandanHegde15 what do you think of this explanation?

@dataders dataders mentioned this pull request Nov 25, 2020
@mikaelene mikaelene merged commit 85f28e9 into dbt-msft:master Dec 17, 2020
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