Skip to content

[Feature-18550] Add interval trigger type for schedules - #18548

Open
liang-wenjie wants to merge 25 commits into
apache:devfrom
liang-wenjie:2dev/feat/add-schedule-interval
Open

[Feature-18550] Add interval trigger type for schedules#18548
liang-wenjie wants to merge 25 commits into
apache:devfrom
liang-wenjie:2dev/feat/add-schedule-interval

Conversation

@liang-wenjie

@liang-wenjie liang-wenjie commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary\nAdd interval-based workflow schedule triggers.\n\n## Related Issue\nCloses #18550\n\n## Changes\n- support CRON and INTERVAL trigger types\n- support hour/minute/second intervals with finite or unlimited repeats\n- support interval preview and missed-fire policies\n- persist trigger type through API, DAO, Quartz, and UI payloads\n\n## Tests\n- IntervalScheduleTest\n- QuartzSimpleTriggerBuilderTest\n- SchedulerServiceTest (14 tests)\n- dolphinscheduler-ui: npm run build:prod

liang-wenjie and others added 16 commits July 29, 2026 18:44
…y on update

Address review feedback (SbloodyS):
- Frontend: include missedFirePolicy in the schedule create/update payload
  so the selected policy is actually persisted to the backend.
- Backend: distinguish an omitted JSON field from an explicit value. A new
  missedFirePolicySet marker tracks field presence, because Jackson cannot
  tell omission from an explicit null.
  - create: omitted or explicit null falls back to FIRE_ALL_MISSED
  - update: when the client omits the field (e.g. an older client), the
    existing stored policy is preserved instead of being overwritten
- Add unit tests covering create/update semantics and JSON presence detection.

Co-Authored-By: WorkBuddy <workbuddy@tencent.com>
…re-policy-v2' into 2dev/feat/add-schedule-missed-fire-policy-v2
This reverts commit 0245abd, reversing
changes made to 3752346.
@github-actions github-actions Bot added UI ui and front end related backend test labels Aug 12, 2026
@liang-wenjie liang-wenjie changed the title feat: add interval trigger type for schedules [Feature-18548] Add interval trigger type for schedules Aug 12, 2026
@liang-wenjie liang-wenjie changed the title [Feature-18548] Add interval trigger type for schedules [Feature-18550] Add interval trigger type for schedules Aug 12, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feature like this require e2e test. Please add the api-test or e2e test cases to verify it.

@det101 det101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

triggerType is sent as a top-level request field, but it is omitted from the schedule JSON.

Create/update APIs only accept @RequestParam("schedule") and deserialize that string into ScheduleParam. SchedulerController has no triggerType parameter, so this extra field is dropped. ScheduleParam.triggerType then defaults to CRON.

Preview works because it puts triggerType inside the schedule JSON (getPreviewSchedule). Saving does not, so INTERVAL schedules are validated and persisted as CRON. The interval JSON in crontab is then treated as a cron expression and the save fails, or Quartz registers a cron trigger instead of a simple trigger.

Please include triggerType in the schedule payload here, the same way preview does:

schedule: JSON.stringify({
  startTime: start,
  endTime: end,
  crontab: state.timingForm.crontab,
  timezoneId: state.timingForm.timezoneId,
  missedFirePolicy: state.timingForm.missedFirePolicy,
  triggerType: state.timingForm.triggerType
})

@github-actions github-actions Bot added the e2e e2e test label Aug 17, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You are using AI to help you do all the work, but you have not review its results. Before that, I won't waste time reviewing.

@liang-wenjie

Copy link
Copy Markdown
Contributor Author

I have manually reviewed the AI-assisted changes locally and will push the follow-up fixes shortly.

The follow-up fixes have now been pushed in commit f48a528139565d103d2b64e76af5c2e3f3996632.

The changes include:

  • preserving an existing INTERVAL trigger type when triggerType is omitted during update;
  • rejecting an explicit null trigger type;
  • validating interval expressions by requiring repeat and restricting minute / second to 0-59;
  • adding service-layer and Quartz SimpleTrigger regression tests;
  • fixing the Spotless formatting issue in SchedulerAPITest.

Local verification passed:

  • SchedulerServiceTest: 18 tests, 0 failures, 0 errors;
  • QuartzSimpleTriggerBuilderTest: 2 tests, 0 failures, 0 errors.

Please take another look when convenient.

@liang-wenjie
liang-wenjie requested a review from SbloodyS August 21, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend e2e e2e test test UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants