Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Add inactivity notifications cron to helm

Type of Change

  • Other: Helm update

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Dec 7, 2025 2:45am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 7, 2025

Greptile Overview

Greptile Summary

Added Kubernetes CronJob configuration for inactivity notifications to poll workflows every 15 minutes and trigger alerts when workflows have been inactive.

  • Added inactivityAlertPoll job to cronjobs.jobs section with schedule */15 * * * *
  • Job makes HTTP GET requests to /api/notifications/poll endpoint (already implemented)
  • Configuration follows established pattern used by other cron jobs (gmailWebhookPoll, outlookWebhookPoll, renewSubscriptions)
  • Uses standard concurrency policy (Forbid) to prevent overlapping executions, with distributed locking at the application level
  • Configured with appropriate job history limits (3 successful, 1 failed)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple, well-structured Helm configuration addition that follows existing patterns. The API endpoint is already implemented with proper authentication, locking, and error handling. The 15-minute schedule is reasonable for inactivity checks, and the concurrency policy prevents overlapping executions.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
helm/sim/values.yaml 5/5 Added inactivityAlertPoll cron job configuration to poll for inactive workflows every 15 minutes

Sequence Diagram

sequenceDiagram
    participant Kubernetes as Kubernetes CronJob
    participant Curl as curl Container
    participant App as App Service
    participant Redis as Redis Lock
    participant DB as Database
    participant Notification as Notification Service

    Note over Kubernetes: Every 15 minutes (*/15 * * * *)
    Kubernetes->>Curl: Trigger inactivityAlertPoll
    Curl->>App: GET /api/notifications/poll<br/>(with CRON_SECRET)
    App->>App: verifyCronAuth()
    App->>Redis: acquireLock("inactivity-alert-polling-lock")
    alt Lock acquired
        Redis-->>App: Lock granted
        App->>DB: Query active no_activity subscriptions
        DB-->>App: Return subscriptions
        loop For each subscription
            App->>DB: Check workflow execution logs<br/>(last N hours)
            alt No recent activity
                App->>DB: Update lastAlertAt timestamp
                App->>DB: Insert notification delivery record
                App->>Notification: Trigger notification delivery<br/>(email/slack/webhook)
            else Has recent activity
                App->>App: Skip (has activity)
            end
        end
        App->>Redis: releaseLock()
        App-->>Curl: 200 OK (triggered/skipped counts)
    else Lock not acquired
        Redis-->>App: Lock held by another instance
        App-->>Curl: 202 Accepted (polling in progress)
    end
    Curl-->>Kubernetes: Success/Failure exit code
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 merged commit e9d5304 into staging Dec 7, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/add-inactivity-cron branch December 8, 2025 03:28
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.

2 participants