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

Feature/sunset full statement version #109

Merged
merged 13 commits into from
Jul 9, 2024
Merged
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🐞 Bug
description: Report a bug or an issue you've found within the dbt package
name: 🐞 Bug (non-SQL-translation issues only)
description: Report a bug or an issue you've found within the dbt package. For SQL translation issues, please contact Fivetran Support.
title: "[Bug] <title>"
labels: ["bug", "triage"]
body:
Expand Down
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
contact_links:
- name: Ask a question during our office hours
url: https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours
about: Schedule time during the external office hours block with the Fivetran Analytics Engineering team for support
- name: SQL Translation Issues
about: This dbt package only materializes the sql code provided in the `fivetran_formula_model` table and has no control over the translations themselves. For translation issues, please contact Fivetran Support.
url: https://support.fivetran.com/hc/
- name: Provide feedback or request a new package to our dbt package team
url: https://www.surveymonkey.com/r/DQ7K7WW
about: Fill out our survey form to provide valuable feedback to the Fivetran team developing and maintaining the dbt packages.
- name: Fivetran connector question
url: https://support.fivetran.com/hc
about: Have a question about your connector? Check out the Fivetran support portal for more details.
Expand Down
43 changes: 11 additions & 32 deletions .github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,27 @@
**This PR will result in the following new package version:**
<!--- Please add details around your decision for breaking vs non-breaking version upgrade. If this is a breaking change, were backwards-compatible options explored? -->

**Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:**
**Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:**
<!--- Copy/paste the CHANGELOG for this version below. -->

## PR Checklist
### Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
- [ ] dbt compile
- [ ] dbt run –full-refresh
- [ ] dbt run
- [ ] dbt test
- [ ] dbt run –vars (if applicable)
- [ ] dbt run –full-refresh && dbt test
- [ ] dbt run (if incremental models are present) && dbt test

Before marking this PR as "ready for review" the following have been applied:
- [ ] The appropriate issue has been linked and tagged
- [ ] You are assigned to the corresponding issue and this PR
- [ ] The appropriate issue has been linked, tagged, and properly assigned
- [ ] All necessary documentation and version upgrades have been applied
<!--- Be sure to update the package version in the dbt_project.yml, integration_tests/dbt_project.yml, and README if necessary. -->
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)
- [ ] BuildKite integration tests are passing
- [ ] Detailed validation steps have been provided below

### Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
- [ ] You have validated these changes and assure this PR will address the respective Issue/Feature.
- [ ] You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
- [ ] You have provided details below around the validation steps performed to gain confidence in these changes.
Please share any and all of your validation steps:
<!--- Provide the steps you took to validate your changes below. -->

### Standard Updates
Please acknowledge that your PR contains the following standard updates:
- Package versioning has been appropriately indexed in the following locations:
- [ ] indexed within dbt_project.yml
- [ ] indexed within integration_tests/dbt_project.yml
- [ ] CHANGELOG has individual entries for each respective change in this PR
<!--- If there is a parallel upstream change, remember to reference the corresponding CHANGELOG as an individual entry. -->
- [ ] README updates have been applied (if applicable)
<!--- Remember to check the following README locations for common updates. →
<!--- Suggested install range (needed for breaking changes) →
<!--- Dependency matrix is appropriately updated (if applicable) →
<!--- New variable documentation (if applicable) -->
- [ ] DECISIONLOG updates have been updated (if applicable)
- [ ] Appropriate yml documentation has been added (if applicable)

### dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)

### If you had to summarize this PR in an emoji, which would it be?
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:
:dancer:
13 changes: 13 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'auto release'
on:
pull_request:
types:
- closed
branches:
- main

jobs:
call-workflow-passing-data:
if: github.event.pull_request.merged
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
secrets: inherit
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt_salesforce_formula_utils v0.10.0
[PR #109](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/109) includes the following updates:

## 🚨 Breaking Changes 🚨
- As announced in the [v0.9.2 August 2023 release](https://github.com/fivetran/dbt_salesforce_formula_utils/releases/tag/v0.9.2), the parameter `full_statement_version=false` has now been fully sunset from the `sfdc_formula_view` macro. You will now need to remove this parameter to avoid a compilation error.

## Under the hood
- Included auto-releaser GitHub Actions workflow to automate future releases.
- Updated maintainer pull request template.

# dbt_salesforce_formula_utils v0.9.3
[PR #101](https://github.com/fivetran/dbt_salesforce_formula_utils/pull/101) includes the following updates:

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ This package includes macros and scipts to be used within a dbt project to accur
To use this dbt package, you must have the following:
- At least one Fivetran Salesforce connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
- **dbt Core**: This package is designed to work with dbt Core and is **not** compatible with dbt Cloud.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The package is technically compatibile with dbt Core. It is only this section that is not. Could we remove this change and instead update this section to callout that it is only compatible with dbt Core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Updated!


## Step 2: Install the package
The [`sfdc_formula_view`](https://github.com/fivetran/dbt_salesforce_formula_utils#sfdc_formula_view-source) macro is intended to be leveraged within a dbt project that uses the source tables from Fivetran's Salesforce connector. To leverage the macro, you will add the below configuration to your `packages.yml` file (if you do not have a `packages.yml` file, create one in your root dbt project).
> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.
```yml
packages:
- package: fivetran/salesforce_formula_utils
version: [">=0.9.0", "<0.10.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=0.10.0", "<0.11.0"] # we recommend using ranges to capture non-breaking changes automatically
```

## Step 3: Define required source tables
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'salesforce_formula_utils'
version: '0.9.3'
version: '0.10.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration_tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
target/
dbt_modules/
logs/
env/
env/
package-lock.yml
5 changes: 4 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: 'salesforce_formula_integration_tests'
version: '0.9.3'
version: '0.10.0'
profile: 'integration_tests'
config-version: 2
vars:
salesforce_formula_integration_tests:
salesforce_schema: salesforce_formula_integrations_tests

models:
+schema: "salesforce_formula_{{ var('directed_schema','dev') }}"

seeds:
salesforce_formula_integration_tests:
+quote_columns: "{{ true if target.type == 'redshift' else false }}"
Expand Down
4 changes: 0 additions & 4 deletions integration_tests/models/account_statement_view.sql

This file was deleted.

2 changes: 1 addition & 1 deletion integration_tests/models/account_view.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{ salesforce_formula_utils.sfdc_formula_view(
source_table = 'account',
full_statement_version = false ) }}
full_statement_version=true) }} --leaving full_statement_version=true in this model to make sure it doesn't error
4 changes: 0 additions & 4 deletions integration_tests/models/opportunity_statement_view.sql

This file was deleted.

3 changes: 1 addition & 2 deletions integration_tests/models/opportunity_view.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{{ salesforce_formula_utils.sfdc_formula_view(
source_table = 'opportunity',
full_statement_version = false) }}
source_table = 'opportunity') }}
4 changes: 0 additions & 4 deletions integration_tests/models/user_role_statement_view.sql

This file was deleted.

3 changes: 1 addition & 2 deletions integration_tests/models/user_role_view.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{{ salesforce_formula_utils.sfdc_formula_view(
source_table = 'user_role',
full_statement_version = false) }}
source_table='user_role') }}
4 changes: 0 additions & 4 deletions integration_tests/models/user_statement_view.sql

This file was deleted.

6 changes: 3 additions & 3 deletions integration_tests/models/user_view.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{ salesforce_formula_utils.sfdc_formula_view(source_table='user',
reserved_table_name='user_table',
full_statement_version = false ) }}
{{ salesforce_formula_utils.sfdc_formula_view(
source_table='user')
}}
4 changes: 1 addition & 3 deletions integration_tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ dbt-bigquery>=1.3.0,<2.0.0
dbt-redshift>=1.3.0,<2.0.0
dbt-postgres>=1.3.0,<2.0.0
dbt-spark>=1.3.0,<2.0.0
dbt-spark[PyHive]>=1.3.0,<1.8.0
dbt-spark[PyHive]>=1.3.0,<2.0.0
dbt-databricks>=1.3.0,<2.0.0

oscrypto @ git+https://github.com/wbond/oscrypto.git@d5f3437
32 changes: 32 additions & 0 deletions integration_tests/tests/consistency/consistency_account_view.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}

-- this test is to make sure the rows counts are the same between versions
with prod as (
select *
from {{ target.schema }}_salesforce_formula_prod.account_view
),

dev as (
select *
from {{ target.schema }}_salesforce_formula_dev.account_view
),

final as (
-- test will fail if any rows from prod are not found in dev
(select * from prod
except distinct
select * from dev)

union all -- union since we only care if rows are produced

-- test will fail if any rows from dev are not found in prod
(select * from dev
except distinct
select * from prod)
)

select *
from final
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}

-- this test is to make sure the rows counts are the same between versions
with prod as (
select *
from {{ target.schema }}_salesforce_formula_prod.opportunity_view
),

dev as (
select *
from {{ target.schema }}_salesforce_formula_dev.opportunity_view

),

final as (
-- test will fail if any rows from prod are not found in dev
(select * from prod
except distinct
select * from dev)

union all -- union since we only care if rows are produced

-- test will fail if any rows from dev are not found in prod
(select * from dev
except distinct
select * from prod)
)

select *
from final
32 changes: 32 additions & 0 deletions integration_tests/tests/consistency/consistency_user_role_view.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}

-- this test is to make sure the rows counts are the same between versions
with prod as (
select *
from {{ target.schema }}_salesforce_formula_prod.user_role_view
),

dev as (
select *
from {{ target.schema }}_salesforce_formula_dev.user_role_view
),

final as (
-- test will fail if any rows from prod are not found in dev
(select * from prod
except distinct
select * from dev)

union all -- union since we only care if rows are produced

-- test will fail if any rows from dev are not found in prod
(select * from dev
except distinct
select * from prod)
)

select *
from final
32 changes: 32 additions & 0 deletions integration_tests/tests/consistency/consistency_user_view.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}

-- this test is to make sure the rows counts are the same between versions
with prod as (
select *
from {{ target.schema }}_salesforce_formula_prod.user_view
),

dev as (
select *
from {{ target.schema }}_salesforce_formula_dev.user_view
),

final as (
-- test will fail if any rows from prod are not found in dev
(select * from prod
except distinct
select * from dev)

union all -- union since we only care if rows are produced

-- test will fail if any rows from dev are not found in prod
(select * from dev
except distinct
select * from prod)
)

select *
from final
Loading