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:
Claude
2026-06-26 15:12:14 +08:00
parent da9ba657f3
commit 4b07617af0
9 changed files with 330 additions and 49 deletions
+6 -4
View File
@@ -11,6 +11,7 @@ from spark_executor.models import PendingSubmission
def _pending(pid: str = "p_1", created_at: datetime | None = None) -> PendingSubmission:
return PendingSubmission(
pending_id=pid,
app_name="test",
connection="prod",
master="yarn",
deploy_mode="cluster",
@@ -20,6 +21,7 @@ def _pending(pid: str = "p_1", created_at: datetime | None = None) -> PendingSub
executor_cores=2,
num_executors=2,
spark_conf={},
extra_args={},
created_at=created_at or datetime(2026, 6, 24),
)
@@ -80,10 +82,10 @@ def test_delete_removes_from_date_file_and_deletes_empty_file():
def _legacy_record_text() -> str:
return (
'{"p_legacy": {"pending_id": "p_legacy", "connection": "prod", '
'"master": "yarn", "deploy_mode": "cluster", "script_path": "/tmp/j.py", '
'"queue": "default", "executor_memory": "4G", "executor_cores": 2, '
'"num_executors": 2, "spark_conf": {}, '
'{"p_legacy": {"pending_id": "p_legacy", "app_name": "legacy", '
'"connection": "prod", "master": "yarn", "deploy_mode": "cluster", '
'"script_path": "/tmp/j.py", "queue": "default", "executor_memory": "4G", '
'"executor_cores": 2, "num_executors": 2, "spark_conf": {}, '
'"created_at": "2026-06-23T00:00:00"}}'
)