Skip to content

TEST [AAP-72399] feat: add management job data models and migration#1

Draft
B-Whitt wants to merge 3 commits into
test-feature/AAP-72387/eda-management-jobsfrom
B-Whitt/AAP-72399/management-job-models
Draft

TEST [AAP-72399] feat: add management job data models and migration#1
B-Whitt wants to merge 3 commits into
test-feature/AAP-72387/eda-management-jobsfrom
B-Whitt/AAP-72399/management-job-models

Conversation

@B-Whitt
Copy link
Copy Markdown
Owner

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

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


What is being changed?

Adds three new Django models for the management job framework:

  • ManagementJob — defines a management job type (name, description, job_type enum, is_enabled, parameters)
  • ManagementJobSchedule — cron-based schedule linked to a ManagementJob (FK with CASCADE)
  • ManagementJobExecution — execution history for a ManagementJob (status enum, timestamps, output, errors)

Also adds ManagementJobType and ExecutionStatus enums to core/enums.py, exports/registers models in models/__init__.py, and includes migration 0071_management_jobs.

Why is this change needed?

EDA currently lacks management job capabilities. This is Phase 1 of the management job framework (Epic AAP-72387) — delivering the data layer that the API endpoints (AAP-72400) and concrete job implementations (AAP-72401) will build upon.

Jira: AAP-72399

How does this change address the issue?

Implements all acceptance criteria for AAP-72399:

  • AC 1-3: Three models with all specified fields ✅
  • AC 4: Job type enum with cleanup_audit_logs and cleanup_stale_activations
  • AC 5: Migration 0071 generates and applies cleanly ✅
  • AC 6: N/A — EDA excludes django.contrib.admin (API-first architecture, same as AWX)
  • AC 7: 16 integration tests covering creation, relationships, constraints, and cascade deletes ✅

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

No new dependencies. No breaking changes. Models follow existing EDA patterns (BaseOrgModel, UniqueNamedModel, DjangoStrEnum).

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/core/test_management_job.py -v

All 16 tests pass (verified locally against PostgreSQL).

Intent Adherence: 95/100

The implementation closely matches the story intent. Deductions: (-5) AC ansible#6 (Django admin) flagged as N/A since EDA deliberately excludes django.contrib.admin.

Changeset

File Action Description
src/aap_eda/core/enums.py Modified Added ManagementJobType and ExecutionStatus enums
src/aap_eda/core/models/management_job.py Created ManagementJob, ManagementJobSchedule, ManagementJobExecution
src/aap_eda/core/models/__init__.py Modified Export new models + permission_registry
src/aap_eda/core/migrations/0071_management_jobs.py Created Migration for 3 new tables
tests/integration/core/test_management_job.py Created 16 integration tests

Assisted-By: Claude Opus

B-Whitt added 3 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
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