Skip to content

Commit

Permalink
refactor: update Joi library
Browse files Browse the repository at this point in the history
This turned out to be quite involved, but it's good to just get it over
with before moving on to any further improvements to our validation.

I had to fork and use the latest master (the fork being to make sure
we have a consistent version) so that we get a recent fix in there. We
should get rid of that once the next release (after 16.1.8) is out.
  • Loading branch information
edvald committed Jan 15, 2020
1 parent 3c3c7d2 commit f35d1a5
Show file tree
Hide file tree
Showing 59 changed files with 952 additions and 877 deletions.
75 changes: 38 additions & 37 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ kind: Project
# The name of the project.
name:

# The default environment to use when calling commands without the `--env` parameter.
# The default environment to use when calling commands without the `--env` parameter. Defaults to
# the first configured environment.
defaultEnvironment: ''

# Specify a list of filenames that should be used as ".ignore" files across the project, using the
Expand Down Expand Up @@ -148,7 +149,7 @@ environments:
# If you don't set the field and the `garden.<env-name>.env` file does not exist,
# we simply ignore it. If you do override the default value and the file doesn't exist, an
# error will be thrown.
varfile: garden.<env-name>.env
varfile:
# A key/value map of variables that modules can reference when using this environment. These
# take precedence over variables defined in the top-level `variables` field.
variables: {}
Expand Down Expand Up @@ -201,7 +202,7 @@ name: "my-sweet-project"

### `defaultEnvironment`

The default environment to use when calling commands without the `--env` parameter.
The default environment to use when calling commands without the `--env` parameter. Defaults to the first configured environment.

| Type | Required | Default |
| -------- | -------- | ------- |
Expand All @@ -213,9 +214,9 @@ Specify a list of filenames that should be used as ".ignore" files across the pr
Note that these take precedence over the project `module.include` field, and module `include` fields, so any paths matched by the .ignore files will be ignored even if they are explicitly specified in those fields.
See the [Configuration Files guide] (https://docs.garden.io/guides/configuration-files#including-excluding-files-and-directories) for details.

| Type | Required | Default |
| --------------- | -------- | -------------------------------- |
| `array[string]` | No | `[".gitignore",".gardenignore"]` |
| Type | Required | Default |
| ------------------ | -------- | -------------------------------- |
| `array[posixPath]` | No | `[".gitignore",".gardenignore"]` |

### `modules`

Expand All @@ -239,9 +240,9 @@ should not be watched for changes.

Also note that specifying an empty list here means _no paths_ should be included.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand Down Expand Up @@ -278,9 +279,9 @@ The `include` field does _not_ affect which files are watched.

See the [Configuration Files guide](https://docs.garden.io/guides/configuration-files#including-excluding-files-and-directories) for details.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand Down Expand Up @@ -360,9 +361,9 @@ The name of the source to import

A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific branch or tag, with the format: <git remote url>#<branch|tag>

| Type | Required |
| -------- | -------- |
| `string` | Yes |
| Type | Required |
| ----------------- | -------- |
| `gitUrl | string` | Yes |

Example:

Expand All @@ -383,9 +384,9 @@ If you do override the default value and the file doesn't exist, an error will b
_Note that in many cases it is advisable to only use environment-specific var files, instead of combining
multiple ones. See the `environments[].varfile` field for this option._

| Type | Required | Default |
| -------- | -------- | -------------- |
| `string` | No | `"garden.env"` |
| Type | Required | Default |
| ----------- | -------- | -------------- |
| `posixPath` | No | `"garden.env"` |

### `variables`

Expand Down Expand Up @@ -460,9 +461,9 @@ _environment-specific_ `variables` field. The file should be in a standard "dote
If you don't set the field and the `garden.<env-name>.env` file does not exist,
we simply ignore it. If you do override the default value and the file doesn't exist, an error will be thrown.

| Type | Required | Default |
| -------- | -------- | ------------------------- |
| `string` | No | `"garden.<env-name>.env"` |
| Type | Required |
| ----------- | -------- |
| `posixPath` | No |

### `environments[].variables`

Expand Down Expand Up @@ -578,7 +579,7 @@ build:
# POSIX-style path or filename to copy the directory or file(s), relative to the build
# directory.
# Defaults to to same as source path.
target: <same as source path>
target: ''
```
## Module configuration keys
Expand Down Expand Up @@ -644,9 +645,9 @@ source tree, which use the same format as `.gitignore` files. See the

Also note that specifying an empty list here means _no sources_ should be included.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand All @@ -670,9 +671,9 @@ Unlike the `modules.exclude` field in the project config, the filters here have
and directories are watched for changes. Use the project `modules.exclude` field to affect those, if you have
large directories that should not be watched for changes.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand All @@ -689,9 +690,9 @@ A remote repository URL. Currently only supports git servers. Must contain a has
Garden will import the repository source code into this module, but read the module's
config from the local garden.yml file.

| Type | Required |
| -------- | -------- |
| `string` | No |
| Type | Required |
| ----------------- | -------- |
| `gitUrl | string` | No |

Example:

Expand Down Expand Up @@ -760,9 +761,9 @@ Specify one or more files or directories to copy from the built dependency to th

POSIX-style path or filename of the directory or file(s) to copy to the target.

| Type | Required |
| -------- | -------- |
| `string` | Yes |
| Type | Required |
| ----------- | -------- |
| `posixPath` | Yes |

### `build.dependencies[].copy[].target`

Expand All @@ -771,8 +772,8 @@ POSIX-style path or filename of the directory or file(s) to copy to the target.
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.

| Type | Required | Default |
| -------- | -------- | ------------------------- |
| `string` | No | `"<same as source path>"` |
| Type | Required | Default |
| ----------- | -------- | ------- |
| `posixPath` | No | `""` |


44 changes: 22 additions & 22 deletions docs/reference/module-types/conftest.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ build:
# POSIX-style path or filename to copy the directory or file(s), relative to the build
# directory.
# Defaults to to same as source path.
target: <same as source path>
target: ''

# Specify a module whose sources we want to test.
sourceModule:
Expand Down Expand Up @@ -177,9 +177,9 @@ source tree, which use the same format as `.gitignore` files. See the

Also note that specifying an empty list here means _no sources_ should be included.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand All @@ -203,9 +203,9 @@ Unlike the `modules.exclude` field in the project config, the filters here have
and directories are watched for changes. Use the project `modules.exclude` field to affect those, if you have
large directories that should not be watched for changes.

| Type | Required |
| --------------- | -------- |
| `array[string]` | No |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | No |

Example:

Expand All @@ -222,9 +222,9 @@ A remote repository URL. Currently only supports git servers. Must contain a has
Garden will import the repository source code into this module, but read the module's
config from the local garden.yml file.

| Type | Required |
| -------- | -------- |
| `string` | No |
| Type | Required |
| ----------------- | -------- |
| `gitUrl | string` | No |

Example:

Expand Down Expand Up @@ -293,9 +293,9 @@ Specify one or more files or directories to copy from the built dependency to th

POSIX-style path or filename of the directory or file(s) to copy to the target.

| Type | Required |
| -------- | -------- |
| `string` | Yes |
| Type | Required |
| ----------- | -------- |
| `posixPath` | Yes |

### `build.dependencies[].copy[].target`

Expand All @@ -304,9 +304,9 @@ POSIX-style path or filename of the directory or file(s) to copy to the target.
POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
Defaults to to same as source path.

| Type | Required | Default |
| -------- | -------- | ------------------------- |
| `string` | No | `"<same as source path>"` |
| Type | Required | Default |
| ----------- | -------- | ------- |
| `posixPath` | No | `""` |

### `sourceModule`

Expand All @@ -322,9 +322,9 @@ POSIX-style path to a directory containing the policies to match the config agai
Must be a relative path, and should in most cases be within the project root.
Defaults to the `policyPath` set in the provider config.

| Type | Required |
| -------- | -------- |
| `string` | No |
| Type | Required |
| ----------- | -------- |
| `posixPath` | No |

### `namespace`

Expand All @@ -338,9 +338,9 @@ The policy namespace in which to find _deny_ and _warn_ rules.

A list of files to test with the given policy. Must be POSIX-style paths, and may include wildcards.

| Type | Required |
| --------------- | -------- |
| `array[string]` | Yes |
| Type | Required |
| ------------------ | -------- |
| `array[posixPath]` | Yes |


## Outputs
Expand Down
Loading

0 comments on commit f35d1a5

Please sign in to comment.