Skip to content

feat: Job Monitoring backend: add monitoring APIs, activity log, and latest-per-job view#417

Open
saifrazabc wants to merge 23 commits into
devfrom
feat/job-monitor-backend
Open

feat: Job Monitoring backend: add monitoring APIs, activity log, and latest-per-job view#417
saifrazabc wants to merge 23 commits into
devfrom
feat/job-monitor-backend

Conversation

@saifrazabc

@saifrazabc saifrazabc commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR delivers backend support for User Story 37368 (CSA Job Monitoring): new endpoints for latest jobs, history, and activities; job lifecycle/activity logging; Triggered By mapping via jobTrigger (USER/SYSTEM/CRON); and database migration adding monitoring columns/indexes plus the job_activities table for audit-style job event tracking.

Scope covered

  • Added new Job Monitoring endpoints:
    • GET /jobs/monitoring/latest:
      • returns latest monitored job runs (one latest row per monitored type)
    • GET /jobs/monitoring/history:
      • returns job history for the last month (paginated, filter/sort ready)
    • GET /jobs/monitoring/activities:
      • returns recent activities for default monitoring view
    • GET /jobs/:id/activities:
      • returns activities for a selected job run
  • Added activity logging support for job execution lifecycle and CRA file events.
  • Added database migration and Prisma schema updates for monitoring fields and job activities table.
  • Implemented Triggered By behavior using jobTrigger only (USER, SYSTEM, CRON), per agreed approach.
  • Updated existing tests and added tests for new monitoring APIs.

Dependency changes

  • No new package dependencies.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Automated/Unit tests
  • Manual tests (description below)
  • No new tests are required

Automated tests run

npm run build
npm test -- src/jobs/jobs.service.spec.ts src/api/jobs/jobs.controllers.spec.ts
npm test -- src/jobs/job-runner.service.spec.ts src/cra/handlers/poll-cra-response.handler.spec.ts src/cra/handlers/send-cra-file.handler.spec.ts


Checklist
 I have tested my changes locally
 The code builds and tests pass (no warnings)

Base automatically changed from chore/release-26.10 to dev July 24, 2026 02:18
@mdiapenabc

Copy link
Copy Markdown
Collaborator

Create a new PR based on this cide without the R26.10 code for an easier review.

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.

4 participants