Repository navigation
Resolve job project-environment paths relative to bundle YAML #6983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yiweidai-db
merged 10 commits into
main
from
yiweidai-db/stack/codex/bundle-project-environment-upstream
Oct 9, 2026
+106
−2
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
463b271
Resolve job project-environment paths relative to bundle YAML
yiweidai-db 99aeb09
Link project-environment release note to upstream PR
yiweidai-db 76b9704
Use a workspace-style path in the source-linked test fixture
yiweidai-db c2be77c
Retrigger CI after GitHub missed the branch update
yiweidai-db dbe16d4
Keep task path base unchanged for project environments
yiweidai-db 5734aef
Extract job environment rewrite pattern helper
yiweidai-db d2941b8
Clarify task and environment path pattern groups
yiweidai-db 7b9d466
Keep task base naming and clarify pattern scopes
yiweidai-db 4df3f0e
Use append for job path pattern groups
yiweidai-db 3d4c1f9
Address project environment path review feedback
yiweidai-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Resolve job `project_environment` paths relative to the YAML file that defines them. ([#6983](https://github.com/databricks/cli/pull/6983)) |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/environments/project_environment/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| bundle: | ||
| name: project_environment | ||
|
|
||
| include: | ||
| - resources/*.yml |
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/environments/project_environment/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Cloud = false | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
| EnvMatrix.DMS = ["", "true"] |
32 changes: 32 additions & 0 deletions
32
acceptance/bundle/environments/project_environment/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
|
|
||
| >>> [CLI] bundle validate -o json | ||
| { | ||
| "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/src/notebook", | ||
| "project_environment": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/pyproject.toml" | ||
| } | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/project_environment/default/files... | ||
| Created jobs.notebook | ||
| Files: 5 uploaded, 0 deleted | ||
| Resources: 1 created, 0 changed, 0 deleted, 0 unchanged | ||
|
|
||
| >>> print_requests.py //api/2.2/jobs/create | ||
| { | ||
| "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/src/notebook", | ||
| "project_environment": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/pyproject.toml" | ||
| } | ||
|
|
||
| >>> update_file.py resources/job.yml ../pyproject.toml ./pyproject.toml | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/project_environment/default/files... | ||
| Updated jobs.notebook | ||
| Files: 1 uploaded, 0 deleted | ||
| Resources: 0 created, 1 changed, 0 deleted, 0 unchanged | ||
|
|
||
| >>> print_requests.py //api/2.2/jobs/reset | ||
| { | ||
| "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/src/notebook", | ||
| "project_environment": "/Workspace/Users/[USERNAME]/.bundle/project_environment/default/files/resources/pyproject.toml" | ||
| } |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/environments/project_environment/pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [project] | ||
| name = "project-environment-test" | ||
| version = "0.1.0" | ||
|
|
||
| [tool.databricks.environment] | ||
| environment_version = "4" |
13 changes: 13 additions & 0 deletions
13
acceptance/bundle/environments/project_environment/resources/job.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| resources: | ||
| jobs: | ||
| notebook: | ||
| name: project_environment | ||
| tasks: | ||
| - task_key: notebook | ||
| notebook_task: | ||
| notebook_path: ../src/notebook.py | ||
| environment_key: project | ||
| environments: | ||
| - environment_key: project | ||
| spec: | ||
| project_environment: ../pyproject.toml |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/environments/project_environment/resources/pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [project] | ||
| name = "updated-project-environment-test" | ||
| version = "0.1.0" | ||
|
|
||
| [tool.databricks.environment] | ||
| environment_version = "4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| job_paths() { | ||
| jq '{ | ||
| notebook_path: .tasks[].notebook_task.notebook_path, | ||
| project_environment: .environments[].spec.project_environment | ||
| }' | ||
| } | ||
|
|
||
| trace $CLI bundle validate -o json | jq '.resources.jobs.notebook' | job_paths | ||
|
|
||
| trace $CLI bundle deploy | ||
| trace print_requests.py //api/2.2/jobs/create | jq '.body' | job_paths | ||
|
|
||
| trace update_file.py resources/job.yml ../pyproject.toml ./pyproject.toml | ||
| trace $CLI bundle deploy | ||
| trace print_requests.py //api/2.2/jobs/reset | jq '.body.new_settings' | job_paths |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/environments/project_environment/src/notebook.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Databricks notebook source | ||
| print("Project environment") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
| RecordRequests = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.