feat(submit): require explicit confirmation for all prepare_submit_job params
Remove defaults from queue, executor_memory, executor_cores, num_executors, and app_name in prepare_submit_job. All must now be explicitly confirmed by the caller. Also add extra_args to the PendingSubmission snapshot so users can confirm non-conf spark-submit flags (e.g. --jars, --py-files) at prepare time; confirm_submit_job passes them through to build_spark_submit_command. This is an intentional breaking change to the MCP tool contract: callers can no longer rely on implicit defaults.
This commit is contained in:
@@ -89,6 +89,7 @@ def test_connection_rejects_bad_master():
|
||||
def test_pending_submission_defaults_to_pending_status():
|
||||
p = PendingSubmission(
|
||||
pending_id="p_1",
|
||||
app_name="test-app",
|
||||
connection="prod",
|
||||
master="yarn",
|
||||
deploy_mode="cluster",
|
||||
@@ -105,13 +106,14 @@ def test_pending_submission_defaults_to_pending_status():
|
||||
assert p.job_id is None
|
||||
assert p.application_id is None
|
||||
assert p.yarn_rm_url is None # default for connections without one set
|
||||
assert p.app_name is None
|
||||
assert p.app_name == "test-app"
|
||||
|
||||
|
||||
def test_pending_submission_carries_yarn_rm_url_snapshot():
|
||||
"""snapshotting yarn_rm_url lets prepare/confirm survive connection edits."""
|
||||
p = PendingSubmission(
|
||||
pending_id="p_x",
|
||||
app_name="test-app",
|
||||
connection="prod",
|
||||
master="yarn",
|
||||
deploy_mode="cluster",
|
||||
@@ -122,6 +124,7 @@ def test_pending_submission_carries_yarn_rm_url_snapshot():
|
||||
executor_cores=2,
|
||||
num_executors=2,
|
||||
spark_conf={},
|
||||
extra_args={},
|
||||
created_at=datetime(2026, 6, 24),
|
||||
)
|
||||
assert p.yarn_rm_url == "http://rm-prod:8088"
|
||||
@@ -130,6 +133,7 @@ def test_pending_submission_carries_yarn_rm_url_snapshot():
|
||||
def test_pending_submission_can_record_outcome():
|
||||
p = PendingSubmission(
|
||||
pending_id="p_2",
|
||||
app_name="test-app",
|
||||
connection="prod",
|
||||
master="yarn",
|
||||
deploy_mode="cluster",
|
||||
@@ -139,6 +143,7 @@ def test_pending_submission_can_record_outcome():
|
||||
executor_cores=2,
|
||||
num_executors=2,
|
||||
spark_conf={},
|
||||
extra_args={},
|
||||
created_at=datetime(2026, 6, 24),
|
||||
status="SUBMITTED",
|
||||
job_id="j_abc",
|
||||
|
||||
Reference in New Issue
Block a user