Skip to content

Download spark_python_task workspace files behind --download-spark-python-files flag#5892

Open
janniklasrose wants to merge 5 commits into
mainfrom
janniklasrose/bundle-generate-jobs-download-script-with-flag
Open

Download spark_python_task workspace files behind --download-spark-python-files flag#5892
janniklasrose wants to merge 5 commits into
mainfrom
janniklasrose/bundle-generate-jobs-download-script-with-flag

Conversation

@janniklasrose

Copy link
Copy Markdown
Contributor

Changes

Re-applies #5799 (reverted in #5837) and puts the behaviour behind a new opt-in flag.

bundle generate job only downloaded notebook tasks; files referenced by spark_python_task were left as absolute /Workspace/... paths, so the source file was never downloaded and the config wasn't portable. This PR restores the download+rewrite path (reusing the same markFileForDownload helper as pipeline libraries) but gates it behind a new --download-spark-python-files flag on bundle generate job, defaulting to off. Git-sourced files (source: GIT) and cloud URIs (dbfs:/, s3:/, adls:/, gcs:/) are left untouched.

The flag is threaded through the Downloader as a functional option (WithSparkPythonFiles), so the pipeline, app, and import callers are unaffected.

Why

#5799 was reverted in #5837 because a Python file often imports sibling files that the downloader does not capture, so downloading only the entry point can produce a job that fails at runtime with missing imports — whereas leaving the absolute workspace path alone "just works". Making the download opt-in keeps the default safe while letting users who know their spark_python_task is self-contained pull the file into their bundle.

Commits

  1. Re-apply Download spark_python_task workspace files in bundle generate job #5799 — a single re-revert of Revert #5799 #5837, restoring the original change verbatim (only the NEXT_CHANGELOG.md conflict resolved).
  2. Gate behind --download-spark-python-files — the new flag, functional-option plumbing, tests, and regenerated help/changelog.

Tests

  • Unit tests in bundle/generate/downloader_test.go: the download+rewrite path (with the option), the skipped cases (cloud URI, source: GIT), and a new test asserting the default-off behaviour makes no requests.
  • Acceptance test acceptance/bundle/generate/spark_python_task_job exercising the full CLI with the flag: a workspace-file task is downloaded and rewritten, a dbfs:/ cloud-URI task is preserved. Identical output on both terraform and direct engines.
  • Regenerated the bundle generate job --help golden file.

This pull request and its description were written by Isaac, an AI coding agent.

…generate job

This re-applies commit b2e7e6f (PR #5799), which was reverted in #5837
(commit 353cb5a). `bundle generate job` again downloads workspace files
referenced by `spark_python_task` and rewrites them to a relative path,
like it already does for notebooks. Git-sourced files and cloud URIs are
left untouched.

The behaviour is gated behind a feature flag in a follow-up commit.
…flag

Downloading workspace files referenced by a spark_python_task is now
opt-in via a new --download-spark-python-files flag on bundle generate
job (default off). A Python file often imports sibling files that the
downloader does not capture, so downloading only the entry point can
produce a job that fails at runtime with missing imports; this was the
reason #5799 was originally reverted in #5837.

The behaviour is threaded through the Downloader as a functional option
(WithSparkPythonFiles), so the pipeline, app, and import callers are
unaffected.
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

8 files changed
Suggested: @denik
Also eligible: @pietern, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/generate/downloader.go, bundle/generate/downloader_test.go
Suggested: @denik
Also eligible: @pietern, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

/cmd/bundle/ - needs approval

Files: cmd/bundle/generate/job.go
Suggested: @denik
Also eligible: @pietern, @andrewnester, @shreyas-goenka, @anton-107, @lennartkats-db

General files (require maintainer)

Files: .nextchanges/bundles/bundle-generate-job-download-script.md
Based on git history:

  • @denik -- recent work in cmd/bundle/generate/, bundle/generate/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 28c4201

Run: 29167177802

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 230 1079 9:35
💚​ aws windows 4 4 232 1077 7:03
💚​ aws-ucws linux 4 4 316 996 5:34
💚​ aws-ucws windows 4 4 318 994 7:02
💚​ azure linux 4 4 230 1078 7:32
💚​ azure windows 4 4 232 1076 6:58
💚​ azure-ucws linux 4 4 318 993 14:43
💚​ azure-ucws windows 4 4 320 991 7:37
💚​ gcp linux 4 4 229 1080 8:58
💚​ gcp windows 4 4 231 1078 7:15
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 16 slowest tests (at least 2 minutes):
duration env testname
7:12 aws linux TestSecretsPutSecretStringValue
7:01 gcp linux TestSecretsPutSecretStringValue
6:43 azure-ucws linux TestSQLExecScalar
6:17 gcp windows TestAccept
6:05 azure-ucws windows TestAccept
6:04 aws-ucws windows TestAccept
6:00 azure windows TestAccept
5:56 aws windows TestAccept
5:18 azure linux TestSecretsPutSecretStringValue
5:13 azure-ucws linux TestSecretsPutSecretStringValue
2:53 aws linux TestAccept
2:50 aws-ucws linux TestAccept
2:49 azure linux TestAccept
2:49 azure-ucws linux TestAccept
2:49 gcp linux TestAccept
2:48 azure-ucws windows TestSQLExecScalar

@janniklasrose janniklasrose deployed to test-trigger-is July 11, 2026 20:30 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants