[Response Ops][Reporting] Fixing next run calculation in list scheduled report API#227704
[Response Ops][Reporting] Fixing next run calculation in list scheduled report API#227704ymao1 merged 3 commits intoelastic:mainfrom
Conversation
5253193 to
55f6fa4
Compare
55f6fa4 to
62cff6e
Compare
|
Pinging @elastic/response-ops (Team:ResponseOps) |
|
@elasticmachine merge upstream |
There was a problem hiding this comment.
Verified locally with future start date and start date already passed scenario. Works as expected 👍
One thing which I think is not related to this PR.
I scheduled a report with now as start date which showed now in the schedules tab, but it wasn't visible in the exports tab.
After a minute passed, the next run changed to next schedule date but there was still no entry in Exports tab.
It feels bit confusing to let user select now in the start date.
report_now.mov
| // start time is set to 2025-05-11T12:00:00.000Z (which is a Sunday) | ||
| // next run should be the next Friday after 2025-05-11T12:00:00.000Z which is 2025-05-16T17:00:00.000Z | ||
| // not the actual next friday which would be 2025-05-09T17:00:00.000Z | ||
| const dtstart = '2025-05-11T12:00:00.000Z'; |
There was a problem hiding this comment.
Thanks for the explanation! 😅
|
@js-jankisalvi I opened this issue to address: #228059 I was trying to save another ES query for this API but I think the correct thing to do for the next run time is to get the actual value from the task document. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
cc @ymao1 |
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16300382386 |
…ed report API (elastic#227704) ## Summary Fixes a small bug in the next run calculation when using the list scheduled report API. This takes the `rrule.dtstart` into account if it is defined and in the future. If it is in the past, defaults to using `Date.now()` as before. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit a893aa7)
…ed report API (elastic#227704) ## Summary Fixes a small bug in the next run calculation when using the list scheduled report API. This takes the `rrule.dtstart` into account if it is defined and in the future. If it is in the past, defaults to using `Date.now()` as before. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit a893aa7)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…cheduled report API (#227704) (#228081) # Backport This will backport the following commits from `main` to `9.1`: - [[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)](#227704) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ying Mao","email":"ying.mao@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T17:41:53Z","message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Reporting:Framework","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API","number":227704,"url":"https://github.com/elastic/kibana/pull/227704","mergeCommit":{"message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227704","number":227704,"mergeCommit":{"message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a"}}]}] BACKPORT--> --------- Co-authored-by: Ying Mao <ying.mao@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
…scheduled report API (#227704) (#228080) # Backport This will backport the following commits from `main` to `8.19`: - [[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)](#227704) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ying Mao","email":"ying.mao@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T17:41:53Z","message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Reporting:Framework","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API","number":227704,"url":"https://github.com/elastic/kibana/pull/227704","mergeCommit":{"message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227704","number":227704,"mergeCommit":{"message":"[Response Ops][Reporting] Fixing next run calculation in list scheduled report API (#227704)\n\n## Summary\n\nFixes a small bug in the next run calculation when using the list\nscheduled report API. This takes the `rrule.dtstart` into account if it\nis defined and in the future. If it is in the past, defaults to using\n`Date.now()` as before.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a893aa7744848877c0922c5a2ba4b53f73ba4e5a"}}]}] BACKPORT--> --------- Co-authored-by: Ying Mao <ying.mao@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
…ed report API (elastic#227704) ## Summary Fixes a small bug in the next run calculation when using the list scheduled report API. This takes the `rrule.dtstart` into account if it is defined and in the future. If it is in the past, defaults to using `Date.now()` as before. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ed report API (elastic#227704) ## Summary Fixes a small bug in the next run calculation when using the list scheduled report API. This takes the `rrule.dtstart` into account if it is defined and in the future. If it is in the past, defaults to using `Date.now()` as before. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Fixes a small bug in the next run calculation when using the list scheduled report API. This takes the
rrule.dtstartinto account if it is defined and in the future. If it is in the past, defaults to usingDate.now()as before.