Skip to content

TEST [AAP-72400] feat: add REST API endpoints for management jobs#2

Draft
B-Whitt wants to merge 4 commits into
test-feature/AAP-72387/eda-management-jobsfrom
B-Whitt/AAP-72400/management-job-api
Draft

TEST [AAP-72400] feat: add REST API endpoints for management jobs#2
B-Whitt wants to merge 4 commits into
test-feature/AAP-72387/eda-management-jobsfrom
B-Whitt/AAP-72400/management-job-api

Conversation

@B-Whitt
Copy link
Copy Markdown
Owner

@B-Whitt B-Whitt commented Apr 22, 2026

This is a test of the AAP-SDLC harness Skill [2026-04-22]. Do not merge.


What is being changed?

Adds REST API endpoints for the management job framework:

  • GET /api/eda/v1/management-jobs/ — list all jobs with filtering (name, job_type, is_enabled)
  • GET /api/eda/v1/management-jobs/{id}/ — retrieve job details
  • PATCH /api/eda/v1/management-jobs/{id}/ — update is_enabled and parameters
  • POST /api/eda/v1/management-jobs/{id}/launch/ — trigger on-demand execution
  • GET /api/eda/v1/management-jobs/{id}/executions/ — list execution history with pagination
  • GET /api/eda/v1/management-jobs/{id}/executions/{exec_id}/ — execution detail with output

No Create or Delete — management job types are system-defined.

Why is this change needed?

Phase 2 of the management job framework (Epic AAP-72387). Builds on the data models from AAP-72399 to expose them via REST API.

Jira: AAP-72400

How does this change address the issue?

All 8 acceptance criteria pass:

  • AC 1-6: All 6 API endpoints implemented ✅
  • AC 7: Serializers validate input — read-only fields ignored on PATCH ✅
  • AC 8: 18 integration tests covering all operations ✅

Does this change introduce any new dependencies, blockers or breaking changes?

No new dependencies. Depends on AAP-72399 (management job models). Follows existing EDA ViewSet patterns.

How it can be tested?

task docker:up:postgres
DJANGO_SETTINGS_MODULE=aap_eda.settings.default EDA_SECRET_KEY=test-secret-key EDA_DB_HOST=localhost EDA_DB_PASSWORD=secret python -m django migrate
python -m pytest tests/integration/api/test_management_job.py -v

18 tests pass. Story 1 model tests also pass (16/16, no regressions).

Intent Adherence: 95/100

Deductions: (-5) AC #3 mentions "schedule" as updatable, but schedule is a separate model. PATCH updates is_enabled and parameters on ManagementJob. Flagged and approved during planning.

Changeset

File Action Description
src/aap_eda/api/views/management_job.py Created ManagementJobViewSet
src/aap_eda/api/serializers/management_job.py Created Read, Update, Execution serializers
src/aap_eda/api/filters/management_job.py Created ManagementJobFilter
src/aap_eda/api/views/__init__.py Modified Export viewset
src/aap_eda/api/serializers/__init__.py Modified Export serializers
src/aap_eda/api/filters/__init__.py Modified Export filter
src/aap_eda/api/urls.py Modified Register route
tests/integration/api/test_management_job.py Created 18 integration tests

Assisted-By: Claude Opus

B-Whitt added 4 commits April 21, 2026 15:20
Add ManagementJob, ManagementJobSchedule, and ManagementJobExecution
models with ManagementJobType and ExecutionStatus enums. Includes
migration 0071 and 16 integration tests covering model creation,
relationships, constraints, and cascade deletes.

Jira: AAP-72399

Assisted-By: Claude Opus
Add ManagementJobViewSet with list, retrieve, partial update, launch,
and execution history endpoints. Includes read/update serializers,
filters (name, job_type, is_enabled), and 18 integration tests.

Jira: AAP-72400

Assisted-By: Claude Opus
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.

1 participant