Skip to content

Commit

Permalink
Merge pull request #170 from dbt-labs/dc/private-package-syntax
Browse files Browse the repository at this point in the history
add initial private package support
  • Loading branch information
dave-connors-3 authored Oct 3, 2024
2 parents 0192557 + cc1b566 commit a561b58
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 36 deletions.
48 changes: 29 additions & 19 deletions schemas/latest/dependencies-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,11 @@
"anyOf": [
{
"type": "object",
"required": [
"package",
"version"
],
"required": ["package", "version"],
"properties": {
"version": {
"title": "Package version",
"type": [
"string",
"number",
"array"
],
"type": ["string", "number", "array"],
"description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]"
},
"install-prerelease": {
Expand All @@ -47,19 +40,39 @@
"title": "Package identifier",
"type": "string",
"description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions",
"examples": [
"dbt-labs/dbt_utils"
],
"examples": ["dbt-labs/dbt_utils"],
"pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"git"
],
"required": ["private"],
"properties": {
"revision": {
"title": "Revision",
"description": "Pin your package to a specific release by specifying a release name",
"type": "string"
},
"subdirectory": {
"title": "Repo subdirectory",
"description": "Subdirectory of the repo where the dbt package is located",
"type": "string"
},
"private": {
"title": "Package identifier",
"description": "Must be in format `org_name/package_name`. Refer to docs.getdbt.com for installation instructions",
"type": "string",
"examples": ["dbt-labs/private_dbt_utils"],
"pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["git"],
"properties": {
"git": {
"title": "Git URL",
Expand All @@ -80,10 +93,7 @@
},
{
"type": "object",
"required": [
"tarball",
"name"
],
"required": ["tarball", "name"],
"properties": {
"tarball": {
"title": "Internally-hosted tarball URL",
Expand Down
56 changes: 41 additions & 15 deletions schemas/latest/packages-latest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"title": "packages",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"packages"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"packages": {
"type": "array",
Expand All @@ -19,22 +19,22 @@
"properties": {
"version": {
"title": "Package version",
"description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]",
"type": [
"string",
"number",
"array"
],
"description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]"
]
},
"install-prerelease": {
"title": "Install Prerelease",
"type": "boolean",
"description": "Opt in to prerelease versions of a package"
"description": "Opt in to prerelease versions of a package",
"type": "boolean"
},
"package": {
"title": "Package identifier",
"type": "string",
"description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions",
"type": "string",
"examples": [
"dbt-labs/dbt_utils"
],
Expand All @@ -43,6 +43,32 @@
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"private"
],
"properties": {
"revision": {
"title": "Revision",
"description": "Pin your package to a specific release by specifying a release name",
"type": "string"
},
"subdirectory": {
"title": "Repo subdirectory",
"description": "Subdirectory of the repo where the dbt package is located",
"type": "string"
},
"private": {
"title": "Package identifier",
"description": "Must be in format `org_name/package_name`. Refer to docs.getdbt.com for installation instructions",
"type": "string",
"examples": ["dbt-labs/private_dbt_utils"],
"pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand All @@ -55,13 +81,13 @@
},
"revision": {
"title": "Revision",
"type": "string",
"description": "Pin your package to a specific release by specifying a release name"
"description": "Pin your package to a specific release by specifying a release name",
"type": "string"
},
"subdirectory": {
"title": "Subdirectory",
"type": "string",
"description": "Only required if the package is nested in a subdirectory of the git project"
"description": "Only required if the package is nested in a subdirectory of the git project",
"type": "string"
}
},
"additionalProperties": false
Expand All @@ -73,13 +99,13 @@
"name"
],
"properties": {
"name": {
"description": "dbt will create a subdirectory in your `packages-install-path` with this name, and the tarball's source code will be installed here.",
"type": "string"
},
"tarball": {
"title": "Internally-hosted tarball URL",
"type": "string"
},
"name": {
"type": "string",
"description": "dbt will create a subdirectory in your `packages-install-path` with this name, and the tarball's source code will be installed here."
}
},
"additionalProperties": false
Expand All @@ -99,4 +125,4 @@
}
},
"additionalProperties": false
}
}
6 changes: 5 additions & 1 deletion tests/latest/valid/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ projects:

packages:
- package: dbt-labs/dbt-utils
version: 1.0.0
version: 1.0.0

- private: dbt-labs/private_dbt_utils
revision: 1.0.0
subdirectory: mango
6 changes: 5 additions & 1 deletion tests/latest/valid/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ packages:
- local: /opt/dbt/redshift

- tarball: abc123
name: some_package
name: some_package

- private: dbt-labs/private_dbt_utils
revision: 1.0.0
subdirectory: banjo

0 comments on commit a561b58

Please sign in to comment.