Skip to content

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

Merged
janniklasrose merged 7 commits into
mainfrom
janniklasrose/bundle-generate-jobs-download-script-with-flag
Jul 17, 2026
Merged

Download spark_python_task workspace files behind --download-spark-python-files flag#5892
janniklasrose merged 7 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.
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 06965a8

Run: 29580602178

Env💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4422711214:52
💚​aws windows4422911196:44
💚​aws-ucws linux4431610376:15
💚​aws-ucws windows4431810357:40
💚​azure linux4422711204:55
💚​azure windows4422911186:45
💚​azure-ucws linux4431810346:46
💚​azure-ucws windows4432010327:48
💚​gcp linux4422611224:49
💚​gcp windows4422811206:40
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp 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 10 slowest tests (at least 2 minutes):
durationenvtestname
6:25aws-ucws windowsTestAccept
6:23azure-ucws windowsTestAccept
6:19azure windowsTestAccept
6:17aws windowsTestAccept
6:15gcp windowsTestAccept
3:02gcp linuxTestAccept
2:56aws linuxTestAccept
2:56azure linuxTestAccept
2:51azure-ucws linuxTestAccept
2:50aws-ucws linuxTestAccept

@janniklasrose
janniklasrose added this pull request to the merge queueJul 17, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Jul 17, 2026
@janniklasrose
janniklasrose added this pull request to the merge queueJul 17, 2026
Merged via the queue into main with commit dd02458Jul 17, 2026
24 checks passed
@janniklasrose
janniklasrose deleted the janniklasrose/bundle-generate-jobs-download-script-with-flag branch July 17, 2026 13:13
Sign up for freeto 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.

3 participants

@janniklasrose@eng-dev-ecosystem-bot@andrewnester