Skip to content

feat: Add scheduled and recurring scan support with cron expression (…#394

Open
Somil450 wants to merge 4 commits into
utksh1:mainfrom
Somil450:feature/scheduled-scans
Open

feat: Add scheduled and recurring scan support with cron expression (…#394
Somil450 wants to merge 4 commits into
utksh1:mainfrom
Somil450:feature/scheduled-scans

Conversation

@Somil450
Copy link
Copy Markdown

Scheduled and Recurring Scan Support (Resolves #374)

This PR introduces robust scheduling capabilities for automated workflows by allowing users to define execution rules using Cron Expressions or traditional intervals. This enables users to seamlessly set up daily, weekly, monthly, or customized automated security scans.

What's Changed

  • Backend Scheduler Engine: Enhanced the WorkflowScheduler within backend/secuscan/workflows.py to support croniter parsing. Workflows will now dynamically calculate the exact next execution timestamp.
  • Database Schema Iteration: Added dynamic schema migrations on init_db to seamlessly inject the cron_expression column into the existing workflows table without disrupting prior user data.
  • Frontend Dual-Mode UI: Upgraded frontend/src/pages/Workflows.tsx with an interactive "Cron Expression" vs "Interval" selector when creating/updating workflows.
  • REST APIs: Updated Payload interfaces across Python models and api.ts to consume and serialize the new cron features correctly.

@utksh1 utksh1 added area:backend Backend API, database, or service work area:frontend Frontend React/UI work type:feature Feature work category bonus label level:advanced 55 pts difficulty label for advanced contributor PRs labels May 28, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Thanks for building this out. I’m requesting changes before merge.\n\nRequested changes:\n- Rebase/update the branch first; GitHub shows this PR as behind .\n- Fix the failing CI jobs: , , and .\n- Remove the unused The httpx command line client could not run because the required dependencies were not installed.
Make sure you've installed everything with: pip install 'httpx[cli]' dependency addition from ; this scheduling feature does not use it.\n- Validate on the backend before saving it. Right now invalid cron strings can be persisted and only fail later inside the scheduler loop.\n- Add targeted tests for cron scheduling behavior and invalid-expression handling so we do not regress workflow execution timing.\n\nThe feature is valuable, but it needs to be rebased, tightened, and covered by tests before approval.

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Thanks for building this out. I’m requesting changes before merge.\n\nRequested changes:\n- Rebase or update the branch first; GitHub shows this PR as behind main.\n- Fix the failing CI jobs: backend-tests, frontend-checks, and formatting-hygiene.\n- Remove the unused httpx dependency addition from backend requirements; this scheduling feature does not use it.\n- Validate cron expressions on the backend before saving them. Right now invalid values can be stored and only fail later inside the scheduler loop.\n- Add targeted tests for cron scheduling behavior and invalid-expression handling so workflow timing stays reliable.\n\nThe feature is valuable, but it needs to be rebased, tightened, and covered by tests before approval.

@Somil450 Somil450 force-pushed the feature/scheduled-scans branch from bb7d540 to 9e53d98 Compare May 28, 2026 20:28
@Somil450
Copy link
Copy Markdown
Author

@utksh1 now plz check i have resolved all the issues plz review

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

Re-reviewed latest state. CI is green now, but blockers remain: httpx is still added without being used by this feature, and cron expressions are still accepted by create/update routes without backend validation before save. Please remove the unused dependency, validate cron_expression at the API boundary, and add explicit invalid-cron route tests in addition to scheduler tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work area:frontend Frontend React/UI work level:advanced 55 pts difficulty label for advanced contributor PRs type:feature Feature work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Scheduled and Recurring Scan Support

3 participants