Commit 80c3675d authored by Israel Weeks's avatar Israel Weeks 💬

Merge branch 'master' into 1679-move-cancelled_zuora_subscription-snippet-into-dbt

parents 7c08f8e6 8aec4f6d
......@@ -155,7 +155,9 @@ python_pytest:
- dbt docs generate --profiles-dir profile --target docs
- mkdir -p $CI_PROJECT_DIR/public/dbt/snowflake
- cd target
- cp *.json *.html graph.gpickle $CI_PROJECT_DIR/public/dbt/snowflake/
- cp *.json graph.gpickle $CI_PROJECT_DIR/public/dbt/snowflake/
- cd $CI_PROJECT_DIR/transform/snowflake-dbt/docs/
- cp index.html gitlab.css $CI_PROJECT_DIR/public/dbt/snowflake/
tags:
- analytics
artifacts:
......
<!---
This template is for requesting additional data from BambooHR.
--->
### New fields requested
* List
### Rationale
* List
### Approval
- [ ] Data Team Manager
- [ ] PeopleOps Representative
\ No newline at end of file
......@@ -161,7 +161,7 @@ Snowflake SQL is probably not that different from the dialects of SQL you're alr
## GitLab.com aka "Dot Com" (Product)
This data comes from our GitLab.com SaaS product.
- [ ] Become familiar with the [API docs](https://gitlab.com/gitlab-org/gitlab-ee/tree/master/doc/api).
- [ ] Become familiar with the [API docs](https://gitlab.com/gitlab-org/gitlab/tree/master/doc/api).
## Marketo
- [ ] [Coming soon]
......@@ -176,7 +176,7 @@ This data comes from the usage ping that comes with a GitLab installation.
- [ ] Read about the [usage ping](https://docs.gitlab.com/ee/user/admin_area/settings/usage_statistics.html).
- [ ] To understand how this is implemented at GitLab read [Feature Implementation](https://about.gitlab.com/handbook/product/feature-instrumentation/#instrumentation-for-gitlabcom).
- [ ] Read the product vision for [telemetry](https://about.gitlab.com/direction/fulfillment/telemetry/).
- [ ] There is not great documentation on the usage ping, but you can get a sense from looking at the `usage.rb` file for [GitLab CE](https://gitlab.com/gitlab-org/gitlab-ee/blob/master/lib/gitlab/usage_data.rb).
- [ ] There is not great documentation on the usage ping, but you can get a sense from looking at the `usage.rb` file for [GitLab CE](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/usage_data.rb).
- [ ] It might be helpful to look at issues related to the usage pings (telemetry) [here](https://gitlab.com/gitlab-org/telemetry/issues) and [here](https://gitlab.com/groups/gitlab-org/-/issues?scope=all&utf8=✓&state=all&search=~telemetry).
- [ ] Watch the [pings brain dump session](https://drive.google.com/file/d/1S8lNyMdC3oXfCdWhY69Lx-tUVdL9SPFe/view).
......
......@@ -25,8 +25,8 @@ tables:
, updated_at
, branch
FROM spec_profiling_results
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{HOURS} hour'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{HOURS} hours'
AND '{EXECUTION_DATE}'::timestamp
export_schema: 'ci_stats'
export_table: 'spec_profiling_results'
export_table_primary_key: id
......@@ -29,8 +29,8 @@ tables:
, confirmed_at
, confirmation_sent_at
FROM customers
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'customers'
export_table: 'customers'
......@@ -54,8 +54,8 @@ tables:
, trial
, last_extra_ci_minutes_sync_at
FROM orders
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'customers'
export_table: 'orders'
......
......@@ -14,8 +14,8 @@ tables:
, created_at
, updated_at
FROM add_ons
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'license'
export_table: 'add_ons'
......@@ -30,8 +30,8 @@ tables:
, created_at
, updated_at
FROM granted_add_ons
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'license'
export_table: 'granted_add_ons'
......@@ -57,8 +57,8 @@ tables:
created_at,
updated_at
FROM licenses
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'license'
export_table: 'licenses'
......@@ -74,8 +74,8 @@ tables:
updated_at,
recurly_name
FROM plans
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'license'
export_table: 'plans'
......@@ -98,8 +98,8 @@ tables:
provider,
uid
FROM users
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'license'
export_table: 'users'
......
......@@ -57,8 +57,8 @@ tables:
, gitaly_version
, gitaly_servers
FROM usage_data
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'usage_data'
......@@ -102,8 +102,8 @@ tables:
percentage_projects_prometheus_active,
percentage_service_desk_issues
FROM conversational_development_indices
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'conversational_development_indices'
......@@ -119,8 +119,8 @@ tables:
created_at,
updated_at
FROM fortune_companies
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'fortune_companies'
......@@ -137,8 +137,8 @@ tables:
fortune_rank,
in_salesforce
FROM hosts
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'hosts'
......@@ -160,8 +160,8 @@ tables:
last_ping_received_at,
version
FROM licenses
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'licenses'
......@@ -193,8 +193,8 @@ tables:
provider,
uid
FROM users
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'users'
......@@ -211,8 +211,8 @@ tables:
referer_url,
host_id
FROM version_checks
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'version_checks'
......@@ -227,8 +227,8 @@ tables:
created_at,
updated_at
FROM versions
WHERE updated_at BETWEEN TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00') - interval '{DAYS} day'
AND TO_TIMESTAMP('{EXECUTION_DATE}', 'YYYY-MM-DDTHH:MI:SS+00:00')
WHERE updated_at BETWEEN '{EXECUTION_DATE}'::timestamp - interval '{DAYS} day'
AND '{EXECUTION_DATE}'::timestamp
export_db: EXPORT_DB
export_schema: 'version'
export_table: 'versions'
......
project_path,project_id
gitlab-org/gitlab-ce,13083
gitlab-org/gitlab-ee,278964
gitlab-org/gitlab-foss,13083
gitlab-org/gitlab,278964
gitlab-org/gitlab-runner,250833
gitlab-org/gitlab-ui,7071551
gitlab-org/gitlab-pages,734943
......
......@@ -116,15 +116,6 @@ models:
gitlab_dotcom:
tags: ["product"]
enabled: true
base:
gitlab_dotcom_project_features:
enabled: false
gitlab_dotcom_project_group_links:
enabled: false
gitlab_dotcom_project_mirror_data:
enabled: false
gitlab_dotcom_subscriptions:
enabled: false
xf:
materialized: table
......
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap');
.logo {
background-image: url(https://about.gitlab.com/images/press/logo/svg/gitlab-logo-gray-rgb.svg);
background-repeat: no-repeat;
background-color: transparent;
}
img.logo {
display: none ;
}
body {
font-family: 'Source Sans Pro' !important;
font-size: 17px;
}
h1, h2, h3, h4, h5, h6, {
font-family: 'Source Sans Pro';
font-weight: bold;
}
p {
font-family: 'Source Sans Pro';
font-size: 16px;
}
.btn-info {
background-color: #6666c4 !important;
}
.form-control:focus {
box-shadow: 0 0 0 2px #6666c4, 0 15px 15px -7.5px rgba(0,0,0,0.15) !important;
}
.a {
color: #6666c4 !important;
}
.app-content p {
color: #1f1f1f;
}
.app-content a {
color: #6666c4 !important;
}
.menu a.menu-node.active:not(.not-active) {
color: #6666c4 !important;
}
.menu a {
color: #1f1f1f !important;
}
.tooltip {
background-color: #6666c4 !important;
}
.launcher-window {
background-color: #0f4d66 !important;
}
.bg-navy {
background-color: #0f4d66 !important;
}
.text-navy-lightest {
color: #367cc2 !important;
}
\ No newline at end of file
This diff is collapsed.
......@@ -55,7 +55,7 @@ models:
tests:
- not_null
- name: main_edition
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab-ee/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
tests:
- accepted_values:
values: ['EE', 'CE']
......@@ -67,14 +67,14 @@ models:
tests:
- not_null
- name: main_edition
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab-ee/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
tests:
- accepted_values:
values: ['EE', 'CE']
- name: pings_usage_data_unpacked
columns:
- name: main_edition
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab-ee/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
description: Comes from [this section of the code](https://gitlab.com/gitlab-org/gitlab/blob/2dae25c3b780205f072833cd290e481dae436f3b/lib/gitlab/usage_data.rb#L154)
tests:
- accepted_values:
values: ['EE', 'CE']
......
......@@ -60,6 +60,15 @@ models:
tests:
- not_null
- unique
- name: zuora_refund
description: Base model for Zuora Refunds
columns:
- name: account_id
tests:
- not_null
- name: refund_date
tests:
- not_null
- name: zuora_subscription
description: '{{ doc("zuora_subscription") }}'
columns:
......
......@@ -15,7 +15,7 @@ sources:
freshness:
warn_after: {count: 8, period: hour}
tables:
tables:
- name: account
description: '{{ doc("zuora_account_source") }}'
- name: contact
......@@ -28,6 +28,7 @@ sources:
description: '{{ doc("zuora_rateplan_charge_source") }}'
- name: rateplan
description: '{{ doc("zuora_rateplan_source") }}'
- name: refund
description: '{{ doc("zuora_refund_source") }}'
- name: subscription
description: '{{ doc("zuora_subscription_source") }}'
......@@ -50,10 +50,15 @@ This is the source table for Zuora Rate Plan Charges. [Link to Documentation](ht
{% enddocs %}
{% docs zuora_refund_source %}
This is the source table for Zuora Refunds. [Link to Documentation](https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Refund)
{% enddocs %}
{% docs zuora_subscription_source %}
The subscription source table contains info about your products and/or services with recurring charges.
[Link to Documentation](https://www.stitchdata.com/docs/integrations/saas/zuora#subscription)
{% enddocs %}
\ No newline at end of file
{% enddocs %}
{{config({
"schema": "staging"
})
}}
WITH source AS (
SELECT *
FROM {{ source('zuora', 'refund') }}
), renamed AS (
SELECT accountid AS account_id,
accountingcode AS accounting_code,
amount,
billtocontactid AS bill_to_contact_id,
cancelledon AS cancelled_on,
comment,
createdbyid AS created_by_id,
createddate AS created_date,
defaultpaymentmethodid AS default_payment_method_id,
deleted AS is_deleted,
gateway,
gatewayresponse AS gateway_response,
gatewayresponsecode AS gateway_response_code,
gatewaystate AS gateway_state,
id AS refund_id,
methodtype AS method_type,
parentaccountid AS parent_account_id,
paymentmethodid AS payment_method_id,
paymentmethodsnapshotid AS payment_method_snapshot_id,
reasoncode AS reason_code,
referenceid AS reference_id,
refunddate AS refund_date,
refundnumber AS refund_number,
refundtransactiontime AS refund_transaction_time,
secondrefundreferenceid AS second_refund_reference_id,
softdescriptor AS soft_descriptor,
softdescriptorphone AS soft_descriptor_phone,
soldtocontactid AS sold_to_contact_id,
sourcetype AS source_type,
status AS refund_status,
submittedon AS submitted_on,
transferredtoaccounting AS transferred_to_accounting,
type AS refund_type,
updatedbyid AS updated_by_id,
updateddate AS updated_date
FROM source
)
SELECT *
FROM renamed
......@@ -260,3 +260,9 @@ models:
- name: cohort_year
tests:
- not_null
- name: zuora_refund_xf
description: Zuora Refunds
columns:
- name: refund_month
tests:
- not_null
WITH zuora_refund_base AS (
SELECT *
FROM {{ref('zuora_refund')}}
), zuora_account AS (
SELECT * FROM {{ref('zuora_account')}}
)
SELECT zuora_account.sfdc_entity,
zuora_account.account_name,
zuora_account.account_number,
zuora_account.currency,
date_trunc('month',refund_date)::DATE AS refund_month,
amount AS refund_amount,
comment,
reason_code,
is_deleted,
zuora_refund_base.refund_status
FROM zuora_refund_base
LEFT JOIN zuora_account
ON zuora_refund_base.account_id = zuora_account.account_id
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment