[Feature-18550] Add interval trigger type for schedules - #18548
[Feature-18550] Add interval trigger type for schedules#18548liang-wenjie wants to merge 25 commits into
Conversation
…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
SbloodyS
left a comment
There was a problem hiding this comment.
Feature like this require e2e test. Please add the api-test or e2e test cases to verify it.
det101
left a comment
There was a problem hiding this comment.
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
})
SbloodyS
left a comment
There was a problem hiding this comment.
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.
|
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 The changes include:
Local verification passed:
Please take another look when convenient. |
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