Commit Graph

1794 Commits

Author SHA1 Message Date
Denis Bilenko a100671b8b
Merge branch 'main' into denik/wheel-patch 2025-03-04 16:21:02 +01:00
Denis Bilenko cc59dec5f5 parallel tests and short/non-short mode 2025-03-04 16:18:34 +01:00
Denis Bilenko 62f1c36f89 lint fix 2025-03-04 16:11:50 +01:00
Andrew Nester 41961226be
Switch to use GET workspaces-files/{name} instead of workspace/export for state files (#2423)
## Changes
Switch to use GET workspaces-files/{name} instead of workspace/export
for state files.

## Why
`/api/2.0./workspaces-files/{name}` has a higher limit which allows to
export state files larger than 10 MBs (which is the current limit for
`workspace/export`). We don't use the same API for read in other places
and fully replacing existing Filer because it doesn't correct get the
file content for notebooks and returns "File Not Found" error instead.

## Tests
All existing tests pass
2025-03-04 15:03:51 +00:00
Denis Bilenko 18daa3feff clean up 2025-03-04 15:52:59 +01:00
Denis Bilenko 9f9f89078e clean up 2025-03-04 15:47:25 +01:00
shreyas-goenka 549b226cbc
Add the `auth.ProcessEnv` function (#2404)
## Changes
This function provides all environment variables necessary to
authenticate the downstream applications to the same credentials as the
parent process.

It's used in https://github.com/databricks/cli/pull/2278 and will also
be useful for the `databricks bundle exec` command.

## Tests
Unit test.
2025-03-04 14:47:11 +00:00
Denis Bilenko f31928af40 fix Windows 2025-03-04 15:45:59 +01:00
Denis Bilenko 5c44533bb1 clean up 2025-03-04 15:40:57 +01:00
Denis Bilenko b4273f9624 fix re-patching and add test 2025-03-04 15:38:29 +01:00
Denis Bilenko 552920dfe4 clean up 2025-03-04 14:15:19 +01:00
Denis Bilenko a999ca91e8 fix test 2025-03-04 14:12:25 +01:00
Anton Nekipelov c0f5436a28
Add support for schemas in deployment bind/unbind commands (#2406)
## Changes
1. Changed `FindResourceByConfigKey` to return schema resources
2. Implemented the `Exists` method for schema resources

## Why
This PR adds support for schema resources in deployment operations,
enabling users to:
- Bind schemas using `databricks bundle deployment bind <myschema_key>
<schema_full_name>`
- Unbind schemas using `databricks bundle deployment unbind
<myschema_key>`

Where:
- `myschema_key` is a resource key defined in the bundle's .yml file
- `schema_full_name` references an existing schema in the Databricks
workspace

These capabilities allow for more flexible resource management of
schemas within bundles.

## Tests

Added a new integration test that tests bind and unbind methods together
with bundle deployment and destruction.
2025-03-04 12:46:39 +00:00
Denis Bilenko 9637241725 wip 2025-03-04 13:08:28 +01:00
Anton Nekipelov bcce6b0ece
Enable TestAuthDescribeFailure integration test (#2420)
## Changes
1. remove t.Skip directive from TestAuthDescribeFailure integration test
2. remove checking the host in the test

## Why
1. This enables integration test that exercises `databricks auth
describe` command, which was previously throwing errors in the CI/CD
pipeline. For the nonexistent profile check to fail, we need to create a
new profile file for the CLI to check (otherwise the configuration skips
checking of the provided profile actually exists).
2. I removed the assertion for the host part because it is not relevant
for the test, and setting that up just required more code in the test
setup.

## Tests
The integration test is passing
2025-03-04 11:43:26 +00:00
Denis Bilenko (aider) ca4f52198a feat: Add CalculateNewVersion function with table tests for wheel filename generation 2025-03-04 12:27:20 +01:00
Denis Bilenko 12897fe7c6 update comment 2025-03-04 12:21:46 +01:00
Denis Bilenko 98d2f38129 clean up 2025-03-04 12:19:11 +01:00
Denis Bilenko ab1667814d clean up unnecessary reopen 2025-03-04 12:09:29 +01:00
Denis Bilenko 7d8bdbd8cc remove separate METADATA parsing pass 2025-03-04 12:08:35 +01:00
Denis Bilenko 9c41156d34 clean up 2025-03-04 12:01:17 +01:00
Denis Bilenko (aider) e44373fe29 fix: Add missing closing brace in readMetadataAndRecord function 2025-03-04 11:58:13 +01:00
Denis Bilenko 3f5a1334ad refactor: Optimize metadata and record file search in wheel patching logic 2025-03-04 11:58:10 +01:00
Denis Bilenko (aider) cc07556392 fix: Handle non-seekable zip readers by reopening files 2025-03-04 11:53:52 +01:00
Denis Bilenko (aider) 9bd6229844 refactor: Improve error handling and prevent potential panics in wheel parsing 2025-03-04 11:52:45 +01:00
Denis Bilenko (aider) 6b5fa7ad33 fix: Correct variable assignment in patchwheel seeker reset 2025-03-04 11:51:04 +01:00
Denis Bilenko (aider) 7e747d29ac refactor: Simplify zip file reader seeking by removing unnecessary fallback logic 2025-03-04 11:50:12 +01:00
Denis Bilenko (aider) 80617cbb02 fix: Update patchRecord function to accept io.Reader instead of []byte 2025-03-04 11:48:08 +01:00
Denis Bilenko (aider) bbe90007d8 refactor: Optimize wheel patching by using io.Reader directly 2025-03-04 11:46:08 +01:00
Denis Bilenko 58e746757d clean up redundant comments 2025-03-04 11:37:18 +01:00
Denis Bilenko d54d093ecf do not return error from readMetadataAndRecord; make parse() work only on filenames (without path) 2025-03-04 11:34:45 +01:00
Denis Bilenko 6a7fae08ba clean up redundant comments 2025-03-04 11:21:16 +01:00
Denis Bilenko ba3062b654 rm copy 2025-03-04 10:01:45 +01:00
Denis Bilenko cc5133a5e4 clean up 2025-03-04 09:59:55 +01:00
Denis Bilenko 0aec26705f clean up 2025-03-03 21:31:58 +01:00
Denis Bilenko (aider) efa924613a refactor: Extract version verification into reusable function in patch_test.go 2025-03-03 21:14:01 +01:00
Denis Bilenko 1045dc169b refactor: Improve version verification comments in patch test 2025-03-03 21:13:59 +01:00
Denis Bilenko 84f4b5cd78 test: Add TODO comments for version verification in patch test 2025-03-03 21:12:38 +01:00
Denis Bilenko (aider) fc48cff153 fix: Implement atomic file write with temporary file in PatchWheel 2025-03-03 21:10:11 +01:00
Denis Bilenko 4afaf98324 refactor: Improve wheel patching with TODO comment and minor code cleanup 2025-03-03 21:10:08 +01:00
Denis Bilenko bc1b339f6a rename patchwheel to patch.go 2025-03-03 21:01:26 +01:00
Denis Bilenko c3b659c5e3 extract parse.go 2025-03-03 21:00:50 +01:00
Denis Bilenko (aider) 97109ec438 test: Modify writeProjectFiles to handle errors internally in tests 2025-03-03 20:58:28 +01:00
Denis Bilenko ea5690eb67 refactor: Remove commented-out code and improve test setup comment 2025-03-03 20:58:27 +01:00
Denis Bilenko 5689d6f7c2 formatting & clean up 2025-03-03 20:53:43 +01:00
Denis Bilenko (aider) 613d38d79d fix: Validate wheel metadata version and distribution against filename 2025-03-03 20:50:46 +01:00
Denis Bilenko (aider) 19b330be01 fix: Resolve variable redeclaration issues in PatchWheel function 2025-03-03 20:49:25 +01:00
Denis Bilenko (aider) f5530d9ed4 feat: Enhance wheel filename parsing and add target wheel existence check 2025-03-03 20:48:37 +01:00
Denis Bilenko 43be8ea727 refactor: Simplify wheel filename parsing and remove unused imports 2025-03-03 20:45:53 +01:00
Denis Bilenko (aider) a7e10066ca feat: Add idempotency to PatchWheel and extract version from wheel filename 2025-03-03 20:42:22 +01:00