Bumps [astral-sh/ruff-action](https://github.com/astral-sh/ruff-action)
from 3.0.1 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff-action/releases">astral-sh/ruff-action's
releases</a>.</em></p>
<blockquote>
<h2>v3.1.0 🌈 Determine ruff version from optional or dependency
groups</h2>
<h2>Changes</h2>
<p>Big thank you to <a
href="https://github.com/AA-Turner"><code>@AA-Turner</code></a> for
expanding the pyproject.toml parsing to also find the ruff version to
use in the following scenarios:</p>
<pre lang="toml"><code>[dependency-groups]
dev = [
{ include-group = "docs" },
{ include-group = "lint" },
]
docs = [
"sphinx",
]
lint = [
"ruff==0.8.3",
]
</code></pre>
<pre lang="toml"><code>[project.optional-dependencies]
lint = [
"ruff==0.8.3",
]
</code></pre>
<h2>🚀 Enhancements</h2>
<ul>
<li>Read the <code>[project.optional-dependencies]</code> and
<code>[dependency-groups]</code> tables <a
href="https://github.com/AA-Turner"><code>@AA-Turner</code></a> (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/66">#66</a>)</li>
</ul>
<h2>v3.0.2 🌈 Full support for GHES</h2>
<h2>Changes</h2>
<p>This release fixes some issues that prevented use with GitHub
Enterprise Server instances.
Parsing the ruff version from pyproject.toml now also uses a library
that is fully TOML 1.0.0 compliant.</p>
<h2>🐛 Bug fixes</h2>
<ul>
<li>Do not expect GITHUB_TOKEN to be set or valid <a
href="https://github.com/eifinger"><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/65">#65</a>)</li>
<li>Use TOML 1.0.0 compliant library for parsing <a
href="https://github.com/eifinger"><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/47">#47</a>)</li>
</ul>
<h2>🧰 Maintenance</h2>
<ul>
<li>Fix compiled known versions <a
href="https://github.com/eifinger"><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/62">#62</a>)</li>
<li>chore: update known checksums for 0.9.3 @<a
href="https://github.com/apps/github-actions">github-actions[bot]</a>
(<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/61">#61</a>)</li>
<li>chore: update known checksums for 0.9.1 @<a
href="https://github.com/apps/github-actions">github-actions[bot]</a>
(<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/42">#42</a>)</li>
</ul>
<h2>📚 Documentation</h2>
<ul>
<li>Fix Markdown link to Install the latest version <a
href="https://github.com/eifinger"><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/58">#58</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f14634c415"><code>f14634c</code></a>
Read the <code>[project.optional-dependencies]</code> and
<code>[dependency-groups]</code> tables (...</li>
<li><a
href="47de3deae8"><code>47de3de</code></a>
Bump <code>@types/node</code> from 22.10.10 to 22.12.0 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/60">#60</a>)</li>
<li><a
href="d8281c74d4"><code>d8281c7</code></a>
Do not expect GITHUB_TOKEN to be set or valid (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/65">#65</a>)</li>
<li><a
href="a634044659"><code>a634044</code></a>
Bump eifinger/actionlint-action from 1.9.0 to 1.9.1 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/59">#59</a>)</li>
<li><a
href="2993ff4a65"><code>2993ff4</code></a>
Fix compiled known versions (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/62">#62</a>)</li>
<li><a
href="20a3b171f4"><code>20a3b17</code></a>
chore: update known checksums for 0.9.3 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/61">#61</a>)</li>
<li><a
href="1c1aef9e3d"><code>1c1aef9</code></a>
Bump typescript from 5.7.2 to 5.7.3 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/41">#41</a>)</li>
<li><a
href="0ceb04d9a0"><code>0ceb04d</code></a>
Bump release-drafter/release-drafter from 6.0.0 to 6.1.0 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/50">#50</a>)</li>
<li><a
href="18db80c954"><code>18db80c</code></a>
Bump <code>@types/node</code> from 22.10.5 to 22.10.10 (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/53">#53</a>)</li>
<li><a
href="0a5dfb89f1"><code>0a5dfb8</code></a>
Fix Markdown link to Install the latest version (<a
href="https://redirect.github.com/astral-sh/ruff-action/issues/58">#58</a>)</li>
<li>Additional commits viewable in <a
href="31a5185046...f14634c415">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=astral-sh/ruff-action&package-manager=github_actions&previous-version=3.0.1&new-version=3.1.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>
## Changes
- Include acceptance directory in integration tests. Acceptance tests
will not start local server if CLOUD_ENV is set, so they become
integration tests.
- Add dependency for vendor to integration, so that CLI can be build
there.
- Implement LocalOnly option in test.toml to opt out of running
acceptance tests as integration tests. Use it in certain tests that are
difficult or not necessary to fix when run as integration tests.
- Update terraform test to redact timings out.
- Clean up .workspace.current_user from outputs of the tests.
## Tests
Existing tests.
## Changes
- Include compact relPath in the error message title. Include full paths
in separate lines below.
- Previously sometimes full paths were printed, sometime only rel path.
## Tests
Manually trigger the errors.
It is proven to be not necessary.
```
~/work/cli/acceptance % hyperfine -w 2 'go test' # with change:
Benchmark 1: go test
Time (mean ± σ): 4.983 s ± 0.209 s [User: 6.073 s, System: 9.869 s]
Range (min … max): 4.792 s … 5.483 s 10 runs
~/work/cli/acceptance % git stash # without change:
~/work/cli/acceptance % hyperfine -w 2 'go test'
Benchmark 1: go test
Time (mean ± σ): 5.018 s ± 0.100 s [User: 6.142 s, System: 10.234 s]
Range (min … max): 4.899 s … 5.182 s 10 runs
```
## Changes
- Add a script install_terraform.py that downloads terraform and
provider and generates a config to use, inspired by
https://gist.github.com/pietern/1cb6b6f3e0a452328e13cdc75031105e
- Make acceptance tests run this script once before running the tests
and set the required env vars to make cli use this terraform
installation.
- Use OS-specific directory for things that are build by acceptance test
runner (CLI and terraform).
This enables acceptance tests against cloud #2242 and local test for
bundle deploy #2254.
## Tests
- Add an acceptance test for standalone terraform. This is useful to
debug terraform with TF_LOG=DEBUG to see that it uses local provider.
- Other acceptance tests are updated with regard to terraform exec path.
- The overall time for tests locally is unchanged (if terraform is
already fetched).
## Changes
With this PR, any acceptance tests that define custom server stubs in
`test.toml` will automatically record all HTTP requests made and assert
on them.
Builds on top of https://github.com/databricks/cli/pull/2226
## Tests
Modifying existing acceptance test.
## Changes
This PR allows us to define custom server stubs in a `test.toml` file.
Note: A followup PR will add functionality to do assertions on the API
request itself.
## Tests
New acceptance test.
The default is 88 which reformats too much.
This has no effect on templates but affects Python script in this PR
https://github.com/databricks/cli/pull/2267
For context, we do not set any line length for golang and have 177 .go
files with max line length 150 or more.
## Changes
This PR registers the `server.Close()` function to be run during test
cleanup in the server initialization function. This ensures that all
test servers are closed as soon as the test they are scoped to finish.
Motivated by https://github.com/databricks/cli/pull/2255/files where a
regression was introduced where we did not close the test server.
## Tests
N/A
## Changes
Followup from
https://github.com/databricks/cli/pull/2209#pullrequestreview-2580308075.
This PR adds an integration test to validate that the API type bindings
work against the telemetry endpoint.
## Tests
N/A
---------
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
## Changes
Fix relative path errors in the Python mutator that was failing during
deployment since v0.239.1.
Before that:
```
% databricks bundle deploy
Deploying resources...
Updating deployment state...
Error: failed to compute relative path for job jobs_as_code_project_job: Rel: can't make resources/jobs_as_code_project_job.py relative to /Users/$USER/jobs_as_code_project
```
As a result, the bundle was deployed, but the deployment state wasn't
updated.
## Tests
Unit tests, adding acceptance tests in
https://github.com/databricks/cli/pull/2254
## Changes
Added support for double underscore variable references.
Previously we made this restriction stronger with no particular reason,
TF provider supports multiple underscores and thus DABs should do as
well.
Fixes#1753
## Tests
Added acceptance and integration tests
## Changes
These types correspond to the telemetry protobufs defined in universe.
## Tests
No tests are needed since this PR only adds the type bindings.
---------
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
## Changes
This change is required to enable tracking execution time telemetry for
bundle commands. In order to track execution time for the command
generally, we need to have the databricks auth configuration available
at this section of the code:
41bbd89257/cmd/root/root.go (L99)
In order to do this we can rely on the `configUsed` context key.
Most commands rely on the `root.MustWorkspaceClient` function which
automatically sets the client config in the `configUsed` context key.
Bundle commands, however, do not do so. They instead store their
workspace clients in the `&bundle.Bundle{}` object.
With this PR, the `configUsed` context key will be set for all `bundle`
commands. Functionally nothing changes.
## Tests
Existing tests. Also manually verified that either
`root.MustConfigureBundle` or `utils.ConfigureBundleWithVariables` is
called for all bundle commands (except `bundle init`) thus ensuring this
context key would be set for all bundle commands.
refs for the functions:
1. `root.MustConfigureBundle`:
41bbd89257/cmd/root/bundle.go (L88)
2. `utils.ConfigureBundleWithVariables`:
41bbd89257/cmd/bundle/utils/utils.go (L19)
---------
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
## Changes
This allows DABs to avoid waiting for the compute to start when app is
initially created as part of "bundle deploy" which significantly
improves deploy time.
Always set no_compute to true for apps
## Tests
Covered by `TestDeployBundleWithApp`, currently fails until TF provider
is upgraded to the version supporting `no_compute` option
## Changes
Noticed this when working on
https://github.com/databricks/cli/pull/2221. `<` is a special HTML
character that is encoded during text replacement when using
`AssertEqualTexts`.
## Tests
N/A
## Changes
- If CLOUD_ENV is set to do not override with dummy value. This allows
running acceptance tests as integration tests.
- Needed for https://github.com/databricks/cli/pull/2242
## Tests
Manually run the test suite against dogfood. `CLOUD_ENV=aws go test
./acceptance`
## Changes
- Do not start replacement / comparison if file is too large or not
valid utf-8.
- This helps to prevent replacements if there is accidentally a large
binary (e.g. terraform).
## Tests
Found this problem when working on
https://github.com/databricks/cli/pull/2242 -- the tests tried to
applied replacements on terraform binary and crashed. With this change,
an error is reported instead.
## Changes
- Replace development version with $DEV_VERSION
- Update experimental-jobs-as-code to make use of it.
## Tests
- Existing tests.
- Using this in https://github.com/databricks/cli/pull/2213
There is a speed up in 0.5s but it is still 4.4s, so something else is
slow there.
Benchmarking bundle/templates/experimental-jobs-as-code:
```
# Without UV_CACHE_DIR
~/work/cli/acceptance/bundle/templates/experimental-jobs-as-code % hyperfine --warmup 2 'testme -count=1'
Benchmark 1: testme -count=1
Time (mean ± σ): 4.950 s ± 0.079 s [User: 2.730 s, System: 8.524 s]
Range (min … max): 4.838 s … 5.076 s 10 runs
# With UV_CACHE_DIR
~/work/cli/acceptance/bundle/templates/experimental-jobs-as-code % hyperfine --warmup 2 'testme -count=1'
Benchmark 1: testme -count=1
Time (mean ± σ): 4.410 s ± 0.049 s [User: 2.669 s, System: 8.710 s]
Range (min … max): 4.324 s … 4.467 s 10 runs
```
## Changes
- Remove DetectInterpreters from DetectExecutable call: python3 or
python should always be on on the PATH. We don't need to detect
non-standard situations like python3.10 is present but python3 is not.
- I moved DetectInterpreters to cmd/labs where it is still used.
This is a follow up to https://github.com/databricks/cli/pull/2034
## Tests
Existing tests.
## Changes
- Ability to extend a list of replacements via test.toml
- Modify selftest to both demo this feature and to get rid of sed on
Windows.
## Tests
Acceptance tests. I'm also using it
https://github.com/databricks/cli/pull/2213 for things like pid.
## Changes
- File comparison files in acceptance test, print the contents of all
applied replacements. Do it once per test.
- Remove duplicate entries in replacement list.
## Tests
Manually, change out files of existing test, you'll get this printed
once, after first assertion:
```
acceptance_test.go:307: Available replacements:
REPL /Users/denis\.bilenko/work/cli/acceptance/build/databricks => $$CLI
REPL /private/var/folders/5y/9kkdnjw91p11vsqwk0cvmk200000gp/T/TestAccept598522733/001 => $$TMPHOME
...
```
## Changes
- New test covering failures in reading .git. One case results in error,
some result in warning (not shown).
- New helper withdir runs commands in a subdirectory.
## Tests
New acceptance test.
## Changes
For the most recent release, I had to re-run the "publish-winget" action
a couple of times before it passed. The underlying issue that causes the
failure should be solved by the latest version of the action, but upon
inspection of the latest version, I found that it always installs the
latest version of [Komac](https://github.com/russellbanks/Komac). To
both fix the issue and lock this down further, I updated our action to
call Komac directly instead of relying on a separate action to do this
for us.
## Tests
Successful run in
https://github.com/databricks/cli/actions/runs/12951529979.
## Changes
- Acceptance tests load test.toml to configure test behaviour.
- If file is not found in the test directory, parents are searched,
until the test root.
- Currently there is one option: runtime.GOOS to switch off tests per
OS.
## Tests
Using it in https://github.com/databricks/cli/pull/2223 to disable test
on Windows that cannot be run there.
## Changes
When adding path, a few things should take care of:
- symlink expansion
- forward/backward slashes, so that tests could do sed 's/\\\\/\//g' to
make it pass on Windows (see
acceptance/bundle/syncroot/dotdot-git/script)
SetPath() function takes care of both.
This PR uses SetPath() on all paths consistently.
## Tests
Existing tests.
## Changes
New source of default values for variables - variable file
`.databricks/bundle/<target>/variable-overrides.json`
CLI tries to stat and read that file every time during variable
initialisation phase
<!-- Summary of your changes that are easy to understand -->
## Tests
Acceptance tests
## Changes
`include` section is used only to include other bundle configuration
YAML files. If any other file type is used, raise an error and guide
users to use `sync.include` instead
## Tests
Added acceptance test
---------
Co-authored-by: Julia Crawford (Databricks) <julia.crawford@databricks.com>