Commit Graph

1215 Commits

Author SHA1 Message Date
Andrew Nester f3db42e622
Added support for top-level permissions (#928)
## Changes
Now it's possible to define top level `permissions` section in bundle
configuration and permissions defined there will be applied to all
resources defined in the bundle.

Supported top-level permission levels: CAN_MANAGE, CAN_VIEW, CAN_RUN.

Permissions are applied to: Jobs, DLT Pipelines, ML Models, ML
Experiments and Model Service Endpoints

```
bundle:
  name: permissions

workspace:
  host: ***

permissions:
  - level: CAN_VIEW
    group_name: test-group
  - level: CAN_MANAGE
    user_name: user@company.com
  - level: CAN_RUN
    service_principal_name: 123456-abcdef
```

## Tests
Added corresponding unit tests + ran `bundle validate` and `bundle
deploy` manually
2023-11-13 11:29:40 +00:00
dependabot[bot] 14d2d0a2d5
Bump github.com/hashicorp/terraform-json from 0.17.1 to 0.18.0 (#979)
Bumps
[github.com/hashicorp/terraform-json](https://github.com/hashicorp/terraform-json)
from 0.17.1 to 0.18.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hashicorp/terraform-json/releases">github.com/hashicorp/terraform-json's
releases</a>.</em></p>
<blockquote>
<h2>v0.18.0</h2>
<p>NOTES:</p>
<ul>
<li>Update README to explain when not to use this library by <a
href="https://github.com/alisdair"><code>@​alisdair</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/104">hashicorp/terraform-json#104</a></li>
</ul>
<p>ENHANCEMENTS:</p>
<ul>
<li>Add PreviousAddress field to ResourceChange to support moved block
by <a href="https://github.com/takaishi"><code>@​takaishi</code></a> in
<a
href="https://redirect.github.com/hashicorp/terraform-json/pull/95">hashicorp/terraform-json#95</a></li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>Fixed typing of check results in statefiles by <a
href="https://github.com/Yantrio"><code>@​Yantrio</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/101">hashicorp/terraform-json#101</a></li>
</ul>
<p>INTERNAL:</p>
<ul>
<li>Bump actions/setup-go from 4.0.1 to 4.1.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/98">hashicorp/terraform-json#98</a></li>
<li>Bump github.com/zclconf/go-cty from 1.13.2 to 1.13.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/99">hashicorp/terraform-json#99</a></li>
<li>Bump actions/checkout from 3.5.3 to 3.6.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/100">hashicorp/terraform-json#100</a></li>
<li>Bump github.com/zclconf/go-cty from 1.13.3 to 1.14.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/102">hashicorp/terraform-json#102</a></li>
<li>Bump actions/checkout from 3.6.0 to 4.0.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/103">hashicorp/terraform-json#103</a></li>
<li>Bump actions/checkout from 4.0.0 to 4.1.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/105">hashicorp/terraform-json#105</a></li>
<li>Bump github.com/zclconf/go-cty from 1.14.0 to 1.14.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/107">hashicorp/terraform-json#107</a></li>
<li>Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/109">hashicorp/terraform-json#109</a></li>
<li>Bump actions/checkout from 4.1.0 to 4.1.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/110">hashicorp/terraform-json#110</a></li>
</ul>
<p>New Contributors</p>
<ul>
<li><a href="https://github.com/Yantrio"><code>@​Yantrio</code></a> made
their first contribution in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/101">hashicorp/terraform-json#101</a></li>
<li><a href="https://github.com/takaishi"><code>@​takaishi</code></a>
made their first contribution in <a
href="https://redirect.github.com/hashicorp/terraform-json/pull/95">hashicorp/terraform-json#95</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ac10835baa"><code>ac10835</code></a>
Bump actions/checkout from 4.1.0 to 4.1.1 (<a
href="https://redirect.github.com/hashicorp/terraform-json/issues/110">#110</a>)</li>
<li><a
href="39a2ed7578"><code>39a2ed7</code></a>
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 (<a
href="https://redirect.github.com/hashicorp/terraform-json/issues/109">#109</a>)</li>
<li><a
href="d379256c5c"><code>d379256</code></a>
Bump github.com/zclconf/go-cty from 1.14.0 to 1.14.1 (<a
href="https://redirect.github.com/hashicorp/terraform-json/issues/107">#107</a>)</li>
<li><a
href="33462c328a"><code>33462c3</code></a>
Bump actions/checkout from 4.0.0 to 4.1.0 (<a
href="https://redirect.github.com/hashicorp/terraform-json/issues/105">#105</a>)</li>
<li><a
href="e58a208c0a"><code>e58a208</code></a>
Merge pull request <a
href="https://redirect.github.com/hashicorp/terraform-json/issues/104">#104</a>
from hashicorp/alisdair/should-i-use-this-library</li>
<li><a
href="25b978a498"><code>25b978a</code></a>
Update README.md</li>
<li><a
href="a4dc39dcf4"><code>a4dc39d</code></a>
Update README.md</li>
<li><a
href="9aff8f04b5"><code>9aff8f0</code></a>
Fix typo</li>
<li><a
href="9901d28699"><code>9901d28</code></a>
Add PreviousAddress field to ResourceChange to support moved block (<a
href="https://redirect.github.com/hashicorp/terraform-json/issues/95">#95</a>)</li>
<li><a
href="a7fb8270ef"><code>a7fb827</code></a>
Update README to explain when not to use this library</li>
<li>Additional commits viewable in <a
href="https://github.com/hashicorp/terraform-json/compare/v0.17.1...v0.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/hashicorp/terraform-json&package-manager=go_modules&previous-version=0.17.1&new-version=0.18.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 11:18:16 +00:00
dependabot[bot] ef76fe02f0
Bump golang.org/x/term from 0.13.0 to 0.14.0 (#981)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.13.0 to
0.14.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="70d3a0bd3f"><code>70d3a0b</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="6a610bc55b"><code>6a610bc</code></a>
all: update go directive to 1.18</li>
<li>See full diff in <a
href="https://github.com/golang/term/compare/v0.13.0...v0.14.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/term&package-manager=go_modules&previous-version=0.13.0&new-version=0.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 11:14:08 +00:00
Andrew Nester ea4153e323
Fixed flaky TestBackgroundCombinedOutputFailure (#978)
## Changes
`TestBackgroundCombinedOutputFailure` was occasionally failing because
combined output could have been in different order, see


https://github.com/databricks/cli/actions/runs/6823883271/job/18558675165?pr=928
2023-11-10 14:09:02 +00:00
Ilia Babanov e82a49b4e9
Make `databricks configure` save only explicit fields (#973)
## Changes
Save only explicit fields to the config file
This applies to two commands: `configure` and `auth login`. 
The latter only pulls env vars in the case of the `--configure-cluster`
flag

## Tests
Manual, plus additional unit test for the `configure` command
2023-11-10 14:03:57 +00:00
shreyas-goenka f208853626
Fix integration test asserting errors on unknown template parameters (#977)
## Changes
Recent descriptions were made mandatory for input parameters so this
test started failing.

## Tests
The test passes now.
2023-11-10 11:05:32 +00:00
Serge Smertin 3284a8c56c
Improved usability of `databricks auth login ... --configure-cluster` flow by displaying cluster type and runtime version (#956)
This PR adds selectors for Databricks-connect compatible clusters and
SQL warehouses

Tested in https://github.com/databricks/cli/pull/914
2023-11-09 16:38:45 +00:00
Serge Smertin f111b0846e
Added process stubbing for easier testing of launched subprocesses (#963)
## Changes

This PR makes unit testing with subprocesses fast.

```
	ctx := context.Background()
	ctx, stub := process.WithStub(ctx)
	stub.WithDefaultOutput("meeee")

	ctx = env.Set(ctx, "FOO", "bar")

	out, err := process.Background(ctx, []string{"/usr/local/bin/meeecho", "1", "--foo", "bar"})
	require.NoError(t, err)
	require.Equal(t, "meeee", out)
	require.Equal(t, 1, stub.Len())
	require.Equal(t, []string{"meeecho 1 --foo bar"}, stub.Commands())

	allEnv := stub.CombinedEnvironment()
	require.Equal(t, "bar", allEnv["FOO"])
	require.Equal(t, "bar", stub.LookupEnv("FOO"))
```

This should make further iterations of
https://github.com/databricks/cli/pull/914 easier

## Tests

`make test`
2023-11-09 14:24:05 +00:00
Serge Smertin d4c0027556
Add `--debug` as shortcut for `--log-level debug` (#964)
## Changes
This PR exposes simpler interfaces to end users.

## Tests
<img width="724" alt="image"
src="https://github.com/databricks/cli/assets/259697/8bd25110-33f0-4197-8f00-2b8198c4aba6">
2023-11-09 10:40:47 +00:00
shreyas-goenka d4d4b7480f
Do not allow empty descriptions for bundle template inputs (#967)
## Changes
We rely on the descriptions to render the prompts to a user. Thus we
should not allow empty descriptions here. Note, both mlops stacks and
the default-python template have descriptions for all their properties
so this should not be an issue.

## Tests
Unit test
2023-11-08 16:48:37 +00:00
Andrew Nester b72f2a9604
Release v0.209.1 (#969)
CLI:
* Hide `--progress-format` global flag
([#965](https://github.com/databricks/cli/pull/965)).
* Make configure command visible + fix bundle command description
([#961](https://github.com/databricks/cli/pull/961)).
* Log process ID in each log entry
([#949](https://github.com/databricks/cli/pull/949)).
* Improve error message when `--json` flag is specified
([#933](https://github.com/databricks/cli/pull/933)).

Bundles:
* Remove validation for default value against pattern
([#959](https://github.com/databricks/cli/pull/959)).
* Bundle path rewrites for dbt and SQL file tasks
([#962](https://github.com/databricks/cli/pull/962)).
* Initialize variable definitions that are defined without properties
([#966](https://github.com/databricks/cli/pull/966)).

Internal:
* Function to merge two instances of `config.Value`
([#938](https://github.com/databricks/cli/pull/938)).
* Make to/from string methods private to the jsonschema package
([#942](https://github.com/databricks/cli/pull/942)).
* Make Cobra runner compatible with testing interactive flows
([#957](https://github.com/databricks/cli/pull/957)).
* Added `env.UserHomeDir(ctx)` for parallel-friendly tests
([#955](https://github.com/databricks/cli/pull/955)).


Dependency updates:
* Bump golang.org/x/mod from 0.13.0 to 0.14.0
([#954](https://github.com/databricks/cli/pull/954)).
* Bump golang.org/x/text from 0.13.0 to 0.14.0
([#953](https://github.com/databricks/cli/pull/953)).
* Bump golang.org/x/sync from 0.4.0 to 0.5.0
([#951](https://github.com/databricks/cli/pull/951)).
* Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
([#950](https://github.com/databricks/cli/pull/950)).
* Bump github.com/fatih/color from 1.15.0 to 1.16.0
([#952](https://github.com/databricks/cli/pull/952)).
2023-11-08 16:30:48 +00:00
Andrew Nester 47e434db2f
Improve error message when `--json` flag is specified (#933)
## Changes
Improve error message when --json input is provided

## Tests
```
cli % databricks model-registry create-model mymodel --json @./input.json              
Error: when --json flag is specified, no positional arguments are required. Provide NAME in your JSON input
```
2023-11-08 15:07:29 +00:00
Serge Smertin e68a88e14d
Added `env.UserHomeDir(ctx)` for parallel-friendly tests (#955)
## Changes
`os.Getenv(..)` is not friendly with `libs/env`. This PR makes the
relevant changes to places where we need to read user home directory.

## Tests
Mainly done in https://github.com/databricks/cli/pull/914
2023-11-08 14:50:20 +00:00
Pieter Noordhuis 7847388f95
Initialize variable definitions that are defined without properties (#966)
## Changes

We can debate whether or not variable definitions without properties are
valid, but in no case should this panic the CLI.

Fixes #934.

## Tests

Unit.
2023-11-08 11:01:14 +00:00
Ilia Babanov 65dd9c5c0f
Log process ID in each log entry (#949)
## Changes
This will help differentiate multiple cli commands that write to the
same log file.
Noticed that the root module wasn't using the common log utilities,
refactored it to avoid missing log arguments.
Relevant PR on the databricks vscode extension side:
https://github.com/databricks/databricks-vscode/pull/923

## Tests
Tested manually for sdk and cli loggers
2023-11-08 08:51:01 +00:00
Serge Smertin 7509e4d55a
Hide `--progress-format` global flag (#965)
## Changes
At the moment, these flags are mostly used for VSCode integration for
bundles, but they're not effective for the majority of commands.

## Tests
<img width="559" alt="image"
src="https://github.com/databricks/cli/assets/259697/15ddd322-f746-48ad-b1ce-35c55e664a06">
2023-11-08 08:29:22 +00:00
Andrew Nester f07832746b
Make configure command visible + fix bundle command description (#961)
## Changes
Fixes #936 #937
2023-11-08 07:33:40 +00:00
Michał Szafrański 10291b0e13
Bundle path rewrites for dbt and SQL file tasks (#962)
## Changes
Support path rewrites for Dbt and SQL file job taks.
<!-- Summary of your changes that are easy to understand -->

## Tests
* Added unit test
<!-- How is this tested? -->
2023-11-07 20:00:09 +00:00
Serge Smertin 56bcb6f833
Make Cobra runner compatible with testing interactive flows (#957)
## Changes
This PR enables testing commands with stdin

## Tests
https://github.com/databricks/cli/pull/914
2023-11-07 19:06:27 +00:00
shreyas-goenka 283f24179d
Remove validation for default value against pattern (#959)
## Changes
This PR removes validation for default value against the regex pattern
specified in a JSON schema at schema load time. This is required because
https://github.com/databricks/cli/pull/795 introduces parameterising the
default value as a Go text template impling that the default value now
does not necessarily have to match the pattern at schema load time.

This will also unblock:
https://github.com/databricks/mlops-stacks/pull/108

Note, this does not remove runtime validation for input parameters right
before template initialization, which happens here:
fb32e78c9b/libs/template/materialize.go (L76)

## Tests
Changes to existing test.
2023-11-07 12:35:59 +00:00
dependabot[bot] 677f28e2fb
Bump github.com/fatih/color from 1.15.0 to 1.16.0 (#952)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from
1.15.0 to 1.16.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/fatih/color/releases">github.com/fatih/color's
releases</a>.</em></p>
<blockquote>
<h2>v1.16.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update dependabot.yml by <a
href="https://github.com/ilyabrin"><code>@​ilyabrin</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/200">fatih/color#200</a></li>
<li>color: add newline after wrapping text by <a
href="https://github.com/fatih"><code>@​fatih</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/192">fatih/color#192</a></li>
<li>[Test] Nil check added by <a
href="https://github.com/hyunsooda"><code>@​hyunsooda</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/203">fatih/color#203</a></li>
<li>fixes <a
href="https://redirect.github.com/fatih/color/issues/206">#206</a>
(using underline with a different fg color breaks) by <a
href="https://github.com/gregpoirson"><code>@​gregpoirson</code></a> in
<a
href="https://redirect.github.com/fatih/color/pull/210">fatih/color#210</a></li>
</ul>
<h3>Dependency updates</h3>
<ul>
<li>Bump dominikh/staticcheck-action from 1.2.0 to 1.3.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/201">fatih/color#201</a></li>
<li>Bump github.com/mattn/go-isatty from 0.0.17 to 0.0.18 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/193">fatih/color#193</a></li>
<li>Bump golang.org/x/sys from 0.6.0 to 0.8.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/195">fatih/color#195</a></li>
<li>Bump github.com/mattn/go-isatty from 0.0.18 to 0.0.19 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/196">fatih/color#196</a></li>
<li>Bump golang.org/x/sys from 0.8.0 to 0.10.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/199">fatih/color#199</a></li>
<li>Bump github.com/mattn/go-isatty from 0.0.19 to 0.0.20 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/212">fatih/color#212</a></li>
<li>Bump golang.org/x/sys from 0.10.0 to 0.13.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/209">fatih/color#209</a></li>
<li>Bump actions/setup-go from 3 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/202">fatih/color#202</a></li>
<li>Bump actions/checkout from 3 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/208">fatih/color#208</a></li>
<li>Bump golang.org/x/sys from 0.13.0 to 0.14.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/fatih/color/pull/213">fatih/color#213</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/ilyabrin"><code>@​ilyabrin</code></a>
made their first contribution in <a
href="https://redirect.github.com/fatih/color/pull/200">fatih/color#200</a></li>
<li><a href="https://github.com/hyunsooda"><code>@​hyunsooda</code></a>
made their first contribution in <a
href="https://redirect.github.com/fatih/color/pull/203">fatih/color#203</a></li>
<li><a
href="https://github.com/gregpoirson"><code>@​gregpoirson</code></a>
made their first contribution in <a
href="https://redirect.github.com/fatih/color/pull/210">fatih/color#210</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/fatih/color/compare/v1.15.0...v1.16.0">https://github.com/fatih/color/compare/v1.15.0...v1.16.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0f9779ed47"><code>0f9779e</code></a>
Merge pull request <a
href="https://redirect.github.com/fatih/color/issues/213">#213</a> from
fatih/dependabot/go_modules/golang.org/x/sys-0.14.0</li>
<li><a
href="0c78604296"><code>0c78604</code></a>
Bump golang.org/x/sys from 0.13.0 to 0.14.0</li>
<li><a
href="96e0f73dae"><code>96e0f73</code></a>
Merge pull request <a
href="https://redirect.github.com/fatih/color/issues/208">#208</a> from
fatih/dependabot/github_actions/actions/checkout-4</li>
<li><a
href="4c66e32708"><code>4c66e32</code></a>
Bump actions/checkout from 3 to 4</li>
<li><a
href="2fb03d682e"><code>2fb03d6</code></a>
Merge pull request <a
href="https://redirect.github.com/fatih/color/issues/202">#202</a> from
fatih/dependabot/github_actions/actions/setup-go-4</li>
<li><a
href="8ba7bbdda9"><code>8ba7bbd</code></a>
Bump actions/setup-go from 3 to 4</li>
<li><a
href="e3f97f3408"><code>e3f97f3</code></a>
Merge pull request <a
href="https://redirect.github.com/fatih/color/issues/209">#209</a> from
fatih/dependabot/go_modules/golang.org/x/sys-0.13.0</li>
<li><a
href="e146575883"><code>e146575</code></a>
Bump golang.org/x/sys from 0.10.0 to 0.13.0</li>
<li><a
href="d2d7a5e448"><code>d2d7a5e</code></a>
Merge pull request <a
href="https://redirect.github.com/fatih/color/issues/212">#212</a> from
fatih/dependabot/go_modules/github.com/mattn/go-...</li>
<li><a
href="f3e45da2c8"><code>f3e45da</code></a>
Merge branch 'main' into
dependabot/go_modules/github.com/mattn/go-isatty-0.0.20</li>
<li>Additional commits viewable in <a
href="https://github.com/fatih/color/compare/v1.15.0...v1.16.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/fatih/color&package-manager=go_modules&previous-version=1.15.0&new-version=1.16.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 12:02:55 +00:00
dependabot[bot] 4b18f117d3
Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#950)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from
1.7.0 to 1.8.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/spf13/cobra/releases">github.com/spf13/cobra's
releases</a>.</em></p>
<blockquote>
<h2>v1.8.0</h2>
<h2> Features</h2>
<ul>
<li>Support usage as plugin for tools like kubectl by <a
href="https://github.com/nirs"><code>@​nirs</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2018">spf13/cobra#2018</a>
- this means that programs that utilize a &quot;plugin-like&quot;
structure have much better support and usage (like for completions,
command paths, etc.)</li>
<li>Move documentation sources to site/content by <a
href="https://github.com/umarcor"><code>@​umarcor</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1428">spf13/cobra#1428</a></li>
<li>Add 'one required flag' group by <a
href="https://github.com/marevers"><code>@​marevers</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1952">spf13/cobra#1952</a>
- this includes a new <code>MarkFlagsOneRequired</code> API for flags
which can be used to mark a flag group as required and cause command
failure if at least one is not used when invoked.</li>
<li>Customizable error message prefix by <a
href="https://github.com/5ouma"><code>@​5ouma</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2023">spf13/cobra#2023</a>
- This adds the <code>SetErrPrefix</code> and <code>ErrPrefix</code>
APIs on the <code>Command</code> struct to allow for setting a custom
prefix for errors</li>
<li>feat: add getters for flag completions by <a
href="https://github.com/avirtopeanu-ionos"><code>@​avirtopeanu-ionos</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/1943">spf13/cobra#1943</a></li>
<li>Feature: allow running persistent run hooks of all parents by <a
href="https://github.com/vkhoroz"><code>@​vkhoroz</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2044">spf13/cobra#2044</a></li>
<li>Improve API to get flag completion function by <a
href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> in
<a
href="https://redirect.github.com/spf13/cobra/pull/2063">spf13/cobra#2063</a></li>
</ul>
<h2>🐛 Bug fixes</h2>
<ul>
<li>Fix typo in fish completions by <a
href="https://github.com/twpayne"><code>@​twpayne</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1945">spf13/cobra#1945</a></li>
<li>Fix grammar: 'allows to' by <a
href="https://github.com/supertassu"><code>@​supertassu</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1978">spf13/cobra#1978</a></li>
<li>powershell: escape variable with curly brackets by <a
href="https://github.com/Luap99"><code>@​Luap99</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1960">spf13/cobra#1960</a></li>
<li>Don't complete --help flag when flag parsing disabled by <a
href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> in
<a
href="https://redirect.github.com/spf13/cobra/pull/2061">spf13/cobra#2061</a></li>
<li>Replace all non-alphanumerics in active help env var program prefix
by <a href="https://github.com/scop"><code>@​scop</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1940">spf13/cobra#1940</a></li>
</ul>
<h2>🔧 Maintenance</h2>
<ul>
<li>build(deps): bump golangci/golangci-lint-action from 3.4.0 to 3.5.0
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/1971">spf13/cobra#1971</a></li>
<li>build(deps): bump golangci/golangci-lint-action from 3.5.0 to 3.6.0
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/1976">spf13/cobra#1976</a></li>
<li>build(deps): bump golangci/golangci-lint-action from 3.6.0 to 3.7.0
by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/2021">spf13/cobra#2021</a></li>
<li>build(deps): bump actions/setup-go from 3 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1934">spf13/cobra#1934</a></li>
<li>build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.2 to
2.0.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2047">spf13/cobra#2047</a></li>
<li>build(deps): bump actions/checkout from 3 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2028">spf13/cobra#2028</a></li>
<li>command: temporarily disable G602 due to <a
href="https://redirect.github.com/securego/gosec/issues/1005">securego/gosec#1005</a>
by <a href="https://github.com/umarcor"><code>@​umarcor</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2022">spf13/cobra#2022</a></li>
</ul>
<h2>🧪 Testing &amp; CI/CD</h2>
<ul>
<li>test: make fish_completions_test more robust by <a
href="https://github.com/branchvincent"><code>@​branchvincent</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/1980">spf13/cobra#1980</a></li>
<li>golangci: enable 'unused' and disable deprecated replaced by it by
<a href="https://github.com/umarcor"><code>@​umarcor</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/1983">spf13/cobra#1983</a></li>
<li>cleanup: minor corrections to unit tests by <a
href="https://github.com/JunNishimura"><code>@​JunNishimura</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/2003">spf13/cobra#2003</a></li>
<li>ci: test golang 1.21 by <a
href="https://github.com/nunoadrego"><code>@​nunoadrego</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2024">spf13/cobra#2024</a></li>
<li>Fix linter errors by <a
href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> in
<a
href="https://redirect.github.com/spf13/cobra/pull/2052">spf13/cobra#2052</a></li>
<li>Add tests for flag completion registration by <a
href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> in
<a
href="https://redirect.github.com/spf13/cobra/pull/2053">spf13/cobra#2053</a></li>
</ul>
<h2>✏️ Documentation</h2>
<ul>
<li>doc: fix typo, Deperecated -&gt; Deprecated by <a
href="https://github.com/callthingsoff"><code>@​callthingsoff</code></a>
in <a
href="https://redirect.github.com/spf13/cobra/pull/2000">spf13/cobra#2000</a></li>
<li>Add notes to doc about the execution condition of *PreRun and
*PostRun functions by <a
href="https://github.com/haoming29"><code>@​haoming29</code></a> in <a
href="https://redirect.github.com/spf13/cobra/pull/2041">spf13/cobra#2041</a></li>
</ul>
<hr />
<p>Thank you everyone who contributed to this release and all your hard
work! Cobra and this community would never be possible without all of
you!!!! 🐍</p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0">https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a0a6ae020b"><code>a0a6ae0</code></a>
Improve API to get flag completion function (<a
href="https://redirect.github.com/spf13/cobra/issues/2063">#2063</a>)</li>
<li><a
href="890302a35f"><code>890302a</code></a>
Support usage as plugin for tools like kubectl (<a
href="https://redirect.github.com/spf13/cobra/issues/2018">#2018</a>)</li>
<li><a
href="48cea5c87b"><code>48cea5c</code></a>
build(deps): bump actions/checkout from 3 to 4 (<a
href="https://redirect.github.com/spf13/cobra/issues/2028">#2028</a>)</li>
<li><a
href="22953d8845"><code>22953d8</code></a>
Replace all non-alphanumerics in active help env var program prefix (<a
href="https://redirect.github.com/spf13/cobra/issues/1940">#1940</a>)</li>
<li><a
href="00b68a1c26"><code>00b68a1</code></a>
Add tests for flag completion registration (<a
href="https://redirect.github.com/spf13/cobra/issues/2053">#2053</a>)</li>
<li><a
href="b711e8760b"><code>b711e87</code></a>
Don't complete --help flag when flag parsing disabled (<a
href="https://redirect.github.com/spf13/cobra/issues/2061">#2061</a>)</li>
<li><a
href="8b1eba4761"><code>8b1eba4</code></a>
Fix linter errors (<a
href="https://redirect.github.com/spf13/cobra/issues/2052">#2052</a>)</li>
<li><a
href="4cafa37bc4"><code>4cafa37</code></a>
Allow running persistent run hooks of all parents (<a
href="https://redirect.github.com/spf13/cobra/issues/2044">#2044</a>)</li>
<li><a
href="5c962a221e"><code>5c962a2</code></a>
build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.2 to 2.0.3
(<a
href="https://redirect.github.com/spf13/cobra/issues/2047">#2047</a>)</li>
<li><a
href="efe8fa3e44"><code>efe8fa3</code></a>
build(deps): bump actions/setup-go from 3 to 4 (<a
href="https://redirect.github.com/spf13/cobra/issues/1934">#1934</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/cobra&package-manager=go_modules&previous-version=1.7.0&new-version=1.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 10:20:51 +00:00
dependabot[bot] 83820a3a67
Bump golang.org/x/sync from 0.4.0 to 0.5.0 (#951)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.4.0 to
0.5.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="10739b037d"><code>10739b0</code></a>
all: update go directive to 1.18</li>
<li>See full diff in <a
href="https://github.com/golang/sync/compare/v0.4.0...v0.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/sync&package-manager=go_modules&previous-version=0.4.0&new-version=0.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 10:20:32 +00:00
dependabot[bot] b5a438ea62
Bump golang.org/x/text from 0.13.0 to 0.14.0 (#953)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.13.0 to
0.14.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6c97a165dd"><code>6c97a16</code></a>
all: update go directive to 1.18</li>
<li>See full diff in <a
href="https://github.com/golang/text/compare/v0.13.0...v0.14.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/text&package-manager=go_modules&previous-version=0.13.0&new-version=0.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 10:20:12 +00:00
dependabot[bot] 9eec6da29b
Bump golang.org/x/mod from 0.13.0 to 0.14.0 (#954)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.13.0 to
0.14.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6e58e47c7b"><code>6e58e47</code></a>
modfile: improve directory path detection and error text
consistency</li>
<li>See full diff in <a
href="https://github.com/golang/mod/compare/v0.13.0...v0.14.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/mod&package-manager=go_modules&previous-version=0.13.0&new-version=0.14.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 10:20:01 +00:00
shreyas-goenka fb32e78c9b
Make to/from string methods private to the jsonschema package (#942)
## Changes
This PR makes a few methods private, exposing cleaner interfaces to get
the string representations for enums and default values of a JSON
Schema.

## Tests
Manually, template initialization for the `default-python` template
still works as expected.
2023-11-06 15:05:17 +00:00
Pieter Noordhuis 8e1156edbd
Function to merge two instances of `config.Value` (#938)
## Changes

Semantics for merging two instances of `config.Value`:
* Merging x with nil or nil with x always yields x
* Merging maps a and b means entries from map b take precedence
* Merging sequences a and b means concatenating them

These are the same semantics that we use today when calling into mergo
in `bundle/config`.

## Tests

Unit tests pass.
2023-11-03 19:15:47 +00:00
shreyas-goenka 401ae3dc99
Remove mention of Lakehouse apps from the changelog (#945) 2023-11-02 17:35:17 +00:00
shreyas-goenka 51d41d6c44
Release v0.209.0 (#944)
CLI:
* Added GitHub issue templates for CLI and DABs issues
([#925](https://github.com/databricks/cli/pull/925)).
* Added override to support YAML inputs for apps
([#921](https://github.com/databricks/cli/pull/921)).
* Simplified code generation logic for handling path and request body
parameters and JSON input
([#905](https://github.com/databricks/cli/pull/905)).


Bundles:
* Fixed URL for bundle template documentation in init command help docs
([#903](https://github.com/databricks/cli/pull/903)).
* Fixed pattern validation for input parameters in a bundle template
([#912](https://github.com/databricks/cli/pull/912)).
* Fixed multiline description rendering for enum input parameters in
bundle templates ([#916](https://github.com/databricks/cli/pull/916)).
* Changed production mode check for whether identity used is a service
principal to use UserName
([#924](https://github.com/databricks/cli/pull/924)).
* Changed bundle deploy to upload partial terraform state even if
deployment fails ([#923](https://github.com/databricks/cli/pull/923)).
* Added support for welcome messages to bundle templates
([#907](https://github.com/databricks/cli/pull/907)).
* Added support for uploading bundle deployment metadata to WSFS
([#845](https://github.com/databricks/cli/pull/845)).


Internal:
* Loading an empty yaml file yields a nil
([#906](https://github.com/databricks/cli/pull/906)).
* Library to convert config.Value to Go struct
([#904](https://github.com/databricks/cli/pull/904)).
* Remove default resolution of repo names against the Databricks Github
account([#940](https://github.com/databricks/cli/pull/940)).
* Run make fmt from fmt job
([#929](https://github.com/databricks/cli/pull/929)).
* `make snapshot` to build file in `.databricks/databricks`
([#927](https://github.com/databricks/cli/pull/927)).
* Add configuration normalization code
([#915](https://github.com/databricks/cli/pull/915)).

API Changes:
 * Added `databricks apps` command group.
 * Added `databricks account network-policy` command group.

Dependency updates:
* Bump Terraform provider from v1.28.0 to v1.29.0
([#926](https://github.com/databricks/cli/pull/926)).
* Bump the Go SDK in the CLI from v0.23 to v0.24
([#919](https://github.com/databricks/cli/pull/919)).
* Bump google.golang.org/grpc from 1.58.2 to 1.58.3
([#920](https://github.com/databricks/cli/pull/920)).
* Bump github.com/google/uuid from 1.3.1 to 1.4.0
([#932](https://github.com/databricks/cli/pull/932)).

OpenAPI commit 5903bb39137fd76ac384b2044e425f9c56840e00 (2023-10-23)
2023-11-02 15:43:41 +00:00
shreyas-goenka b6aa4631f1
Fix metadata computation for empty bundle (#939)
## Changes
This PR fixes metadata computation for empty bundle. Before we would
error because the `terraform.Load()` mutator errors on a empty / no
state file.

## Tests
Failing integration tests now pass.
2023-11-02 11:00:30 +00:00
shreyas-goenka d70d7445c4
Remove resolution of repo names against the Databricks Github account (#940)
## Changes
This functionality is not exercised (and will not be anytime soon).
Instead we use a map to have first party aliases for supported
templates.


1e46b9f88a/cmd/bundle/init.go (L21)

## Tests
Existing tests and manually, bundle init still works.
2023-11-01 13:02:06 +00:00
dependabot[bot] 1e46b9f88a
Bump github.com/google/uuid from 1.3.1 to 1.4.0 (#932)
Bumps [github.com/google/uuid](https://github.com/google/uuid) from
1.3.1 to 1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/google/uuid/releases">github.com/google/uuid's
releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<h2><a
href="https://github.com/google/uuid/compare/v1.3.1...v1.4.0">1.4.0</a>
(2023-10-26)</h2>
<h3>Features</h3>
<ul>
<li>UUIDs slice type with Strings() convenience method (<a
href="https://redirect.github.com/google/uuid/issues/133">#133</a>) (<a
href="cd5fbbdd02">cd5fbbd</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Clarify that Parse's job is to parse but not necessarily validate
strings. (Documents current behavior)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/google/uuid/blob/master/CHANGELOG.md">github.com/google/uuid's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/google/uuid/compare/v1.3.1...v1.4.0">1.4.0</a>
(2023-10-26)</h2>
<h3>Features</h3>
<ul>
<li>UUIDs slice type with Strings() convenience method (<a
href="https://redirect.github.com/google/uuid/issues/133">#133</a>) (<a
href="cd5fbbdd02">cd5fbbd</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Clarify that Parse's job is to parse but not necessarily validate
strings. (Documents current behavior)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8de8764e29"><code>8de8764</code></a>
chore(master): release 1.4.0 (<a
href="https://redirect.github.com/google/uuid/issues/134">#134</a>)</li>
<li><a
href="7c22e97ff7"><code>7c22e97</code></a>
Clarify the documentation of Parse to state its job is to parse, not
validate...</li>
<li><a
href="cd5fbbdd02"><code>cd5fbbd</code></a>
feat: UUIDs slice type with Strings() convenience method (<a
href="https://redirect.github.com/google/uuid/issues/133">#133</a>)</li>
<li><a
href="47f5b3936c"><code>47f5b39</code></a>
docs: fix a typo in CONTRIBUTING.md (<a
href="https://redirect.github.com/google/uuid/issues/130">#130</a>)</li>
<li><a
href="542ddabd47"><code>542ddab</code></a>
chore(tests): add Fuzz tests (<a
href="https://redirect.github.com/google/uuid/issues/128">#128</a>)</li>
<li><a
href="06716f6a60"><code>06716f6</code></a>
chore(tests): Add json.Unmarshal test with empty value cases (<a
href="https://redirect.github.com/google/uuid/issues/116">#116</a>)</li>
<li>See full diff in <a
href="https://github.com/google/uuid/compare/v1.3.1...v1.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/google/uuid&package-manager=go_modules&previous-version=1.3.1&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-30 11:26:06 +00:00
shreyas-goenka 82a71ef33b
Add GitHub issue templates (#925)
This PR adds a few github issue templates, allowing customers to give
feedback and report issues in a more structured way.
2023-10-30 11:26:01 +00:00
Taiga Matsumoto e408b701ac
Add override to support YAML inputs for apps (#921)
## Changes
<!-- Summary of your changes that are easy to understand -->

Take @andrefurlan-db 's original
[commit](https://github.com/databricks/cli/compare/databricks:6e21ced...andrefurlan-db:12ed10c)
to add `apps` support to the CLI and add the yaml file-support as an
override (the apps routes are already apart of the Go SDK and are
available for use in the CLI)

**NOTE: this feature is still private preview. CLI usage will be
internal only**

## Tests
<!-- How is this tested? -->
2023-10-27 18:57:26 +00:00
Pieter Noordhuis b91fab7d09
Run make fmt from fmt job (#929)
## Changes

I noticed we weren't running `goimports` from our formatting job. If we
run `make fmt`, we do.

## Tests

The fmt job passes.
2023-10-27 15:43:44 +00:00
shreyas-goenka 5a8cd0c5bc
Persist deployment metadata in WSFS (#845)
## Changes

This PR introduces a metadata struct that stores a subset of bundle
configuration that we wish to expose to other Databricks services that
wish to integrate with bundles.

This metadata file is uploaded to a file
`${bundle.workspace.state_path}/metadata.json` in the WSFS destination
of the bundle deployment.

Documentation for emitted metadata fields:
* `version`: Version for the metadata file schema
* `config.bundle.git.branch`: Name of the git branch the bundle was
deployed from.
* `config.bundle.git.origin_url`: URL for git remote "origin"
* `config.bundle.git.bundle_root_path`: Relative path of the bundle root
from the root of the git repository. Is set to "." if they are the same.
* `config.bundle.git.commit`: SHA-1 commit hash of the exact commit this
bundle was deployed from. Note, the deployment might not exactly match
this commit version if there are changes that have not been committed to
git at deploy time,
* `file_path`: Path in workspace where we sync bundle files to. 
* `resources.jobs.[job-ref].id`: Id of the job
* `resources.jobs.[job-ref].relative_path`: Relative path of the yaml
config file from the bundle root where this job was defined.

Example metadata object when bundle root and git root are the same:
```json
{
  "version": 1,
  "config": {
    "bundle": {
      "lock": {},
      "git": {
        "branch": "master",
        "origin_url": "www.host.com",
        "commit": "7af8e5d3f5dceffff9295d42d21606ccf056dce0",
        "bundle_root_path": "."
      }
    },
    "workspace": {
      "file_path": "/Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default/files"
    },
    "resources": {
      "jobs": {
        "bar": {
          "id": "245921165354846",
          "relative_path": "databricks.yml"
        }
      }
    },
    "sync": {}
  }
}
```

Example metadata when the git root is one level above the bundle repo:
```json
{
  "version": 1,
  "config": {
    "bundle": {
      "lock": {},
      "git": {
        "branch": "dev-branch",
        "origin_url": "www.my-repo.com",
        "commit": "3db46ef750998952b00a2b3e7991e31787e4b98b",
        "bundle_root_path": "pipeline-progress"
      }
    },
    "workspace": {
      "file_path": "/Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default/files"
    },
    "resources": {
      "jobs": {
        "bar": {
          "id": "245921165354846",
          "relative_path": "databricks.yml"
        }
      }
    },
    "sync": {}
  }
}
```


This unblocks integration to the jobs break glass UI for bundles.

## Tests
Unit tests and integration tests.
2023-10-27 12:55:43 +00:00
Serge Smertin 905fe10e62
`make snapshot` to build file in `.databricks/databricks` (#927)
Goreleaser builds binary in 10-15 seconds, but go build does it just in
3-5 seconds. Target is `.databricks` folder in the current checkout,
which is already in `.gitignore`. Make sure you have the following
$PATH:

```
PATH="/path/to/cli/checkout/.databricks:$PATH"
```
2023-10-27 10:50:41 +00:00
shreyas-goenka bb662fadbb
Bump Terraform provider to v1.29.0 (#926)
This PR:
1. Regenerates go structs using provider version 1.29
2. Adds QOL autogenerated diff labels for github
3. Adds a small SOP for doing the tf provider bump for go structs
2023-10-27 09:16:41 +00:00
Andrew Nester 6f22ae8696
Use UserName instead of Id to check if identity used is a service principal (#924)
## Changes
Use UserName instead of Id to check if identity used is a service
principal
2023-10-26 14:58:16 +00:00
Andrew Nester 19e00d2d47
Upload terraform state even if apply fails (#923)
## Changes
Upload terraform state even if apply fails

Fixes #893 

## Tests
Manually running `databricks bundle deploy` with incorrect permissions
in bundle config and observe that it gets uploaded correctly
2023-10-26 14:38:01 +00:00
Miles Yucht 9b16e9bd45
Bump the Go SDK in the CLI (#919)
## Changes
Bump the Databricks Go SDK version from v0.23.0 to v0.24.0.

## Tests
<!-- How is this tested? -->
2023-10-26 11:41:28 +00:00
dependabot[bot] 01f669555d
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 (#920)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from
1.58.2 to 1.58.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's
releases</a>.</em></p>
<blockquote>
<h2>Release 1.58.3</h2>
<h1>Security</h1>
<ul>
<li>
<p>server: prohibit more than MaxConcurrentStreams handlers from running
at once (CVE-2023-44487)</p>
<p>In addition to this change, applications should ensure they do not
leave running tasks behind related to the RPC before returning from
method handlers, or should enforce appropriate limits on any such
work.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bf05b9558c"><code>bf05b95</code></a>
Change version.go to v1.58.3 (<a
href="https://redirect.github.com/grpc/grpc-go/issues/6707">#6707</a>)</li>
<li><a
href="c40c9ba315"><code>c40c9ba</code></a>
server: prohibit more than MaxConcurrentStreams handlers from running at
once...</li>
<li><a
href="dd9270d663"><code>dd9270d</code></a>
update version to 1.58.3-dev (<a
href="https://redirect.github.com/grpc/grpc-go/issues/6656">#6656</a>)</li>
<li>See full diff in <a
href="https://github.com/grpc/grpc-go/compare/v1.58.2...v1.58.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.58.2&new-version=1.58.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/databricks/cli/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-26 10:11:59 +00:00
Pieter Noordhuis 6e21ced54a
Consolidate bundle configuration loader function (#918)
## Changes

There were two functions related to loading a bundle configuration file;
one as a package function and one as a member function on the
configuration type. Loading the same configuration object twice doesn't
make sense and therefore we can consolidate to only using the package
function.

The package function would scan for known file names if the specified
path was a directory. This functionality was not in use because the
top-level bundle loader figures out the filename itself as of #580.

## Tests

Pass.
2023-10-25 12:55:56 +00:00
shreyas-goenka a5815a0b47
Add welcome message to bundle templates (#907)
## Changes
Adds a welcome_message field to templates and the default python
template.

## Tests
Manually.

Here's the output logs during template init now:
```
shreyas.goenka@THW32HFW6T bricks % cli bundle init                              
Template to use [default-python]: 

Welcome to the sample Databricks Asset Bundle template! Please enter the following information to initialize your sample DAB.

Unique name for this project [my_project]: abcde
Include a stub (sample) notebook in 'abcde/src': no
Include a stub (sample) Delta Live Tables pipeline in 'abcde/src': yes
Include a stub (sample) Python package in 'abcde/src': no

 Your new project has been created in the 'abcde' directory!

Please refer to the README.md of your project for further instructions on getting started.
Or read the documentation on Databricks Asset Bundles at https://docs.databricks.com/dev-tools/bundles/index.html.
```
2023-10-25 12:27:25 +00:00
Pieter Noordhuis a60c40e71e
Add configuration normalization code (#915)
## Changes

This is similar to #904 but instead of converting the dynamic
configuration to Go structs, this normalizes a `config.Value` according
to the type of a Go struct and returns the new, normalized
`config.Value`.

This will be used to ensure that two `config.Value` trees are
type-compatible before we can merge them (i.e. instances from different
files).

Warnings and errors during normalization are accumulated and returned as
a `diag.Diagnostics` structure. We can use this to surface warnings
about unknown fields, or errors about invalid types, in aggregate
instead of one-by-one. This approach is inspired by the pattern to
accumulate diagnostics in Terraform provider code.

## Tests

New unit tests.
2023-10-25 11:56:42 +00:00
Pieter Noordhuis 486bf59627
Move bundle configuration filename code (#917)
## Changes

This is unrelated to the config root so belongs in a separate file (this
was added in #580).

## Tests

n/a
2023-10-25 09:54:39 +00:00
shreyas-goenka 4a09ffc1ec
Add support for multiline descriptions when using template enums (#916)
## Changes
This PR splits the question prompt at the last new line character to
make multiline selection prompts work with `promptui`

## Tests
Tested manually



https://github.com/databricks/cli/assets/88374338/027e5210-f7f4-479d-98df-744d15b7a8fb
2023-10-25 09:37:25 +00:00
Andrew Nester d768994bbf
Simplified code generation logic for handling path and request body parameters and JSON input (#905)
## Changes
Simplified code generation logic for handling path and request body
parameters and JSON input

Note: relies on these PRs: 
https://github.com/databricks/databricks-sdk-go/pull/666
https://github.com/databricks/databricks-sdk-go/pull/669
https://github.com/databricks/databricks-sdk-go/pull/670
2023-10-24 17:37:08 +00:00
shreyas-goenka f8d7e31118
Fix pattern validation for input properties (#912)
## Changes
Fixes bug where input validation would only be done on the first input
parameter in the template schema.

## Tests
Unit test.
2023-10-24 15:56:54 +00:00
Pieter Noordhuis 3411b8aa37
Loading an empty file yields a nil (#906)
## Changes

Empty YAML files are valid and should return a nil-equivalent when
loaded.

## Tests

Tests pass.
2023-10-24 11:24:43 +00:00