From 296427511003c871bf4738ba38c40f115e552d47 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Wed, 11 Sep 2024 14:17:21 -0400 Subject: [PATCH 01/34] add method to sort versions and begin adding to versionBlock component --- website/dbt-versions.js | 14 +++++++++- website/docs/docs/build/cumulative-metrics.md | 13 +++++++++ website/src/components/versionBlock/index.js | 28 ++++++++++++------- website/src/utils/sort-versions.js | 25 +++++++++++++++++ 4 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 website/src/utils/sort-versions.js diff --git a/website/dbt-versions.js b/website/dbt-versions.js index 871c3ce601e..6e9bf2a2b15 100644 --- a/website/dbt-versions.js +++ b/website/dbt-versions.js @@ -14,6 +14,18 @@ * customDisplay for dbt Cloud should be a version ahead of latest dbt Core release (GA or beta). */ exports.versions = [ + { + version: "2.1", + EOLDate: "2026-04-15", + }, + { + version: "1.10.1", + EOLDate: "2026-04-15", + }, + { + version: "1.10", + EOLDate: "2026-04-15", + }, { version: "1.9.1", customDisplay: "Cloud (Versionless)", @@ -30,7 +42,7 @@ exports.versions = [ version: "1.6", EOLDate: "2024-07-31", }, -] +]; /** * Controls doc page visibility in the sidebar based on the current version diff --git a/website/docs/docs/build/cumulative-metrics.md b/website/docs/docs/build/cumulative-metrics.md index 056ff79c6eb..40bc4f8d467 100644 --- a/website/docs/docs/build/cumulative-metrics.md +++ b/website/docs/docs/build/cumulative-metrics.md @@ -6,6 +6,19 @@ sidebar_label: Cumulative tags: [Metrics, Semantic Layer] --- + + ## first version - 1.8 | last version - 1.10 + + + + ## first version - 1.9 + + + + ## first version - 1.10 + + + Cumulative metrics aggregate a measure over a given accumulation window. If no window is specified, the window is considered infinite and accumulates values over all time. You will need to create a [time spine model](/docs/build/metricflow-time-spine) before you add cumulative metrics. Cumulative metrics are useful for calculating things like weekly active users, or month-to-date revenue. The parameters, description, and types for cumulative metrics are: diff --git a/website/src/components/versionBlock/index.js b/website/src/components/versionBlock/index.js index 01d6381c0e1..8332fe68e0f 100644 --- a/website/src/components/versionBlock/index.js +++ b/website/src/components/versionBlock/index.js @@ -1,7 +1,8 @@ import React, { useState, useEffect, useContext } from 'react' import VersionContext from '../../stores/VersionContext'; +import { sortVersions } from '../../utils/sort-versions'; -export default function VersionBlock({ firstVersion = 0, lastVersion = undefined, children }) { +export default function VersionBlock({ firstVersion = "0", lastVersion = undefined, children }) { const { version } = useContext(VersionContext) const [loading, setLoading] = useState(true) @@ -13,23 +14,30 @@ export default function VersionBlock({ firstVersion = 0, lastVersion = undefined // Only check version if current version set if(version) { - const currentVersionVal = parseFloat(version) - const firstVersionVal = parseFloat(firstVersion) + const sortedVersions = sortVersions([version, firstVersion, ...(lastVersion ? [lastVersion] : [])]); + console.log("sortedVersions", sortedVersions); + const currentVersionIndex = sortedVersions?.indexOf(version) + const firstVersionIndex = sortedVersions?.indexOf(firstVersion); + const lastVersionIndex = sortedVersions?.indexOf(lastVersion); + console.log("currentVersionIndex", currentVersionIndex); + console.log("firstVersionIndex", firstVersionIndex); + console.log("lastVersionIndex", lastVersionIndex); {/* * If last version set, check if current version greater than last version * Or if current version less than first version * If either is true, hide block * Else, if current version less than first version, hide block */} - if(lastVersion) { - if((currentVersionVal > parseFloat(lastVersion)) - || (currentVersionVal < firstVersionVal)) - return null + if (lastVersionIndex) { + if ( + currentVersionIndex > lastVersionIndex || + currentVersionIndex < firstVersionIndex + ) + return null; } else { - if(currentVersionVal < firstVersionVal) { - return null + if (currentVersionIndex < firstVersionIndex) { + return null; } - } } diff --git a/website/src/utils/sort-versions.js b/website/src/utils/sort-versions.js new file mode 100644 index 00000000000..b7a97c146f9 --- /dev/null +++ b/website/src/utils/sort-versions.js @@ -0,0 +1,25 @@ +export const sortVersions = (versionsArr) => { + if (!Array?.isArray(versionsArr) || versionsArr?.length <= 0) return null + + console.log("versionsArr", versionsArr); + + const sortedVersions = versionsArr?.sort(function (a, b) { + console.log('a', a) + console.log('b', b) + // Split versions into arrays by decimal + const aSegments = a?.split('.', 2) + const bSegments = b?.split('.', 2) + console.log("aSegments", aSegments) + console.log("bSegments", bSegments) + // Sort by major version + if (aSegments[0] < bSegments[0]) return -1 + if (aSegments[0] > bSegments[0]) return 1 + + // Sort by minor version + return aSegments[1] - bSegments[1] + }); + + console.log('sortedVersions', sortedVersions) + + return sortedVersions +} From 2c6d6522f204c8e04ae5874de7f791c9de3cf2e1 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Wed, 11 Sep 2024 15:47:23 -0400 Subject: [PATCH 02/34] revert changes to cumulative-metrics page --- website/docs/docs/build/cumulative-metrics.md | 13 ------------- website/src/components/versionBlock/index.js | 3 ++- website/src/utils/sort-versions.js | 5 +++++ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/website/docs/docs/build/cumulative-metrics.md b/website/docs/docs/build/cumulative-metrics.md index 40bc4f8d467..056ff79c6eb 100644 --- a/website/docs/docs/build/cumulative-metrics.md +++ b/website/docs/docs/build/cumulative-metrics.md @@ -6,19 +6,6 @@ sidebar_label: Cumulative tags: [Metrics, Semantic Layer] --- - - ## first version - 1.8 | last version - 1.10 - - - - ## first version - 1.9 - - - - ## first version - 1.10 - - - Cumulative metrics aggregate a measure over a given accumulation window. If no window is specified, the window is considered infinite and accumulates values over all time. You will need to create a [time spine model](/docs/build/metricflow-time-spine) before you add cumulative metrics. Cumulative metrics are useful for calculating things like weekly active users, or month-to-date revenue. The parameters, description, and types for cumulative metrics are: diff --git a/website/src/components/versionBlock/index.js b/website/src/components/versionBlock/index.js index 8332fe68e0f..429e6a97448 100644 --- a/website/src/components/versionBlock/index.js +++ b/website/src/components/versionBlock/index.js @@ -28,7 +28,8 @@ export default function VersionBlock({ firstVersion = "0", lastVersion = undefin * If either is true, hide block * Else, if current version less than first version, hide block */} - if (lastVersionIndex) { + if (lastVersionIndex >= 0) { + console.log('last version is set') if ( currentVersionIndex > lastVersionIndex || currentVersionIndex < firstVersionIndex diff --git a/website/src/utils/sort-versions.js b/website/src/utils/sort-versions.js index b7a97c146f9..57a7ca0d0b9 100644 --- a/website/src/utils/sort-versions.js +++ b/website/src/utils/sort-versions.js @@ -1,3 +1,5 @@ +// Sorts versions from earliest to latest and returns array + export const sortVersions = (versionsArr) => { if (!Array?.isArray(versionsArr) || versionsArr?.length <= 0) return null @@ -6,11 +8,14 @@ export const sortVersions = (versionsArr) => { const sortedVersions = versionsArr?.sort(function (a, b) { console.log('a', a) console.log('b', b) + // Split versions into arrays by decimal const aSegments = a?.split('.', 2) const bSegments = b?.split('.', 2) + console.log("aSegments", aSegments) console.log("bSegments", bSegments) + // Sort by major version if (aSegments[0] < bSegments[0]) return -1 if (aSegments[0] > bSegments[0]) return 1 From 779b415857179a42141edaf0269a1ece8e24d5d0 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Wed, 11 Sep 2024 17:04:43 -0400 Subject: [PATCH 03/34] sortVersions method working --- website/docs/docs/version-testing.md | 16 +++++ website/src/components/versionBlock/index.js | 69 ++++++++++++-------- website/src/utils/sort-versions.js | 68 +++++++++++++++---- 3 files changed, 114 insertions(+), 39 deletions(-) create mode 100644 website/docs/docs/version-testing.md diff --git a/website/docs/docs/version-testing.md b/website/docs/docs/version-testing.md new file mode 100644 index 00000000000..740a1e2edac --- /dev/null +++ b/website/docs/docs/version-testing.md @@ -0,0 +1,16 @@ +--- +title: "Version Testing" +id: "version-testing" +--- + + + + + ## first version - 1.9 + + + diff --git a/website/src/components/versionBlock/index.js b/website/src/components/versionBlock/index.js index 429e6a97448..7b1c7dff519 100644 --- a/website/src/components/versionBlock/index.js +++ b/website/src/components/versionBlock/index.js @@ -13,34 +13,47 @@ export default function VersionBlock({ firstVersion = "0", lastVersion = undefin }, [version]) // Only check version if current version set - if(version) { - const sortedVersions = sortVersions([version, firstVersion, ...(lastVersion ? [lastVersion] : [])]); - console.log("sortedVersions", sortedVersions); - const currentVersionIndex = sortedVersions?.indexOf(version) - const firstVersionIndex = sortedVersions?.indexOf(firstVersion); - const lastVersionIndex = sortedVersions?.indexOf(lastVersion); - console.log("currentVersionIndex", currentVersionIndex); - console.log("firstVersionIndex", firstVersionIndex); - console.log("lastVersionIndex", lastVersionIndex); - {/* - * If last version set, check if current version greater than last version - * Or if current version less than first version - * If either is true, hide block - * Else, if current version less than first version, hide block - */} - if (lastVersionIndex >= 0) { - console.log('last version is set') - if ( - currentVersionIndex > lastVersionIndex || - currentVersionIndex < firstVersionIndex - ) - return null; - } else { - if (currentVersionIndex < firstVersionIndex) { - return null; - } - } - } + sortVersions([ + "1.11", + "1.7", + "2.1", + "1.8", + "1.6", + "2.2.1", + "1.10", + "2.0.1", + "1.9", + "1.9.1", + "1.10.1", + "2.0", + ]); + // if(version) { + // const sortedVersions = sortVersions([version, firstVersion, ...(lastVersion ? [lastVersion] : [])]); + // const currentVersionIndex = sortedVersions?.indexOf(version) + // const firstVersionIndex = sortedVersions?.indexOf(firstVersion); + // const lastVersionIndex = sortedVersions?.indexOf(lastVersion); + // console.log("currentVersionIndex", currentVersionIndex); + // console.log("firstVersionIndex", firstVersionIndex); + // console.log("lastVersionIndex", lastVersionIndex); + // {/* + // * If last version set, check if current version greater than last version + // * Or if current version less than first version + // * If either is true, hide block + // * Else, if current version less than first version, hide block + // */} + // if (lastVersionIndex >= 0) { + // console.log('last version is set') + // if ( + // currentVersionIndex > lastVersionIndex || + // currentVersionIndex < firstVersionIndex + // ) + // return null; + // } else { + // if (currentVersionIndex < firstVersionIndex) { + // return null; + // } + // } + // } return loading ? null diff --git a/website/src/utils/sort-versions.js b/website/src/utils/sort-versions.js index 57a7ca0d0b9..c02f351f348 100644 --- a/website/src/utils/sort-versions.js +++ b/website/src/utils/sort-versions.js @@ -1,4 +1,6 @@ // Sorts versions from earliest to latest and returns array +// For example: 1.7 will sort ahead of 1.8 +// 1.9 will sort ahead of 1.9.1 & 1.10 export const sortVersions = (versionsArr) => { if (!Array?.isArray(versionsArr) || versionsArr?.length <= 0) return null @@ -6,22 +8,66 @@ export const sortVersions = (versionsArr) => { console.log("versionsArr", versionsArr); const sortedVersions = versionsArr?.sort(function (a, b) { - console.log('a', a) - console.log('b', b) - + // When comparing a - b: + // A negative value indicates that a should come before b. + // A positive value indicates that a should come after b. + // Zero or NaN indicates that a and b are considered equal. + + console.log('-------------------') + console.log("a", a); + console.log("b", b); + // Split versions into arrays by decimal - const aSegments = a?.split('.', 2) - const bSegments = b?.split('.', 2) + // split into max 3 length array (major, minor, patch versions) + const aSegments = a?.split(".", 3); + const bSegments = b?.split(".", 3); + + console.log("aSegments", aSegments); + console.log("bSegments", bSegments); - console.log("aSegments", aSegments) - console.log("bSegments", bSegments) + // Store each version part in variable to help readability below + const aMajor = aSegments[0] || "0" + const bMajor = bSegments[0] || "0" + const aMinor = aSegments[1] || "0" + const bMinor = bSegments[1] || "0" + const aPatch = aSegments[2] || "0" + const bPatch = bSegments[2] || "0" // Sort by major version - if (aSegments[0] < bSegments[0]) return -1 - if (aSegments[0] > bSegments[0]) return 1 - + console.log("Major version", aMajor - bMajor); + if (aMajor - bMajor < 0) { + console.log("major version difference, sorting a ahead of b"); + return -1; + } + if (aMajor - bMajor > 0) { + console.log("major version difference, sorting b ahead of a"); + return 1; + } + // Sort by minor version - return aSegments[1] - bSegments[1] + console.log("Minor version", aMinor - bMinor); + if (aMinor - bMinor < 0) { + console.log("minor version difference, sorting a ahead of b"); + return -1; + } + if (aMinor - bMinor > 0) { + console.log("minor version difference, sorting b ahead of a"); + return 1; + } + + // Sort by patch version + console.log("Patch version", aPatch - bPatch); + if (aPatch - bPatch < 0) { + console.log("patch version difference, sorting a ahead of b"); + return -1; + } + if (aPatch - bPatch > 0) { + console.log("patch version difference, sorting b ahead of a"); + return 1; + } + + // If reached, a & b are equal + return 0 }); console.log('sortedVersions', sortedVersions) From bd4419d31bc663c46e0b8c3908cf571624ecbc8c Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 11:18:50 -0400 Subject: [PATCH 04/34] update versionBlock version handling --- website/docs/docs/version-testing.md | 10 +- website/src/components/versionBlock/index.js | 100 ++++++++++--------- website/src/utils/sort-versions.js | 42 ++------ 3 files changed, 63 insertions(+), 89 deletions(-) diff --git a/website/docs/docs/version-testing.md b/website/docs/docs/version-testing.md index 740a1e2edac..0f14044dd98 100644 --- a/website/docs/docs/version-testing.md +++ b/website/docs/docs/version-testing.md @@ -3,14 +3,14 @@ title: "Version Testing" id: "version-testing" --- - - - - ## first version - 1.9 + + diff --git a/website/src/components/versionBlock/index.js b/website/src/components/versionBlock/index.js index 7b1c7dff519..eb951f31144 100644 --- a/website/src/components/versionBlock/index.js +++ b/website/src/components/versionBlock/index.js @@ -3,59 +3,63 @@ import VersionContext from '../../stores/VersionContext'; import { sortVersions } from '../../utils/sort-versions'; export default function VersionBlock({ firstVersion = "0", lastVersion = undefined, children }) { - const { version } = useContext(VersionContext) + const { version } = useContext(VersionContext); - const [loading, setLoading] = useState(true) + const [loading, setLoading] = useState(true); // Hide versionBlock components until version ready useEffect(() => { - version && setLoading(false) - }, [version]) + version && setLoading(false); + }, [version]); + + // Uncomment this to set the sortVersions util function + // sortVersions([ + // "1.11", + // "1.7", + // "2.1", + // "1.8", + // "1.6", + // "2.2.1", + // "1.10", + // "2.0.1", + // "1.9", + // "1.9.1", + // "1.10.1", + // "2.0", + // ]); // Only check version if current version set - sortVersions([ - "1.11", - "1.7", - "2.1", - "1.8", - "1.6", - "2.2.1", - "1.10", - "2.0.1", - "1.9", - "1.9.1", - "1.10.1", - "2.0", - ]); - // if(version) { - // const sortedVersions = sortVersions([version, firstVersion, ...(lastVersion ? [lastVersion] : [])]); - // const currentVersionIndex = sortedVersions?.indexOf(version) - // const firstVersionIndex = sortedVersions?.indexOf(firstVersion); - // const lastVersionIndex = sortedVersions?.indexOf(lastVersion); - // console.log("currentVersionIndex", currentVersionIndex); - // console.log("firstVersionIndex", firstVersionIndex); - // console.log("lastVersionIndex", lastVersionIndex); - // {/* - // * If last version set, check if current version greater than last version - // * Or if current version less than first version - // * If either is true, hide block - // * Else, if current version less than first version, hide block - // */} - // if (lastVersionIndex >= 0) { - // console.log('last version is set') - // if ( - // currentVersionIndex > lastVersionIndex || - // currentVersionIndex < firstVersionIndex - // ) - // return null; - // } else { - // if (currentVersionIndex < firstVersionIndex) { - // return null; - // } - // } - // } + if (version) { + // Get versions sorted from earliest to latest + const sortedVersions = sortVersions([ + version, + firstVersion, + ...(lastVersion ? [lastVersion] : []), + ]); + // Get index of current version, and first/last version props passed into component + const currentVersionIndex = sortedVersions?.indexOf(version); + const firstVersionIndex = sortedVersions?.indexOf(firstVersion); + const lastVersionIndex = sortedVersions?.indexOf(lastVersion); + { + /* + * If last version set, check if current version greater than last version + * Or if current version less than first version + * If either is true, hide block + * Else, if current version less than first version, hide block + */ + } + if (lastVersionIndex >= 0) { + if ( + currentVersionIndex > lastVersionIndex || + currentVersionIndex < firstVersionIndex + ) + return null; + } else { + if (currentVersionIndex < firstVersionIndex) { + return null; + } + } + } - return loading - ? null - : <>{children} + return loading ? null : <>{children}; } diff --git a/website/src/utils/sort-versions.js b/website/src/utils/sort-versions.js index c02f351f348..0fd00676975 100644 --- a/website/src/utils/sort-versions.js +++ b/website/src/utils/sort-versions.js @@ -4,8 +4,6 @@ export const sortVersions = (versionsArr) => { if (!Array?.isArray(versionsArr) || versionsArr?.length <= 0) return null - - console.log("versionsArr", versionsArr); const sortedVersions = versionsArr?.sort(function (a, b) { // When comparing a - b: @@ -13,18 +11,11 @@ export const sortVersions = (versionsArr) => { // A positive value indicates that a should come after b. // Zero or NaN indicates that a and b are considered equal. - console.log('-------------------') - console.log("a", a); - console.log("b", b); - // Split versions into arrays by decimal // split into max 3 length array (major, minor, patch versions) const aSegments = a?.split(".", 3); const bSegments = b?.split(".", 3); - console.log("aSegments", aSegments); - console.log("bSegments", bSegments); - // Store each version part in variable to help readability below const aMajor = aSegments[0] || "0" const bMajor = bSegments[0] || "0" @@ -34,37 +25,16 @@ export const sortVersions = (versionsArr) => { const bPatch = bSegments[2] || "0" // Sort by major version - console.log("Major version", aMajor - bMajor); - if (aMajor - bMajor < 0) { - console.log("major version difference, sorting a ahead of b"); - return -1; - } - if (aMajor - bMajor > 0) { - console.log("major version difference, sorting b ahead of a"); - return 1; - } + if (aMajor - bMajor < 0) { return -1; } + if (aMajor - bMajor > 0) { return 1; } // Sort by minor version - console.log("Minor version", aMinor - bMinor); - if (aMinor - bMinor < 0) { - console.log("minor version difference, sorting a ahead of b"); - return -1; - } - if (aMinor - bMinor > 0) { - console.log("minor version difference, sorting b ahead of a"); - return 1; - } + if (aMinor - bMinor < 0) { return -1; } + if (aMinor - bMinor > 0) { return 1; } // Sort by patch version - console.log("Patch version", aPatch - bPatch); - if (aPatch - bPatch < 0) { - console.log("patch version difference, sorting a ahead of b"); - return -1; - } - if (aPatch - bPatch > 0) { - console.log("patch version difference, sorting b ahead of a"); - return 1; - } + if (aPatch - bPatch < 0) { return -1; } + if (aPatch - bPatch > 0) { return 1; } // If reached, a & b are equal return 0 From 275bd3273e180984cbd636972689ec0de6bf51a6 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 11:38:40 -0400 Subject: [PATCH 05/34] update page-version-check --- website/dbt-versions.js | 4 +-- website/src/utils/page-version-check.js | 40 +++++++++++++++++-------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/website/dbt-versions.js b/website/dbt-versions.js index 6e9bf2a2b15..6217be20922 100644 --- a/website/dbt-versions.js +++ b/website/dbt-versions.js @@ -55,11 +55,11 @@ exports.versions = [ */ exports.versionedPages = [ { - "page": "/reference/resource-configs/target_database", + "page": "reference/resource-configs/target_database", "lastVersion": "1.8", }, { - "page": "/reference/resource-configs/target_schema", + "page": "reference/resource-configs/target_schema", "lastVersion": "1.8", }, { diff --git a/website/src/utils/page-version-check.js b/website/src/utils/page-version-check.js index cc2611929af..e9c4a7bc7da 100644 --- a/website/src/utils/page-version-check.js +++ b/website/src/utils/page-version-check.js @@ -1,3 +1,5 @@ +import { sortVersions } from "./sort-versions"; + export default function pageVersionCheck(version, versionedPages, path) { let pageAvailableObj = { pageAvailable: true @@ -13,27 +15,41 @@ export default function pageVersionCheck(version, versionedPages, path) { const itemFound = versionedPages.find(vpage => vpage.page === updatedPath) if(itemFound) { - - const { firstVersion, lastVersion } = itemFound - const currentVersionVal = parseFloat(version) - const firstVersionVal = parseFloat(firstVersion) || 0 + const { firstVersion, lastVersion } = itemFound; + + // Get versions sorted from earliest to latest + const sortedVersions = sortVersions([ + version, + ...(firstVersion ? [firstVersion] : []), + ...(lastVersion ? [lastVersion] : []), + ]); + + // Get index of current version, and first/last version props passed into component + const currentVersionIndex = sortedVersions?.indexOf(version); + const firstVersionIndex = sortedVersions?.indexOf(firstVersion); + const lastVersionIndex = sortedVersions?.indexOf(lastVersion); + + // const currentVersionVal = parseFloat(version); + // const firstVersionVal = parseFloat(firstVersion) || 0; - pageAvailableObj.firstAvailableVersion = firstVersion + pageAvailableObj.firstAvailableVersion = firstVersion; // Determine if sidebar item within version range - if(lastVersion) { - const lastVersionVal = parseFloat(lastVersion) - // If lastVersion set for sidebar item, + if (lastVersionIndex >= 0) { + // If lastVersion set for sidebar item, // check if current version is higher than lastVersion // or if current version is less than firstVersion // If true, remove item in sidebar - if(currentVersionVal > lastVersionVal || currentVersionVal < firstVersionVal) { - pageAvailableObj.pageAvailable = false + if ( + currentVersionIndex > lastVersionIndex || + currentVersionIndex < firstVersionIndex + ) { + pageAvailableObj.pageAvailable = false; } - } else if(firstVersionVal > currentVersionVal) { + } else if (currentVersionIndex < firstVersionIndex) { // If firstVersion is greater than currentVersion // remove item from sidebar - pageAvailableObj.pageAvailable = false + pageAvailableObj.pageAvailable = false; } } From 8187bd257091284f5e2a0010b0a262a44be780fa Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 11:51:46 -0400 Subject: [PATCH 06/34] create util to handle version check --- website/docs/docs/version-testing.md | 14 ++--- website/src/components/versionBlock/index.js | 52 +++---------------- .../src/utils/available-in-current-version.js | 39 ++++++++++++++ 3 files changed, 52 insertions(+), 53 deletions(-) create mode 100644 website/src/utils/available-in-current-version.js diff --git a/website/docs/docs/version-testing.md b/website/docs/docs/version-testing.md index 0f14044dd98..5ad8fd86292 100644 --- a/website/docs/docs/version-testing.md +++ b/website/docs/docs/version-testing.md @@ -3,14 +3,14 @@ title: "Version Testing" id: "version-testing" --- - - ## first version - 1.8 | last version - 1.10 + + ## first version - 1.6 | last version - 1.9.1 - + + ## first version - 2.1 + - + diff --git a/website/src/components/versionBlock/index.js b/website/src/components/versionBlock/index.js index eb951f31144..f7982d6eacf 100644 --- a/website/src/components/versionBlock/index.js +++ b/website/src/components/versionBlock/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect, useContext } from 'react' import VersionContext from '../../stores/VersionContext'; -import { sortVersions } from '../../utils/sort-versions'; +import { availableInCurrentVersion } from '../../utils/available-in-current-version'; export default function VersionBlock({ firstVersion = "0", lastVersion = undefined, children }) { const { version } = useContext(VersionContext); @@ -12,53 +12,13 @@ export default function VersionBlock({ firstVersion = "0", lastVersion = undefin version && setLoading(false); }, [version]); - // Uncomment this to set the sortVersions util function - // sortVersions([ - // "1.11", - // "1.7", - // "2.1", - // "1.8", - // "1.6", - // "2.2.1", - // "1.10", - // "2.0.1", - // "1.9", - // "1.9.1", - // "1.10.1", - // "2.0", - // ]); - // Only check version if current version set if (version) { - // Get versions sorted from earliest to latest - const sortedVersions = sortVersions([ - version, - firstVersion, - ...(lastVersion ? [lastVersion] : []), - ]); - // Get index of current version, and first/last version props passed into component - const currentVersionIndex = sortedVersions?.indexOf(version); - const firstVersionIndex = sortedVersions?.indexOf(firstVersion); - const lastVersionIndex = sortedVersions?.indexOf(lastVersion); - { - /* - * If last version set, check if current version greater than last version - * Or if current version less than first version - * If either is true, hide block - * Else, if current version less than first version, hide block - */ - } - if (lastVersionIndex >= 0) { - if ( - currentVersionIndex > lastVersionIndex || - currentVersionIndex < firstVersionIndex - ) - return null; - } else { - if (currentVersionIndex < firstVersionIndex) { - return null; - } - } + if (!availableInCurrentVersion( + version, + firstVersion, + lastVersion + )) return null; } return loading ? null : <>{children}; diff --git a/website/src/utils/available-in-current-version.js b/website/src/utils/available-in-current-version.js new file mode 100644 index 00000000000..e7b303e2370 --- /dev/null +++ b/website/src/utils/available-in-current-version.js @@ -0,0 +1,39 @@ +import { sortVersions } from "./sort-versions"; + +export const availableInCurrentVersion = ( + currentVersion, + firstVersion = "0", + lastVersion = undefined +) => { + // Get versions sorted from earliest to latest + const sortedVersions = sortVersions([ + currentVersion, + firstVersion, + ...(lastVersion ? [lastVersion] : []), + ]); + // Get index of current version, and first/last version props passed into component + const currentVersionIndex = sortedVersions?.indexOf(currentVersion); + const firstVersionIndex = sortedVersions?.indexOf(firstVersion); + const lastVersionIndex = sortedVersions?.indexOf(lastVersion); + { + /* + * If last version set, check if current version greater than last version + * Or if current version less than first version + * If either is true, hide block + * Else, if current version less than first version, hide block + */ + } + if (lastVersionIndex >= 0) { + if ( + currentVersionIndex > lastVersionIndex || + currentVersionIndex < firstVersionIndex + ) + return false; + } else { + if (currentVersionIndex < firstVersionIndex) { + return false; + } + } + + return true +} From 232566c247b2d5a046dc87131d2f3a78b7d525b6 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 11:55:46 -0400 Subject: [PATCH 07/34] update page-version-check to use util version check --- website/src/utils/page-version-check.js | 41 +++++-------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/website/src/utils/page-version-check.js b/website/src/utils/page-version-check.js index e9c4a7bc7da..6bb9a81a50a 100644 --- a/website/src/utils/page-version-check.js +++ b/website/src/utils/page-version-check.js @@ -1,4 +1,4 @@ -import { sortVersions } from "./sort-versions"; +import { availableInCurrentVersion } from "./available-in-current-version"; export default function pageVersionCheck(version, versionedPages, path) { let pageAvailableObj = { @@ -17,40 +17,13 @@ export default function pageVersionCheck(version, versionedPages, path) { if(itemFound) { const { firstVersion, lastVersion } = itemFound; - // Get versions sorted from earliest to latest - const sortedVersions = sortVersions([ - version, - ...(firstVersion ? [firstVersion] : []), - ...(lastVersion ? [lastVersion] : []), - ]); - - // Get index of current version, and first/last version props passed into component - const currentVersionIndex = sortedVersions?.indexOf(version); - const firstVersionIndex = sortedVersions?.indexOf(firstVersion); - const lastVersionIndex = sortedVersions?.indexOf(lastVersion); - - // const currentVersionVal = parseFloat(version); - // const firstVersionVal = parseFloat(firstVersion) || 0; + pageAvailableObj.firstAvailableVersion = firstVersion || "0"; - pageAvailableObj.firstAvailableVersion = firstVersion; - - // Determine if sidebar item within version range - if (lastVersionIndex >= 0) { - // If lastVersion set for sidebar item, - // check if current version is higher than lastVersion - // or if current version is less than firstVersion - // If true, remove item in sidebar - if ( - currentVersionIndex > lastVersionIndex || - currentVersionIndex < firstVersionIndex - ) { - pageAvailableObj.pageAvailable = false; - } - } else if (currentVersionIndex < firstVersionIndex) { - // If firstVersion is greater than currentVersion - // remove item from sidebar - pageAvailableObj.pageAvailable = false; - } + pageAvailableObj.pageAvailable = availableInCurrentVersion( + version, + firstVersion, + lastVersion + ); } return pageAvailableObj From 5a4112014795ec2f467021278eef5dcb5a366af4 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 12:02:13 -0400 Subject: [PATCH 08/34] update category-version-check to use version check util --- website/dbt-versions.js | 7 ++++- website/src/utils/category-version-check.js | 33 +++++++-------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/website/dbt-versions.js b/website/dbt-versions.js index 6217be20922..13f76848431 100644 --- a/website/dbt-versions.js +++ b/website/dbt-versions.js @@ -213,5 +213,10 @@ exports.versionedCategories = [ { "category": "Build your metrics", "firstVersion": "1.6", - } + }, + // TODO: Delete demo entry below + { + "category": "Project configs", + "firstVersion": "1.8", + }, ] diff --git a/website/src/utils/category-version-check.js b/website/src/utils/category-version-check.js index bf75853cd8a..f4f263a1115 100644 --- a/website/src/utils/category-version-check.js +++ b/website/src/utils/category-version-check.js @@ -1,3 +1,5 @@ +import { availableInCurrentVersion } from "./available-in-current-version"; + export default function categoryVersionCheck(version, versionedCategories, category) { let categoryAvailableObj = { categoryAvailable: true @@ -7,30 +9,17 @@ export default function categoryVersionCheck(version, versionedCategories, categ return categoryAvailableObj const itemFound = versionedCategories.find(vcategory => vcategory.category === category) - + if (itemFound) { - const { firstVersion, lastVersion } = itemFound - const currentVersionVal = parseFloat(version) - const firstVersionVal = parseFloat(firstVersion) || 0 - - categoryAvailableObj.firstAvailableVersion = firstVersion - - // Determine if category within version range - if (lastVersion) { - const lastVersionVal = parseFloat(lastVersion) - // If lastVersion set for category, - // check if current version is higher than lastVersion - // or if current version is less than firstVersion - // If true, remove category in sidebar - if (currentVersionVal > lastVersionVal || currentVersionVal < firstVersionVal) { - categoryAvailableObj.categoryAvailable = false - } - } else if (firstVersionVal > currentVersionVal) { - // If firstVersion is greater than currentVersion - // remove category from sidebar - categoryAvailableObj.categoryAvailable = false - } + + categoryAvailableObj.firstAvailableVersion = firstVersion || "0"; + + categoryAvailableObj.categoryAvailable = availableInCurrentVersion( + version, + firstVersion, + lastVersion + ); } return categoryAvailableObj From 710cfd810fce3cabe5ea94d5670ea14bd6f3439f Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Thu, 12 Sep 2024 13:27:52 -0400 Subject: [PATCH 09/34] remove custom variable component and variable file --- contributing/single-sourcing-content.md | 88 ------------------------ website/dbt-global-variables.js | 32 --------- website/src/components/variable/index.js | 45 ------------ website/src/theme/MDXComponents/index.js | 2 - 4 files changed, 167 deletions(-) delete mode 100644 website/dbt-global-variables.js delete mode 100644 website/src/components/variable/index.js diff --git a/contributing/single-sourcing-content.md b/contributing/single-sourcing-content.md index 2b8a82dfb81..537980ebdfb 100644 --- a/contributing/single-sourcing-content.md +++ b/contributing/single-sourcing-content.md @@ -132,94 +132,6 @@ $ dbt test --models [...] --defer --state path/to/artifacts ``` -## Using global variables - ---- - -Global variables can be configured for use throughout the docs. - -Using a global variable requires two steps: - -1. Set the variable in the `website/dbt-global-variables.js` file. -2. Use the **Var** component to add the global variable to a page. - -```jsx -// The dbtCore property is the identifier for the variable, -// while the name property is the value shown on the page. - -exports.dbtVariables = { - dbtCore: { - name: "dbt Core" - } -} -``` - -```markdown -// is converted to dbt Core - -You can install on the command line by using one of these recommended methods: -``` - -### Versioning global variables - -It is possible to version global variables as well. This creates the ability to show different variations of a string based off the current version a visitor has selected. - -To extend our `dbt-global-variables.js` file above, we can add a new variable: *note - these versions are not accurate and only shown for this example.* - -```jsx -// A new variable called dbtCloud is added below -// This variable includes a versions array -// "Sinter" will replace "dbt Cloud" for versions 0.21 or lower - -exports.dbtVariables = { - dbtCore: { - name: "dbt Core" - }, - dbtCloud: { - name: "dbt Cloud", - versions: [ - { - "name": "Sinter", - "version": "0.21" - } - ] - } -} -``` - -```markdown -You can get started with by [Signing up](https://www.getdbt.com/signup/). -``` - -In the above example, the **dbtCloud** property has a default name of “dbt Cloud”. The naming for variables cascade down, meaning “dbt Cloud” will show for all versions, until version **0.21** or lower is selected. At that point “Sinter” will replace “dbt Cloud”. - -### Global variables properties - -**name** (required): Expects the identifier for a global variable. - -### Global variables example - -The global `` component can be used inline, for example: - -```markdown -This piece of markdown content explains why is awesome. -``` - -However, a Var component cannot start a new line of content. Fortunately, a workaround exists to use the Var component at the beginning of a line of content. - -To use the component at the beginning of a sentence, add a non-breaking space character before the component: - -```markdown -// When starting a new line with a global variable, -// a non-breaking space is required - -// Works -  is awesome! - -// Does not work - is awesome! -``` - ## Reusing content To reuse content on different pages, you can use some techniques like partial files or snippets. Partial files, a built-in Docusaurus feature, is the recommended method over snippets. diff --git a/website/dbt-global-variables.js b/website/dbt-global-variables.js deleted file mode 100644 index 8ee4499151e..00000000000 --- a/website/dbt-global-variables.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Full Documentation at: - * https://www.notion.so/dbtlabs/Versioning-on-Docusaurus-c6a4a41a66cd4ea2970854cc42cb5b70#1803b9cb666442e5ac8885cf0bba321f - * - */ - -exports.dbtVariables = { - // Example global variable with versioning - // If version 0.21 or lower is selected - // "Old Example String" will replace "Example String" - exampleString: { - name: "Example String", - versions: [ - { - "name": "Old Example String", - "version": "0.21" - } - ] - }, - dbtTheProduct: { - name: "dbt" - }, - dbtCore: { - name: "dbt Core" - }, - dbtCloud: { - name: "dbt Cloud" - }, - dbtIDE: { - name: "dbt Cloud IDE" - }, -} diff --git a/website/src/components/variable/index.js b/website/src/components/variable/index.js deleted file mode 100644 index 444f3203327..00000000000 --- a/website/src/components/variable/index.js +++ /dev/null @@ -1,45 +0,0 @@ -import React, { useState, useEffect, useContext } from 'react' -import { dbtVariables } from '../../../dbt-global-variables'; -import VersionContext from '../../stores/VersionContext'; - -export default function Var({ name }) { - if(!name) - return null - - const [variableName, setVariableName] = useState('') - - const { version } = useContext(VersionContext) - - const currentVariable = dbtVariables[name] - if(!currentVariable) - return null - - useEffect(() => { - if(currentVariable?.versions?.length && version) { - {/* - * If versions set for variable - * show correct variable name for current version - * - * Sort by lowest version first - * If this version is greater or equal to the active version - * Show this variable name - * If no match is found, show original variable name - * - */} - const thisVersionVariable = currentVariable.versions - .sort((item1, item2) => (parseFloat(item1.version) > parseFloat(item2.version)) ? 1 : -1) - .find(varVersion => - parseFloat(varVersion.version) >= parseFloat(version) ? true : false - ) - - !thisVersionVariable - ? setVariableName(currentVariable.name) - : setVariableName(thisVersionVariable.name) - - } else { - setVariableName(currentVariable.name) - } - }, [version]) - - return { variableName } -} diff --git a/website/src/theme/MDXComponents/index.js b/website/src/theme/MDXComponents/index.js index 66ab70a0167..d136222a0ce 100644 --- a/website/src/theme/MDXComponents/index.js +++ b/website/src/theme/MDXComponents/index.js @@ -27,7 +27,6 @@ import Snippet from '@site/src/components/snippet'; import YoutubeVideo from '@site/src/components/youtube'; import WistiaVideo from '@site/src/components/wistia'; import VersionBlock from '@site/src/components/versionBlock'; -import Var from '@site/src/components/variable'; import Term from '@site/src/components/term'; import EventsFeed from '@site/src/components/events'; import { DiscourseFeed, DiscourseHelpFeed } from '@site/src/components/discourse'; @@ -84,7 +83,6 @@ const MDXComponents = { WHCode: WHCode, YoutubeVideo: YoutubeVideo, VersionBlock: VersionBlock, - Var: Var, Term: Term, EventsFeed: EventsFeed, DiscourseFeed: DiscourseFeed, From 433941c9560a445174ae38d8b83c7a87ece1675e Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 13:44:02 +0100 Subject: [PATCH 10/34] update faq --- .../Troubleshooting/access_token_error.md | 21 ------------------- .../Troubleshooting/auth-expired-error.md | 19 +++++++++++++++++ website/vercel.json | 5 +++++ 3 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 website/docs/faqs/Troubleshooting/access_token_error.md create mode 100644 website/docs/faqs/Troubleshooting/auth-expired-error.md diff --git a/website/docs/faqs/Troubleshooting/access_token_error.md b/website/docs/faqs/Troubleshooting/access_token_error.md deleted file mode 100644 index db59d3ba17a..00000000000 --- a/website/docs/faqs/Troubleshooting/access_token_error.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: I'm receiving an `access_token` error when trying to run queries in the IDE. -description: "Reauthenticate warehouse when seeing `access_token` error" -sidebar_label: 'Receiving `access_token` error in the IDE' -id: access_token_error - ---- - -If you're seeing a database error labeled `access_token` when you try to run queries in the IDE, this means your [OAuth](/docs/cloud/manage-access/set-up-snowflake-oauth) connection between Snowflake and dbt Cloud has expired. - -To fix this, you'll need to re-connect the two tools. - -Your Snowflake administrator can [configure](/docs/cloud/manage-access/set-up-snowflake-oauth#create-a-security-integration) the refresh tokens' validity, which has a maximum 90-day validity period. - -To resolve the issue, complete the following steps: - -1. Go to your **Profile settings** page (accessible from the gear icon at the upper right corner of dbt Cloud). -2. Click on the correct warehouse connection under **Credentials**. -3. Click the green **Reconnect Snowflake Account** button in the **Development Credentials** section. This drives you through reauthentication through the SSO flow. - -If you've tried the step above and are still experiencing this behavior, reach out to the Support team at support@getdbt.com for further assistance. diff --git a/website/docs/faqs/Troubleshooting/auth-expired-error.md b/website/docs/faqs/Troubleshooting/auth-expired-error.md new file mode 100644 index 00000000000..510ee8e9bf9 --- /dev/null +++ b/website/docs/faqs/Troubleshooting/auth-expired-error.md @@ -0,0 +1,19 @@ +--- +title: Receiving an `authentication has expired` error when trying to run queries in the IDE. +description: "Reauthenticate warehouse when seeing `authentication has expired` error" +sidebar_label: 'Receiving `authentication has expired` error in the IDE' +--- + +If you see a `authentication has expired` error when you try to run queries in the dbt CLoud IDE, this means your [OAuth](/docs/cloud/manage-access/set-up-snowflake-oauth) connection between Snowflake and dbt Cloud has expired. + +To fix this, you'll need to re-connect the two tools. + +Your Snowflake administrator can [configure](/docs/cloud/manage-access/set-up-snowflake-oauth#create-a-security-integration) the refresh tokens' validity, which has a maximum 90-day validity period. + +To resolve the issue, complete the following steps: + +1. Go to your **Profile settings** page, accessible from the navigation menu. +2. Navigate to **Credentials** and click on the project you're experiencing the issue with. +3. Under **Development credentials**, click the green **Reconnect Snowflake Account** button. This drives you through reauthentication through the SSO workflow. + +If you've tried these step and are still experiencing this behavior, reach out to the Support team at support@getdbt.com for further assistance. diff --git a/website/vercel.json b/website/vercel.json index f79fc959187..defdc449276 100644 --- a/website/vercel.json +++ b/website/vercel.json @@ -2,6 +2,11 @@ "cleanUrls": true, "trailingSlash": false, "redirects": [ + { + "source": "/faqs/Troubleshooting/access_token_error", + "destination": "/faqs/Troubleshooting/auth-expired-error", + "permanent": true + }, { "source": "/faqs/Models/unique-model-names", "destination": "/faqs/Project/unique-resource-names", From c606808f19fdf2a174fb65027997fe5c84bc4d2f Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 12 Sep 2024 14:17:15 +0100 Subject: [PATCH 11/34] update faq --- website/docs/guides/debug-errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/debug-errors.md b/website/docs/guides/debug-errors.md index 58776fa181f..442284fc6ee 100644 --- a/website/docs/guides/debug-errors.md +++ b/website/docs/guides/debug-errors.md @@ -395,7 +395,7 @@ If you just opened a SQL file in the `target/` directory to help debug an issue, Here are some useful FAQs to help you debug your dbt project: - -- +- - - - From b5a8c7d6d6bf19624b8ddbb331b1e2e392b14154 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:54:55 +0100 Subject: [PATCH 12/34] Update website/docs/faqs/Troubleshooting/auth-expired-error.md Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/faqs/Troubleshooting/auth-expired-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/faqs/Troubleshooting/auth-expired-error.md b/website/docs/faqs/Troubleshooting/auth-expired-error.md index 510ee8e9bf9..024fb6baa78 100644 --- a/website/docs/faqs/Troubleshooting/auth-expired-error.md +++ b/website/docs/faqs/Troubleshooting/auth-expired-error.md @@ -6,7 +6,7 @@ sidebar_label: 'Receiving `authentication has expired` error in the IDE' If you see a `authentication has expired` error when you try to run queries in the dbt CLoud IDE, this means your [OAuth](/docs/cloud/manage-access/set-up-snowflake-oauth) connection between Snowflake and dbt Cloud has expired. -To fix this, you'll need to re-connect the two tools. +To fix this, you must reconnect the two tools. Your Snowflake administrator can [configure](/docs/cloud/manage-access/set-up-snowflake-oauth#create-a-security-integration) the refresh tokens' validity, which has a maximum 90-day validity period. From 0e6d7861295cd94805de1bb657c106c19103d97f Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:55:15 +0100 Subject: [PATCH 13/34] Update website/docs/faqs/Troubleshooting/auth-expired-error.md Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/faqs/Troubleshooting/auth-expired-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/faqs/Troubleshooting/auth-expired-error.md b/website/docs/faqs/Troubleshooting/auth-expired-error.md index 024fb6baa78..80f7fe11b77 100644 --- a/website/docs/faqs/Troubleshooting/auth-expired-error.md +++ b/website/docs/faqs/Troubleshooting/auth-expired-error.md @@ -14,6 +14,6 @@ To resolve the issue, complete the following steps: 1. Go to your **Profile settings** page, accessible from the navigation menu. 2. Navigate to **Credentials** and click on the project you're experiencing the issue with. -3. Under **Development credentials**, click the green **Reconnect Snowflake Account** button. This drives you through reauthentication through the SSO workflow. +3. Under **Development credentials**, click the **Reconnect Snowflake Account** (green) button. This steps you through reauthentication using the SSO workflow. If you've tried these step and are still experiencing this behavior, reach out to the Support team at support@getdbt.com for further assistance. From 7c2f7a16934631358097a31a76fb206e81b591de Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:55:30 +0100 Subject: [PATCH 14/34] Update website/docs/faqs/Troubleshooting/auth-expired-error.md Co-authored-by: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> --- website/docs/faqs/Troubleshooting/auth-expired-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/faqs/Troubleshooting/auth-expired-error.md b/website/docs/faqs/Troubleshooting/auth-expired-error.md index 80f7fe11b77..267407a8c70 100644 --- a/website/docs/faqs/Troubleshooting/auth-expired-error.md +++ b/website/docs/faqs/Troubleshooting/auth-expired-error.md @@ -16,4 +16,4 @@ To resolve the issue, complete the following steps: 2. Navigate to **Credentials** and click on the project you're experiencing the issue with. 3. Under **Development credentials**, click the **Reconnect Snowflake Account** (green) button. This steps you through reauthentication using the SSO workflow. -If you've tried these step and are still experiencing this behavior, reach out to the Support team at support@getdbt.com for further assistance. +If you've tried these step and are still getting this error, please contact the Support team at support@getdbt.com for further assistance. From 9a91cfb45099c8c670b64e0ed8ff0cfa90996502 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 13 Sep 2024 10:12:39 +0100 Subject: [PATCH 15/34] replace w with r --- website/snippets/_enterprise-permissions-table.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/snippets/_enterprise-permissions-table.md b/website/snippets/_enterprise-permissions-table.md index 98255c660e9..d972fc95342 100644 --- a/website/snippets/_enterprise-permissions-table.md +++ b/website/snippets/_enterprise-permissions-table.md @@ -80,11 +80,11 @@ The project roles enable you to work within the projects in various capacities. | Data platform configurations | W | W | W | W | R | W | | | | | R | R | | | Develop
(IDE or dbt Cloud CLI) | W | W | | W | | | | | | | | | | | Environments | W | R | R | R | R | W | | R | | | R | R | | -| Jobs | W | R | R | W | R | W | R | R | | | R | R | | +| Jobs | W | R | R | R | R | W | R | R | | | R | R | | | Metadata GraphQL API access | R | R | R | R | R | R | | R | R | | R | R | | | Permissions (Groups & Licenses) | W | | R | R | R | | | | | | | R | | | Profile (Credentials) | W | R | | R | R | R | | | | | R | | | | Projects | W | W | W | W | W | R | | R | | | R | W | | | Repositories | W | | R | R | W | | | | | | R | R | | -| Runs | W | R | R | W | R | W | W | R | | | R | R | | +| Runs | W | R | R | R | R | W | W | R | | | R | R | | | Semantic Layer config | W | R | W | R | R | R | | | | W | R | R | | From 37fdc0317185478dcbed45403a76b82b5d3c9dea Mon Sep 17 00:00:00 2001 From: Diego Quintana Date: Wed, 11 Sep 2024 19:20:19 -0300 Subject: [PATCH 16/34] Update constraints.md Adds a reference to `{{ target.schema }}`, useful when defining `foreign_key` constraints. --- website/docs/reference/resource-properties/constraints.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index b8111ef0adb..b24a5b430d6 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -23,6 +23,8 @@ The structure of a constraint is: - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. - `columns` (model-level only): List of column names to apply the constraint over +When using `foreign_key`, the schema of the relation being referenced needs to be set explicitly. You can use `{{ target.schema }}` to let dbt pass the schema used by the target being used. + ```yml @@ -62,6 +64,8 @@ models: + + ## Platform-specific support In transactional databases, it is possible to define "constraints" on the allowed values of certain columns, stricter than just the data type of those values. For example, Postgres supports and enforces all the constraints in the ANSI SQL standard (`not null`, `unique`, `primary key`, `foreign key`), plus a flexible row-level `check` constraint that evaluates to a boolean expression. From 6791be9dec2edeb7970ef58dfa4246b5787dad8c Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:31:43 +0100 Subject: [PATCH 17/34] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index b24a5b430d6..33d4c5afa3c 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -23,7 +23,13 @@ The structure of a constraint is: - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. - `columns` (model-level only): List of column names to apply the constraint over -When using `foreign_key`, the schema of the relation being referenced needs to be set explicitly. You can use `{{ target.schema }}` to let dbt pass the schema used by the target being used. + + +When using `foreign_key`, you need to manually specify the schema of the referenced table. Use `{{ target.schema }}` in the `expression` field to automatically pass the schema used by the target environment. Note that versions of dbt will have more efficient ways of handling this. + +For example: `expression: "{{ target.schema }}.customers(customer_id)"` + + From 9257248d81ee978ff1a2c20df9e699b87fa0c2e2 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:02:02 +0100 Subject: [PATCH 18/34] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 33d4c5afa3c..ff52a1fbcf4 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -25,7 +25,7 @@ The structure of a constraint is: -When using `foreign_key`, you need to manually specify the schema of the referenced table. Use `{{ target.schema }}` in the `expression` field to automatically pass the schema used by the target environment. Note that versions of dbt will have more efficient ways of handling this. +When using `foreign_key`, you need to specify the referenced table's schema manually. Use `{{ target.schema }}` in the `expression` field to automatically pass the schema used by the target environment. Note that later versions of dbt will have more efficient ways of handling this. For example: `expression: "{{ target.schema }}.customers(customer_id)"` From 274dac1e18221fae7540d26ffaba8858c5f98f53 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:07:46 -0700 Subject: [PATCH 19/34] Update Advanced CI overview and related pages (#6033) ## What are you changing in this pull request and why? Reorganized the Advanced CI docs ## Checklist - [x] I have reviewed the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and/or [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content) guidelines. - [x] Needs PM review - [x] Needs Legal review --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: nataliefiann <120089939+nataliefiann@users.noreply.github.com> --- website/docs/docs/deploy/about-ci.md | 27 ++++++++++++ website/docs/docs/deploy/advanced-ci.md | 41 ++++++++++++++----- website/docs/docs/deploy/ci-jobs.md | 10 +++-- .../docs/deploy/continuous-integration.md | 33 ++++----------- website/docs/docs/deploy/run-visibility.md | 4 +- website/sidebars.js | 9 ++-- website/snippets/_cloud-environments-info.md | 6 +-- 7 files changed, 81 insertions(+), 49 deletions(-) create mode 100644 website/docs/docs/deploy/about-ci.md diff --git a/website/docs/docs/deploy/about-ci.md b/website/docs/docs/deploy/about-ci.md new file mode 100644 index 00000000000..499f4e66403 --- /dev/null +++ b/website/docs/docs/deploy/about-ci.md @@ -0,0 +1,27 @@ +--- +title: "About continuous integration (CI) in dbt Cloud" +sidebar_label: "About continuous integration" +pagination_prev: null +pagination_next: "docs/deploy/continuous-integration" +hide_table_of_contents: true +--- + +Use [CI jobs](/docs/deploy/ci-jobs) in dbt Cloud to set up automation for testing code changes before merging to production. Additionally, [enable Advanced CI features](/docs/dbt-cloud-environments#account-access-to-advanced-ci-features) for these jobs to evaluate whether the code changes are producing the appropriate data changes you want by reviewing the comparison differences dbt provides. + +Refer to the guide [Get started with continuous integration tests](/guides/set-up-ci?step=1) for more information. + +
+ + + + + +

\ No newline at end of file diff --git a/website/docs/docs/deploy/advanced-ci.md b/website/docs/docs/deploy/advanced-ci.md index 22e6f5c3485..941591c3367 100644 --- a/website/docs/docs/deploy/advanced-ci.md +++ b/website/docs/docs/deploy/advanced-ci.md @@ -5,24 +5,45 @@ sidebar_label: "Advanced CI" description: "Advanced CI enables developers to compare changes by demonstrating the changes the code produces." --- -Advanced CI helps developers answer the question, “Will this PR build the correct changes in production?” By demonstrating the data changes that code changes produce, users can ensure they always ship trusted data products as they develop. +# Advanced CI -Customers control what data to use and may implement synthetic data if pre-production or development data is heavily regulated or sensitive. The data selected by users is cached on dbt Labs' systems for up to 30 days. dbt Labs does not access Advanced CI cached data for its benefit, and the data is only used to provide services to clients as they direct. This caching optimizes compute usage so that the entire comparison is not rerun against the data warehouse each time the **Compare** tab is viewed. +[Continuous integration workflows](/docs/deploy/continuous-integration) help increase the governance and improve the quality of the data. Additionally for these CI jobs, you can use Advanced CI features, such as [compare changes](#compare-changes), that provide details about the changes between what's currently in your production environment and the pull request's latest commit, giving you observability into how data changes are affected by your code changes. By analyzing the data changes that code changes produce, you can ensure you're always shipping trustworthy data products as you're developing. -## Data caching +:::tip Preview feature +The compare changes feature is currently available as a [preview](/docs/dbt-versions/product-lifecycles#dbt-cloud) in dbt Cloud. dbt Labs plans to provide additional Advanced CI features in the near future. More info coming soon. -When you run Advanced CI (by enabling **Compare changes**), dbt Cloud stores a cache of no more than 100 records for each modified model. By caching this data, users can view the examples of changed data without rerunning the comparison against the data warehouse every time. To display the changes, dbt Cloud uses a cached version of a sample of data records. These data records are queried from the database using the connection configuration (such as user, role, service account, and so on.) set in the CI job's environment. +::: - +## Compare changes feature {#compare-changes} -The cache is encrypted, stored in Amazon S3 or Azure blob storage in your account’s region, and automatically deleted after 30 days. No data is retained on dbt Labs' systems beyond this period. Users accessing a CI run that is more than 30 days old will not be able to see the comparison; instead, they will see a message indicating that the data has expired. No other third-party subcontractor(s), aside from the storage subcontractor(s), has access to the cached data. +For [CI jobs](/docs/deploy/ci-jobs) that have the **Run compare changes** option enabled, dbt Cloud compares the changes between the last applied state of the production environment (defaulting to deferral for lower compute costs) and the latest changes from the pull request, whenever a pull request is opened or new commits are pushed. - +dbt reports the comparison differences in: + +- **dbt Cloud** — Shows the changes (if any) to the data's primary keys, rows, and columns in the [Compare tab](/docs/deploy/run-visibility#compare-tab) from the [Job run details](/docs/deploy/run-visibility#job-run-details) page. +- **The pull request from your Git provider** — Shows a summary of the changes as a Git comment. + + + +## About the cached data + +When [comparing changes](#compare-changes), dbt Cloud stores a cache of no more than 100 records for each modified model. By caching this data, you can view the examples of changed data without rerunning the comparison against the data warehouse every time (optimizing for lower compute costs). To display the changes, dbt Cloud uses a cached version of a sample of the data records. These data records are queried from the database using the connection configuration (such as user, role, service account, and so on) that's set in the CI job's environment. + +You control what data to use. This may include synthetic data if pre-production or development data is heavily regulated or sensitive. + +- The selected data is cached on dbt Labs' systems for up to 30 days. No data is retained on dbt Labs' systems beyond this period. +- The cache is encrypted and stored in an Amazon S3 or Azure blob storage in your account’s region. +- dbt Labs will not access cached data from Advanced CI for its benefit and the data is only used to provide services as directed by you. +- Third-party subcontractors, other than storage subcontractors, will not have access to the cached data. + +If you access a CI job run that's more than 30 days old, you will not be able to see the comparison results. Instead, a message will appear indicating that the data has expired. + + ## Connection permissions -The **Compare changes** feature uses the same credentials as your CI job, as defined in your CI job’s environment. Since all users will be able to view the comparison results and the cached data, the account administrator must ensure that client CI credentials are appropriately restricted. +The compare changes feature uses the same credentials as the CI job, as defined in the CI job’s environment. The dbt Cloud administrator must ensure that client CI credentials are appropriately restricted since all customer's account users will be able to view the comparison results and the cached data. -In particular, if you use dynamic data masking in your data warehouse, the cached data will no longer be dynamically masked in the Advanced CI output, depending on the permissions of the users who view it. We recommend limiting user access to unmasked data or considering using synthetic data for the Advanced CI testing functionality. +If using dynamic data masking in the data warehouse, the cached data will no longer be dynamically masked in the Advanced CI output, depending on the permissions of the users who view it. dbt Labs recommends limiting user access to unmasked data or considering using synthetic data for the Advanced CI testing functionality. - + diff --git a/website/docs/docs/deploy/ci-jobs.md b/website/docs/docs/deploy/ci-jobs.md index 4cd8e4b6cf0..0c4cad9e674 100644 --- a/website/docs/docs/deploy/ci-jobs.md +++ b/website/docs/docs/deploy/ci-jobs.md @@ -12,8 +12,10 @@ dbt Labs recommends that you create your CI job in a dedicated dbt Cloud [deploy ### Prerequisites - You have a dbt Cloud account. -- For the [concurrent CI checks](/docs/deploy/continuous-integration#concurrent-ci-checks) and [smart cancellation of stale builds](/docs/deploy/continuous-integration#smart-cancellation) features, your dbt Cloud account must be on the [Team or Enterprise plan](https://www.getdbt.com/pricing/). -- For the [compare changes](/docs/deploy/continuous-integration#compare-changes) feature, your dbt Cloud account must have access to Advanced CI. Please ask your [dbt Cloud administrator to enable](/docs/dbt-cloud-environments#account-access-to-advanced-ci-features) this for you. +- CI features: + - For both the [concurrent CI checks](/docs/deploy/continuous-integration#concurrent-ci-checks) and [smart cancellation of stale builds](/docs/deploy/continuous-integration#smart-cancellation) features, your dbt Cloud account must be on the [Team or Enterprise plan](https://www.getdbt.com/pricing/). +- [Advanced CI](/docs/deploy/advanced-ci) features: + - For the [compare changes](/docs/deploy/advanced-ci#compare-changes) feature, your dbt Cloud account must have access to Advanced CI. Please ask your [dbt Cloud administrator to enable](/docs/dbt-cloud-environments#account-access-to-advanced-ci-features) this for you. - Set up a [connection with your Git provider](/docs/cloud/git/git-configuration-in-dbt-cloud). This integration lets dbt Cloud run jobs on your behalf for job triggering. - If you're using a native [GitLab](/docs/cloud/git/connect-gitlab) integration, you need a paid or self-hosted account that includes support for GitLab webhooks and [project access tokens](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html). If you're using GitLab Free, merge requests will trigger CI jobs but CI job status updates (success or failure of the job) will not be reported back to GitLab. @@ -33,7 +35,7 @@ To make CI job creation easier, many options on the **CI job** page are set to d 1. Options in the **Execution settings** section: - **Commands** — By default, it includes the `dbt build --select state:modified+` command. This informs dbt Cloud to build only new or changed models and their downstream dependents. Importantly, state comparison can only happen when there is a deferred environment selected to compare state to. Click **Add command** to add more [commands](/docs/deploy/job-commands) that you want to be invoked when this job runs. - - **Run compare changes** — Enable this option to compare the last applied state of the production environment (if one exists) with the latest changes from the pull request, and identify what those differences are. To enable record-level comparison and primary key analysis, you must add a [primary key constraint](/reference/resource-properties/constraints) or [uniqueness test](/reference/resource-properties/data-tests#unique). Otherwise, you'll receive a "Primary key missing" error message in dbt Cloud. + - **Run compare changes** — Enable this option to compare the last applied state of the production environment (if one exists) with the latest changes from the pull request, and identify what those differences are. To enable record-level comparison and primary key analysis, you must add a [primary key constraint](/reference/resource-properties/constraints) or [uniqueness test](/reference/resource-properties/data-tests#unique). Otherwise, you'll receive a "Primary key missing" error message in dbt Cloud. To review the comparison report, navigate to the [Compare tab](/docs/deploy/run-visibility#compare-tab) in the job run's details. A summary of the report is also available from the pull request in your Git provider (see the [CI report example](#example-ci-report)). - **Compare changes against an environment (Deferral)** — By default, it’s set to the **Production** environment if you created one. This option allows dbt Cloud to check the state of the code in the PR against the code running in the deferred environment, so as to only check the modified code, instead of building the full table or the entire DAG. @@ -60,7 +62,7 @@ The following is an example of a CI check in a GitHub pull request. The green ch -### Example of CI report in pull request {#example-ci-report} +### Example of CI report in pull request {#example-ci-report} The following is an example of a CI report in a GitHub pull request, which is shown when the **Run compare changes** option is enabled for the CI job. It displays a high-level summary of the models that changed from the pull request. diff --git a/website/docs/docs/deploy/continuous-integration.md b/website/docs/docs/deploy/continuous-integration.md index a9e0239f394..49d050f3146 100644 --- a/website/docs/docs/deploy/continuous-integration.md +++ b/website/docs/docs/deploy/continuous-integration.md @@ -31,7 +31,11 @@ dbt Cloud deletes the temporary schema from your  w The [dbt Cloud scheduler](/docs/deploy/job-scheduler) executes CI jobs differently from other deployment jobs in these important ways: - +- **Concurrent CI checks** — CI runs triggered by the same dbt Cloud CI job execute concurrently (in parallel), when appropriate. +- **Smart cancellation of stale builds** — Automatically cancels stale, in-flight CI runs when there are new commits to the PR. +- **Run slot treatment** — CI runs don't consume a run slot. + +### Concurrent CI checks When you have teammates collaborating on the same dbt project creating pull requests on the same dbt repository, the same CI job will get triggered. Since each run builds into a dedicated, temporary schema that’s tied to the pull request, dbt Cloud can safely execute CI runs _concurrently_ instead of _sequentially_ (differing from what is done with deployment dbt Cloud jobs). Because no one needs to wait for one CI run to finish before another one can start, with concurrent CI checks, your whole team can test and integrate dbt code faster. @@ -41,35 +45,12 @@ Below describes the conditions when CI checks are run concurrently and when they - CI runs with the _same_ PR number and _different_ commit SHAs execute serially because they’re building into the same schema. dbt Cloud will run the latest commit and cancel any older, stale commits. For details, refer to [Smart cancellation of stale builds](#smart-cancellation). - CI runs with the same PR number and same commit SHA, originating from different dbt Cloud projects will execute jobs concurrently. This can happen when two CI jobs are set up in different dbt Cloud projects that share the same dbt repository. - - - +### Smart cancellation of stale builds When you push a new commit to a PR, dbt Cloud enqueues a new CI run for the latest commit and cancels any CI run that is (now) stale and still in flight. This can happen when you’re pushing new commits while a CI build is still in process and not yet done. By cancelling runs in a safe and deliberate way, dbt Cloud helps improve productivity and reduce data platform spend on wasteful CI runs. - - - +### Run slot treatment CI runs don't consume run slots. This guarantees a CI check will never block a production run. - - - - - - When a pull request is opened or new commits are pushed, dbt Cloud compares the changes between the last applied state of the production environment (defaulting to deferral for lower computation costs) and the latest changes from the pull request for CI jobs that have the **Run compare changes** option enabled. By analyzing these comparisons, you can gain a better understanding of how the data changes are affected by code changes to help ensure you always ship the correct changes to production and create trusted data products. - - :::info Beta feature - -The compare changes feature is currently in limited beta for select accounts. If you're interested in gaining access or learning more, please stay tuned for updates. - - ::: - -dbt reports the comparison differences: - -- **In dbt Cloud** — Shows the changes (if any) to the data's primary keys, rows, and columns. To learn more, refer to the [Compare tab](/docs/deploy/run-visibility#compare-tab) in the [Job run details](/docs/deploy/run-visibility#job-run-details). -- **In the pull request from your Git provider** — Shows a summary of the changes, as a git comment. - - \ No newline at end of file diff --git a/website/docs/docs/deploy/run-visibility.md b/website/docs/docs/deploy/run-visibility.md index f169031790e..d883b2cfaa0 100644 --- a/website/docs/docs/deploy/run-visibility.md +++ b/website/docs/docs/deploy/run-visibility.md @@ -55,9 +55,9 @@ This provides a list of the artifacts generated by the job run. The files are sa -### Compare tab +### Compare tab -The **Compare** tab is shown for [CI job runs](/docs/deploy/ci-jobs) with the **Run compare changes** setting enabled. It displays details about [the changes from the comparison dbt performed](/docs/deploy/continuous-integration#compare-changes) between what's in your production environment and the pull request. To help you better visualize the differences, dbt Cloud highlights changes to your models in red (deletions) and green (inserts). +The **Compare** tab is shown for [CI job runs](/docs/deploy/ci-jobs) with the **Run compare changes** setting enabled. It displays details about [the changes from the comparison dbt performed](/docs/deploy/advanced-ci#compare-changes) between what's in your production environment and the pull request. To help you better visualize the differences, dbt Cloud highlights changes to your models in red (deletions) and green (inserts). From the **Modified** section, you can view the following: diff --git a/website/sidebars.js b/website/sidebars.js index d52be178820..fe1118b3be2 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -466,11 +466,12 @@ const sidebarSettings = { type: "category", label: "Continuous integration", collapsed: true, - link: { type: "doc", id: "docs/deploy/continuous-integration" }, + link: { type: "doc", id: "docs/deploy/about-ci" }, items: [ - "docs/deploy/continuous-integration", - "docs/deploy/advanced-ci", - ], + "docs/deploy/about-ci", + "docs/deploy/continuous-integration", + "docs/deploy/advanced-ci", + ], }, "docs/deploy/continuous-deployment", { diff --git a/website/snippets/_cloud-environments-info.md b/website/snippets/_cloud-environments-info.md index 508a7e79d54..7c6cf2f9431 100644 --- a/website/snippets/_cloud-environments-info.md +++ b/website/snippets/_cloud-environments-info.md @@ -115,11 +115,11 @@ To enable, select **Account settings** from the gear menu and enable the **Parti ### Account access to Advanced CI features -To help increase the governance and improve the quality of the data, you can set up automation that tests code changes before merging them into production with [CI jobs](/docs/deploy/ci-jobs). You can also enable Advanced CI features, such as [compare changes](/docs/deploy/continuous-integration#compare-changes), that allow dbt Cloud account members to view details about the changes between what's currently in your production environment and the pull request's latest commit, providing observability into how data changes are affected by code changes. +[Advanced CI](/docs/deploy/advanced-ci) features, such as [compare changes](/docs/deploy/advanced-ci#compare-changes), allow dbt Cloud account members to view details about the changes between what's in the production environment and the pull request. To use Advanced CI features, your dbt Cloud account must have access to them. Ask your dbt Cloud administrator to enable Advanced CI features on your account, which they can do by selecting **Account settings** from the gear menu and choosing the **Enable account access to Advanced CI** option. - - +Once enabled, the **Run compare changes** option becomes available in the CI job settings for you to select. + From a56dc301910c1e1723b906be922b3ecbbde467d5 Mon Sep 17 00:00:00 2001 From: Ly Nguyen <107218380+nghi-ly@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:21:30 -0700 Subject: [PATCH 20/34] Fix card (#6062) ## What are you changing in this pull request and why? Fix card on landing page ## Checklist - [x] I have reviewed the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and/or [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content) guidelines. --- website/docs/docs/deploy/about-ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/deploy/about-ci.md b/website/docs/docs/deploy/about-ci.md index 499f4e66403..51b3b160fae 100644 --- a/website/docs/docs/deploy/about-ci.md +++ b/website/docs/docs/deploy/about-ci.md @@ -19,7 +19,7 @@ Refer to the guide [Get started with continuous integration tests](/guides/set-u icon="dbt-bit"/> From 80c9466c4e0bf8091704aa4fb880cd0c9630d9d7 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 21:47:34 +0100 Subject: [PATCH 21/34] Update configure-auto-exposures.md --- .../docs/cloud-integrations/configure-auto-exposures.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/website/docs/docs/cloud-integrations/configure-auto-exposures.md b/website/docs/docs/cloud-integrations/configure-auto-exposures.md index 6314a0eb213..29255e36eab 100644 --- a/website/docs/docs/cloud-integrations/configure-auto-exposures.md +++ b/website/docs/docs/cloud-integrations/configure-auto-exposures.md @@ -22,10 +22,11 @@ Auto-exposures help data teams optimize their efficiency and ensure data quality To access the features, you should meet the following: -1. You have a dbt Cloud account on the [Enterprise plan](https://www.getdbt.com/pricing/). -2. You have set up a [production](/docs/deploy/deploy-environments#set-as-production-environment) deployment environment for each project you want to explore, with at least one successful job run. -3. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings -4. Use Tableau as your BI tool and can enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. +1. Your environment and jobs are on [Versionless](/docs/dbt-versions/versionless-cloud) dbt. +2. You have a dbt Cloud account on the [Enterprise plan](https://www.getdbt.com/pricing/). +3. You have set up a [production](/docs/deploy/deploy-environments#set-as-production-environment) deployment environment for each project you want to explore, with at least one successful job run. +4. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings +5. Use Tableau as your BI tool and can enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. ## Set up in Tableau From 35322f9858dda1d5d0a1a2f842fa39ec7692079f Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 13 Sep 2024 21:51:22 +0100 Subject: [PATCH 22/34] Update auto-exposures.md --- website/docs/docs/collaborate/auto-exposures.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/docs/collaborate/auto-exposures.md b/website/docs/docs/collaborate/auto-exposures.md index 7e4b4531876..e50002c7084 100644 --- a/website/docs/docs/collaborate/auto-exposures.md +++ b/website/docs/docs/collaborate/auto-exposures.md @@ -16,6 +16,8 @@ Auto-exposures are currently available in beta to a limited group of users and a Auto-exposures helps users understand how their models are used in downstream analytics tools to inform investments and reduce incidents — ultimately building trust and confidence in data products. It imports and auto-generates exposures based on Tableau dashboards, with user-defined curation. +Auto-exposures are available on [Versionless](/docs/dbt-versions/versionless-cloud) dbt. + For more information on how to set up auto-exposures, prerequisites, and more — refer to [configure auto-exposures in Tableau and dbt Cloud](/docs/cloud-integrations/configure-auto-exposures). import ViewExposures from '/snippets/_auto-exposures-view.md'; From e836844faf75e506315934f1219e3aa3b1dd9764 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:40:41 +0100 Subject: [PATCH 23/34] Update website/docs/docs/collaborate/auto-exposures.md --- website/docs/docs/collaborate/auto-exposures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/collaborate/auto-exposures.md b/website/docs/docs/collaborate/auto-exposures.md index e50002c7084..3633b4c0713 100644 --- a/website/docs/docs/collaborate/auto-exposures.md +++ b/website/docs/docs/collaborate/auto-exposures.md @@ -16,7 +16,7 @@ Auto-exposures are currently available in beta to a limited group of users and a Auto-exposures helps users understand how their models are used in downstream analytics tools to inform investments and reduce incidents — ultimately building trust and confidence in data products. It imports and auto-generates exposures based on Tableau dashboards, with user-defined curation. -Auto-exposures are available on [Versionless](/docs/dbt-versions/versionless-cloud) dbt. +Auto-exposures is available on [Versionless](/docs/dbt-versions/versionless-cloud) and to [dbt Cloud Enterprise](https://www.getdbt.com/pricing/) plans. For more information on how to set up auto-exposures, prerequisites, and more — refer to [configure auto-exposures in Tableau and dbt Cloud](/docs/cloud-integrations/configure-auto-exposures). From b7e7940660b03e3f889e21432c06c96cce889488 Mon Sep 17 00:00:00 2001 From: mkottakota1 <149763406+mkottakota1@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:09:13 +0530 Subject: [PATCH 24/34] Update vertica-setup.md dbt-core 1.8.3 release --- .../docs/docs/core/connect-data-platform/vertica-setup.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/docs/docs/core/connect-data-platform/vertica-setup.md b/website/docs/docs/core/connect-data-platform/vertica-setup.md index 8e499d68b3e..aaa6ac7c66e 100644 --- a/website/docs/docs/core/connect-data-platform/vertica-setup.md +++ b/website/docs/docs/core/connect-data-platform/vertica-setup.md @@ -6,9 +6,9 @@ meta: authors: 'Vertica (Former authors: Matthew Carter, Andy Regan, Andrew Hedengren)' github_repo: 'vertica/dbt-vertica' pypi_package: 'dbt-vertica' - min_core_version: 'v1.7.0' + min_core_version: 'v1.8.3' cloud_support: 'Not Supported' - min_supported_version: 'Vertica 23.4.0' + min_supported_version: 'Vertica 24.3.0' slack_channel_name: 'n/a' slack_channel_link: 'https://www.getdbt.com/community/' platform_name: 'Vertica' @@ -50,7 +50,8 @@ your-profile: schema: [dbt schema] connection_load_balance: True backup_server_node: [list of backup hostnames or IPs] - retries: [1 or more] + retries: [1 or more] + autocommit: False threads: [1 or more] target: dev @@ -79,6 +80,7 @@ backup_server_node| List of hosts to connect to if the primary host specified in retries |The retry times after an unsuccessful connection.| No| 2 |3| threads |The number of threads the dbt project will run on.| No| 1| 3| label| A session label to identify the connection. |No |An auto-generated label with format of: dbt_username |dbt_dbadmin| +autocommit | A Boolean value that indicates whether the connection can set the status of autocommit.| No| True|False For more information on Vertica’s connection properties please refer to [Vertica-Python](https://github.com/vertica/vertica-python#create-a-connection) Connection Properties. From c45db6168eaea363be8209969df7a5a09f497ea8 Mon Sep 17 00:00:00 2001 From: mkottakota1 <149763406+mkottakota1@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:17:40 +0530 Subject: [PATCH 25/34] Update vertica-setup.md for DBT core 1.8.5 --- website/docs/docs/core/connect-data-platform/vertica-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/core/connect-data-platform/vertica-setup.md b/website/docs/docs/core/connect-data-platform/vertica-setup.md index aaa6ac7c66e..6cb8c708bc8 100644 --- a/website/docs/docs/core/connect-data-platform/vertica-setup.md +++ b/website/docs/docs/core/connect-data-platform/vertica-setup.md @@ -6,7 +6,7 @@ meta: authors: 'Vertica (Former authors: Matthew Carter, Andy Regan, Andrew Hedengren)' github_repo: 'vertica/dbt-vertica' pypi_package: 'dbt-vertica' - min_core_version: 'v1.8.3' + min_core_version: 'v1.8.5' cloud_support: 'Not Supported' min_supported_version: 'Vertica 24.3.0' slack_channel_name: 'n/a' From cd7b4bec3bbb6a3637792e56b95c988dfcfd816e Mon Sep 17 00:00:00 2001 From: "Leona B. Campbell" <3880403+runleonarun@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:08:43 -0700 Subject: [PATCH 26/34] Update airflow-and-dbt-cloud to new repo (#6064) ## What are you changing in this pull request and why? * Updating to our own dbt maintained repo. Note that Leah will update the videos next week. ## Checklist - [ ] I have reviewed the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [ ] The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and/or [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content) guidelines. - [ ] I have added checklist item(s) to this list for anything anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch." --- website/docs/guides/airflow-and-dbt-cloud.md | 31 ++++++-------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/website/docs/guides/airflow-and-dbt-cloud.md b/website/docs/guides/airflow-and-dbt-cloud.md index 51ac7668aa9..c55940212bc 100644 --- a/website/docs/guides/airflow-and-dbt-cloud.md +++ b/website/docs/guides/airflow-and-dbt-cloud.md @@ -61,14 +61,14 @@ Follow the instructions [here](https://docs.docker.com/desktop/) to install Dock ## Clone the airflow-dbt-cloud repository -Open your terminal and clone the [airflow-dbt-cloud repository](https://github.com/sungchun12/airflow-dbt-cloud). This contains example Airflow DAGs that you’ll use to orchestrate your dbt Cloud job. Once cloned, navigate into the `airflow-dbt-cloud` project. +Open your terminal and clone the [airflow-dbt-cloud repository](https://github.com/dbt-labs/airflow-dbt-cloud). This contains example Airflow DAGs that you’ll use to orchestrate your dbt Cloud job. Once cloned, navigate into the `airflow-dbt-cloud` project. ```bash -git clone https://github.com/sungchun12/airflow-dbt-cloud.git +git clone https://github.com/dbt-labs/airflow-dbt-cloud.git cd airflow-dbt-cloud ``` - +For more information about cloning GitHub repositories, refer to "[Cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)" in the GitHub documentation. ## Start the Docker container @@ -140,29 +140,16 @@ Now you have all the working pieces to get up and running with Airflow + dbt Clo ## Update the placeholders in the sample code - Add your `account_id` and `job_id` to the python file [dbt_cloud_provider_eltml.py](https://github.com/sungchun12/airflow-dbt-cloud/blob/main/dags/dbt_cloud_provider_eltml.py). + Add your `account_id` and `job_id` to the python file [dbt_cloud_run_job.py](https://github.com/dbt-labs/airflow-dbt-cloud/blob/main/dags/dbt_cloud_run_job.py). Both IDs are included inside of the dbt Cloud job URL as shown in the following snippets: ```python # For the dbt Cloud Job URL https://YOUR_ACCESS_URL/#/accounts/16173/projects/36467/jobs/65767/ -# The account_id is 16173 - -# Update line 28 -default_args={"dbt_cloud_conn_id": "dbt_cloud", "account_id": 16173}, -``` - -```python -# For the dbt Cloud Job URL https://YOUR_ACCESS_URL/#/accounts/16173/projects/36467/jobs/65767/ -# The job_id is 65767 - -# Update line 39 -trigger_dbt_cloud_job_run = DbtCloudRunJobOperator( - task_id="trigger_dbt_cloud_job_run", - job_id=65767, - check_interval=10, - timeout=300, - ) +# The account_id is 16173 and the job_id is 65767 +# Update lines 34 and 35 +ACCOUNT_ID = "16173" +JOB_ID = "65767" ``` @@ -247,4 +234,4 @@ Yes, either through [Airflow's email/slack](https://www.astronomer.io/guides/err Check out [this recording](https://www.youtube.com/watch?v=n7IIThR8hGk) of a dbt meetup for some tips. - \ No newline at end of file + From 4f4efd35e5f38293daffa8ddd8c56bf94a5d9c5e Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:49:33 +0100 Subject: [PATCH 27/34] Update website/docs/docs/core/connect-data-platform/vertica-setup.md --- website/docs/docs/core/connect-data-platform/vertica-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/core/connect-data-platform/vertica-setup.md b/website/docs/docs/core/connect-data-platform/vertica-setup.md index 6cb8c708bc8..9e70bc46306 100644 --- a/website/docs/docs/core/connect-data-platform/vertica-setup.md +++ b/website/docs/docs/core/connect-data-platform/vertica-setup.md @@ -80,7 +80,7 @@ backup_server_node| List of hosts to connect to if the primary host specified in retries |The retry times after an unsuccessful connection.| No| 2 |3| threads |The number of threads the dbt project will run on.| No| 1| 3| label| A session label to identify the connection. |No |An auto-generated label with format of: dbt_username |dbt_dbadmin| -autocommit | A Boolean value that indicates whether the connection can set the status of autocommit.| No| True|False +autocommit | Boolean value that indicates if the connection can enable or disable auto-commit.| No | True | False For more information on Vertica’s connection properties please refer to [Vertica-Python](https://github.com/vertica/vertica-python#create-a-connection) Connection Properties. From 2e8b1170f96b654dff4c7de07f5aa9523b6e1fc0 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:06:46 +0100 Subject: [PATCH 28/34] Update website/docs/docs/cloud-integrations/configure-auto-exposures.md --- website/docs/docs/cloud-integrations/configure-auto-exposures.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/docs/cloud-integrations/configure-auto-exposures.md b/website/docs/docs/cloud-integrations/configure-auto-exposures.md index 29255e36eab..5c5f12c7daa 100644 --- a/website/docs/docs/cloud-integrations/configure-auto-exposures.md +++ b/website/docs/docs/cloud-integrations/configure-auto-exposures.md @@ -27,6 +27,7 @@ To access the features, you should meet the following: 3. You have set up a [production](/docs/deploy/deploy-environments#set-as-production-environment) deployment environment for each project you want to explore, with at least one successful job run. 4. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings 5. Use Tableau as your BI tool and can enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. +6. Run a production job _after_ saving the Tableau collections. ## Set up in Tableau From 0a8bc7eec8108c8f1a75684fd941e227b87e9dd1 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:09:54 +0100 Subject: [PATCH 29/34] Update configure-auto-exposures.md adding per feedback: https://dbt-labs.slack.com/archives/C06GJRK27PF/p1726261331100539?thread_ts=1726163198.724299&cid=C06GJRK27PF --- .../docs/cloud-integrations/configure-auto-exposures.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/docs/docs/cloud-integrations/configure-auto-exposures.md b/website/docs/docs/cloud-integrations/configure-auto-exposures.md index 5c5f12c7daa..4d65108f7c7 100644 --- a/website/docs/docs/cloud-integrations/configure-auto-exposures.md +++ b/website/docs/docs/cloud-integrations/configure-auto-exposures.md @@ -26,7 +26,7 @@ To access the features, you should meet the following: 2. You have a dbt Cloud account on the [Enterprise plan](https://www.getdbt.com/pricing/). 3. You have set up a [production](/docs/deploy/deploy-environments#set-as-production-environment) deployment environment for each project you want to explore, with at least one successful job run. 4. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings -5. Use Tableau as your BI tool and can enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. +5. Use Tableau as your BI tool and enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. 6. Run a production job _after_ saving the Tableau collections. ## Set up in Tableau @@ -64,9 +64,10 @@ To set up [personal access tokens (PATs)](/docs/dbt-cloud-apis/user-tokens#using dbt Cloud automatically imports and syncs any workbook within the selected collections. New additions to the collections will be added to the lineage in dbt Cloud during the next automatic sync (usually once per day). -5. Click **Save**. dbt Cloud imports everything in this collection and you can continue to view them in Explorer using the next steps. +5. Click **Save**. +6. Run a production job _after_ saving the Tableau collections. -For more information on how to view and use auto-exposures, refer to [View auto-exposures from dbt Explorer](/docs/collaborate/auto-exposures) page. +dbt Cloud imports everything in the collection(s) and you can continue to view them in Explorer. For more information on how to view and use auto-exposures, refer to [View auto-exposures from dbt Explorer](/docs/collaborate/auto-exposures) page. From c460460b5f024a1ced4ea4f0ed755957bf4e086e Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:33:16 +0100 Subject: [PATCH 30/34] Update website/docs/docs/cloud-integrations/configure-auto-exposures.md --- .../docs/docs/cloud-integrations/configure-auto-exposures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/cloud-integrations/configure-auto-exposures.md b/website/docs/docs/cloud-integrations/configure-auto-exposures.md index 4d65108f7c7..41448dd5f9e 100644 --- a/website/docs/docs/cloud-integrations/configure-auto-exposures.md +++ b/website/docs/docs/cloud-integrations/configure-auto-exposures.md @@ -25,7 +25,7 @@ To access the features, you should meet the following: 1. Your environment and jobs are on [Versionless](/docs/dbt-versions/versionless-cloud) dbt. 2. You have a dbt Cloud account on the [Enterprise plan](https://www.getdbt.com/pricing/). 3. You have set up a [production](/docs/deploy/deploy-environments#set-as-production-environment) deployment environment for each project you want to explore, with at least one successful job run. -4. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings +4. You have [admin permissions](/docs/cloud/manage-access/enterprise-permissions) in dbt Cloud to edit project settings or production environment settings. 5. Use Tableau as your BI tool and enable metadata permissions or work with an admin to do so. Compatible with Tableau Cloud or Tableau Server with the Metadata API enabled. 6. Run a production job _after_ saving the Tableau collections. From e0c44d4e19218253ffe239288c585562cb38b7ab Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:34:57 +0100 Subject: [PATCH 31/34] Update website/docs/docs/collaborate/auto-exposures.md --- website/docs/docs/collaborate/auto-exposures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/collaborate/auto-exposures.md b/website/docs/docs/collaborate/auto-exposures.md index 3633b4c0713..371f6e80248 100644 --- a/website/docs/docs/collaborate/auto-exposures.md +++ b/website/docs/docs/collaborate/auto-exposures.md @@ -16,7 +16,7 @@ Auto-exposures are currently available in beta to a limited group of users and a Auto-exposures helps users understand how their models are used in downstream analytics tools to inform investments and reduce incidents — ultimately building trust and confidence in data products. It imports and auto-generates exposures based on Tableau dashboards, with user-defined curation. -Auto-exposures is available on [Versionless](/docs/dbt-versions/versionless-cloud) and to [dbt Cloud Enterprise](https://www.getdbt.com/pricing/) plans. +Auto-exposures is available on [Versionless](/docs/dbt-versions/versionless-cloud) and on [dbt Cloud Enterprise](https://www.getdbt.com/pricing/) plans. For more information on how to set up auto-exposures, prerequisites, and more — refer to [configure auto-exposures in Tableau and dbt Cloud](/docs/cloud-integrations/configure-auto-exposures). From dfe7fd087bed03aeb4f21e48678ef2896798ce47 Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Mon, 16 Sep 2024 10:10:29 -0400 Subject: [PATCH 32/34] update version banner messaging --- .../src/theme/DocRoot/Layout/Main/index.js | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/website/src/theme/DocRoot/Layout/Main/index.js b/website/src/theme/DocRoot/Layout/Main/index.js index 458cb9d8716..9f9210e178c 100644 --- a/website/src/theme/DocRoot/Layout/Main/index.js +++ b/website/src/theme/DocRoot/Layout/Main/index.js @@ -43,11 +43,14 @@ export default function DocRootLayoutMain({ latestStableRelease, } = useContext(VersionContext); - const { pageAvailable, firstAvailableVersion } = pageVersionCheck( - dbtVersion, - versionedPages, - currentDocRoute - ); + const { + pageAvailable, + firstAvailableVersion, + lastAvailableVersion + } = pageVersionCheck(dbtVersion, versionedPages, currentDocRoute); + + const hasFirstAvailableVersion = + firstAvailableVersion && firstAvailableVersion !== "0"; // Check whether this version is a isPrerelease, and show banner if so const [PreData, setPreData] = useState({ @@ -116,21 +119,35 @@ export default function DocRootLayoutMain({ hiddenSidebarContainer && styles.docItemWrapperEnhanced )} > - {!pageAvailable && dbtVersion && firstAvailableVersion && ( -
- -

- Unfortunately, this feature is not available in dbt Core version{" "} - {dbtVersion} -

-

- {" "} - You should upgrade to {firstAvailableVersion} or later if you - want to use this feature. -

-
-
- )} + {!pageAvailable && + dbtVersion && + (hasFirstAvailableVersion || lastAvailableVersion) && ( +
+ +

+ Unfortunately, this feature is not available in dbt Core + version {dbtVersion} +

+ {hasFirstAvailableVersion ? ( +

+ {" "} + You should upgrade to {firstAvailableVersion} or later if + you want to use this feature. +

+ ) : null} +
+
+ )} {PreData.showisPrereleaseBanner && (
From 9646d9ffbe511ef056f0bfc5cd8bf233e6434efe Mon Sep 17 00:00:00 2001 From: Jason Karlavige Date: Mon, 16 Sep 2024 10:19:18 -0400 Subject: [PATCH 33/34] remove check to always show banner if page not available --- website/src/theme/DocRoot/Layout/Main/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/src/theme/DocRoot/Layout/Main/index.js b/website/src/theme/DocRoot/Layout/Main/index.js index 9f9210e178c..da6e29265bb 100644 --- a/website/src/theme/DocRoot/Layout/Main/index.js +++ b/website/src/theme/DocRoot/Layout/Main/index.js @@ -120,8 +120,7 @@ export default function DocRootLayoutMain({ )} > {!pageAvailable && - dbtVersion && - (hasFirstAvailableVersion || lastAvailableVersion) && ( + dbtVersion && (
Date: Tue, 17 Sep 2024 10:21:46 -0400 Subject: [PATCH 34/34] revert testing edits --- website/dbt-versions.js | 177 ++++++++++++--------------- website/docs/docs/version-testing.md | 16 --- website/src/utils/sort-versions.js | 2 - 3 files changed, 80 insertions(+), 115 deletions(-) delete mode 100644 website/docs/docs/version-testing.md diff --git a/website/dbt-versions.js b/website/dbt-versions.js index 13f76848431..60efef64f75 100644 --- a/website/dbt-versions.js +++ b/website/dbt-versions.js @@ -2,30 +2,18 @@ * Sets the available dbt versions available in the navigation * @type {Array.<{ * version: string, - * EOLDate: string, - * isPrerelease: boolean, + * EOLDate: string, + * isPrerelease: boolean, * customDisplay: string, * }>} * @property {string} version The version number * @property {string} EOLDate "End of Life" date which is used to show the EOL banner * @property {boolean} isPrerelease Boolean used for showing the prerelease banner * @property {string} customDisplay Allows setting a custom display name for the current version - * + * * customDisplay for dbt Cloud should be a version ahead of latest dbt Core release (GA or beta). */ exports.versions = [ - { - version: "2.1", - EOLDate: "2026-04-15", - }, - { - version: "1.10.1", - EOLDate: "2026-04-15", - }, - { - version: "1.10", - EOLDate: "2026-04-15", - }, { version: "1.9.1", customDisplay: "Cloud (Versionless)", @@ -55,146 +43,146 @@ exports.versions = [ */ exports.versionedPages = [ { - "page": "reference/resource-configs/target_database", - "lastVersion": "1.8", + page: "reference/resource-configs/target_database", + lastVersion: "1.8", }, { - "page": "reference/resource-configs/target_schema", - "lastVersion": "1.8", + page: "reference/resource-configs/target_schema", + lastVersion: "1.8", }, { - "page": "reference/global-configs/indirect-selection", - "firstVersion": "1.8", + page: "reference/global-configs/indirect-selection", + firstVersion: "1.8", }, { - "page": "reference/resource-configs/store_failures_as", - "firstVersion": "1.7", + page: "reference/resource-configs/store_failures_as", + firstVersion: "1.7", }, { - "page": "docs/build/build-metrics-intro", - "firstVersion": "1.6", + page: "docs/build/build-metrics-intro", + firstVersion: "1.6", }, { - "page": "docs/build/sl-getting-started", - "firstVersion": "1.6", + page: "docs/build/sl-getting-started", + firstVersion: "1.6", }, { - "page": "docs/build/about-metricflow", - "firstVersion": "1.6", + page: "docs/build/about-metricflow", + firstVersion: "1.6", }, { - "page": "docs/build/join-logic", - "firstVersion": "1.6", + page: "docs/build/join-logic", + firstVersion: "1.6", }, { - "page": "docs/build/validation", - "firstVersion": "1.6", + page: "docs/build/validation", + firstVersion: "1.6", }, { - "page": "docs/build/semantic-models", - "firstVersion": "1.6", + page: "docs/build/semantic-models", + firstVersion: "1.6", }, { - "page": "docs/build/group-by", - "firstVersion": "1.6", + page: "docs/build/group-by", + firstVersion: "1.6", }, { - "page": "docs/build/entities", - "firstVersion": "1.6", + page: "docs/build/entities", + firstVersion: "1.6", }, { - "page": "docs/build/metrics-overview", - "firstVersion": "1.6", + page: "docs/build/metrics-overview", + firstVersion: "1.6", }, { - "page": "docs/build/cumulative", - "firstVersion": "1.6", + page: "docs/build/cumulative", + firstVersion: "1.6", }, { - "page": "docs/build/derived", - "firstVersion": "1.6", + page: "docs/build/derived", + firstVersion: "1.6", }, { - "page": "docs/build/measure-proxy", - "firstVersion": "1.6", + page: "docs/build/measure-proxy", + firstVersion: "1.6", }, { - "page": "docs/build/ratio", - "firstVersion": "1.6", + page: "docs/build/ratio", + firstVersion: "1.6", }, { - "page": "reference/commands/clone", - "firstVersion": "1.6", + page: "reference/commands/clone", + firstVersion: "1.6", }, { - "page": "docs/collaborate/govern/project-dependencies", - "firstVersion": "1.6", + page: "docs/collaborate/govern/project-dependencies", + firstVersion: "1.6", }, { - "page": "reference/dbt-jinja-functions/thread_id", - "firstVersion": "1.6", + page: "reference/dbt-jinja-functions/thread_id", + firstVersion: "1.6", }, { - "page": "reference/resource-properties/deprecation_date", - "firstVersion": "1.6", + page: "reference/resource-properties/deprecation_date", + firstVersion: "1.6", }, { - "page": "reference/commands/retry", - "firstVersion": "1.6", + page: "reference/commands/retry", + firstVersion: "1.6", }, { - "page": "docs/build/groups", - "firstVersion": "1.5", + page: "docs/build/groups", + firstVersion: "1.5", }, { - "page": "docs/collaborate/govern/model-contracts", - "firstVersion": "1.5", + page: "docs/collaborate/govern/model-contracts", + firstVersion: "1.5", }, { - "page": "reference/commands/show", - "firstVersion": "1.5", + page: "reference/commands/show", + firstVersion: "1.5", }, { - "page": "docs/collaborate/govern/model-access", - "firstVersion": "1.5", + page: "docs/collaborate/govern/model-access", + firstVersion: "1.5", }, { - "page": "docs/collaborate/govern/model-versions", - "firstVersion": "1.5", + page: "docs/collaborate/govern/model-versions", + firstVersion: "1.5", }, { - "page": "reference/programmatic-invocations", - "firstVersion": "1.5", + page: "reference/programmatic-invocations", + firstVersion: "1.5", }, { - "page": "reference/resource-configs/contract", - "firstVersion": "1.5", + page: "reference/resource-configs/contract", + firstVersion: "1.5", }, { - "page": "reference/resource-configs/group", - "firstVersion": "1.5", + page: "reference/resource-configs/group", + firstVersion: "1.5", }, { - "page": "reference/resource-properties/access", - "firstVersion": "1.5", + page: "reference/resource-properties/access", + firstVersion: "1.5", }, { - "page": "reference/resource-properties/constraints", - "firstVersion": "1.5", + page: "reference/resource-properties/constraints", + firstVersion: "1.5", }, { - "page": "reference/resource-properties/latest_version", - "firstVersion": "1.5", + page: "reference/resource-properties/latest_version", + firstVersion: "1.5", }, { - "page": "reference/resource-properties/versions", - "firstVersion": "1.5", + page: "reference/resource-properties/versions", + firstVersion: "1.5", }, { - "page": "reference/resource-configs/on_configuration_change", - "firstVersion": "1.6", - } -] + page: "reference/resource-configs/on_configuration_change", + firstVersion: "1.6", + }, +]; /** * Controls doc category visibility in the sidebar based on the current version @@ -207,16 +195,11 @@ exports.versionedPages = [ */ exports.versionedCategories = [ { - "category": "Model governance", - "firstVersion": "1.5", + category: "Model governance", + firstVersion: "1.5", }, { - "category": "Build your metrics", - "firstVersion": "1.6", + category: "Build your metrics", + firstVersion: "1.6", }, - // TODO: Delete demo entry below - { - "category": "Project configs", - "firstVersion": "1.8", - }, -] +]; diff --git a/website/docs/docs/version-testing.md b/website/docs/docs/version-testing.md deleted file mode 100644 index 5ad8fd86292..00000000000 --- a/website/docs/docs/version-testing.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "Version Testing" -id: "version-testing" ---- - - - ## first version - 1.6 | last version - 1.9.1 - - - - ## first version - 2.1 - - - - ## first version - 1.10 - diff --git a/website/src/utils/sort-versions.js b/website/src/utils/sort-versions.js index 0fd00676975..6e049987306 100644 --- a/website/src/utils/sort-versions.js +++ b/website/src/utils/sort-versions.js @@ -40,7 +40,5 @@ export const sortVersions = (versionsArr) => { return 0 }); - console.log('sortedVersions', sortedVersions) - return sortedVersions }