Skip to content

Add PATCH /jobs/{job_id} support and align batch job deletion semantics#499

Draft
Copilot wants to merge 6 commits into
masterfrom
copilot/support-patch-jobs-modification
Draft

Add PATCH /jobs/{job_id} support and align batch job deletion semantics#499
Copilot wants to merge 6 commits into
masterfrom
copilot/support-patch-jobs-modification

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

The driver exposed PATCH /jobs/{job_id} but returned FeatureUnsupported, and job deletion in the dummy backend did not actually remove stored job state. This PR wires backend-level job patching into the API and makes delete behavior consistent with endpoint intent.

  • API surface: enable job modification endpoint

    • PATCH /jobs/{job_id} now delegates to batch_jobs.update_job(...) and returns 204.
    • Endpoint visibility in capabilities is now conditional (hidden=is_not_implemented(...)) instead of always hidden.
    • Added BatchJobs.update_job(job_id, user_id, data) to the backend contract (default @not_implemented).
  • Dummy backend: implement update/delete behavior

    • Added DummyBatchJobs.update_job(...) with spec-aligned constraints:
      • rejects updates for queued/running jobs via JobLocked.
      • accepts only editable fields: title, description, process, plan, budget.
      • rejects non-editable fields via PropertyNotEditable.
    • Updated DummyBatchJobs.delete_job(...) to remove both job metadata and result metadata entries.
  • Tests: cover new endpoint and behavior

    • Capabilities now expect PATCH on /jobs/{job_id}.
    • Added focused tests for:
      • successful patch updates,
      • locked-job rejection,
      • read-only-property rejection,
      • delete removing registry state.
@api_endpoint(hidden=is_not_implemented(backend_implementation.batch_jobs.update_job))
@blueprint.route('/jobs/<job_id>', methods=['PATCH'])
@auth_handler.requires_bearer_auth
def modify_job(job_id, user: User):
    backend_implementation.batch_jobs.update_job(job_id=job_id, user_id=user.user_id, data=request.get_json())
    return response_204_no_content()

Copilot AI linked an issue May 14, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Support PATCH /jobs/{job_id} to modify a batch job Add PATCH /jobs/{job_id} support and align batch job deletion semantics May 14, 2026
Copilot AI requested a review from jdries May 14, 2026 17:52
Copilot finished work on behalf of jdries May 14, 2026 17:52
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.

support PATCH /jobs/{job_id} (modify a batch job)

2 participants