Skip to content

[Response Ops][Reporting] Get next run time from task instance in scheduled report list API#233912

Merged
ymao1 merged 3 commits intoelastic:mainfrom
ymao1:scheduled-report-list-fix
Sep 5, 2025
Merged

[Response Ops][Reporting] Get next run time from task instance in scheduled report list API#233912
ymao1 merged 3 commits intoelastic:mainfrom
ymao1:scheduled-report-list-fix

Conversation

@ymao1
Copy link
Copy Markdown
Contributor

@ymao1 ymao1 commented Sep 3, 2025

Resolves #228059

Summary

Currently, the list API for scheduled reports dynamically calculates the next run time using the current time and the task rrule schedule. Sometimes that can lead to discrepancies in the next run that's shown vs the actual next run date. This PR updates the API to perform a bulkGet on the task instance and use the actual runAt time as the next run time. This should fallback to using the dynamic calculation if there are any errors getting the task instance.

@ymao1 ymao1 changed the title Getting task instance to use runAt for next run date [Response Ops][Reporting] Get next run time from task instance in scheduled report list API Sep 3, 2025
@ymao1 ymao1 self-assigned this Sep 3, 2025
@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Feature:Reporting:Framework Reporting issues pertaining to the overall framework v9.2.0 labels Sep 3, 2025
@ymao1 ymao1 force-pushed the scheduled-report-list-fix branch from 60dce2f to 819f092 Compare September 3, 2025 18:12
@ymao1 ymao1 marked this pull request as ready for review September 3, 2025 20:42
@ymao1 ymao1 requested a review from a team as a code owner September 3, 2025 20:42
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Copy Markdown
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

Verified locally for scheduled with now and with future date, both show correct next run date 👍

@ymao1
Copy link
Copy Markdown
Contributor Author

ymao1 commented Sep 5, 2025

@elasticmachine merge upstream

@ymao1 ymao1 enabled auto-merge (squash) September 5, 2025 11:47
@ymao1
Copy link
Copy Markdown
Contributor Author

ymao1 commented Sep 5, 2025

@elasticmachine merge upstream

@ymao1 ymao1 merged commit 0eaccf8 into elastic:main Sep 5, 2025
12 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @ymao1

@ymao1 ymao1 deleted the scheduled-report-list-fix branch September 5, 2025 15:52
shahargl pushed a commit to shahargl/kibana that referenced this pull request Sep 7, 2025
…eduled report list API (elastic#233912)

Resolves elastic#228059

## Summary

Currently, the `list` API for scheduled reports dynamically calculates
the next run time using the current time and the task rrule schedule.
Sometimes that can lead to discrepancies in the next run that's shown vs
the actual next run date. This PR updates the API to perform a `bulkGet`
on the task instance and use the actual `runAt` time as the next run
time. This should fallback to using the dynamic calculation if there are
any errors getting the task instance.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
KodeRad pushed a commit to KodeRad/kibana that referenced this pull request Sep 15, 2025
…eduled report list API (elastic#233912)

Resolves elastic#228059

## Summary

Currently, the `list` API for scheduled reports dynamically calculates
the next run time using the current time and the task rrule schedule.
Sometimes that can lead to discrepancies in the next run that's shown vs
the actual next run date. This PR updates the API to perform a `bulkGet`
on the task instance and use the actual `runAt` time as the next run
time. This should fallback to using the dynamic calculation if there are
any errors getting the task instance.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…eduled report list API (elastic#233912)

Resolves elastic#228059

## Summary

Currently, the `list` API for scheduled reports dynamically calculates
the next run time using the current time and the task rrule schedule.
Sometimes that can lead to discrepancies in the next run that's shown vs
the actual next run date. This PR updates the API to perform a `bulkGet`
on the task instance and use the actual `runAt` time as the next run
time. This should fallback to using the dynamic calculation if there are
any errors getting the task instance.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@ymao1 ymao1 added backport:version Backport to applied version labels v9.1.10 and removed backport:skip This PR does not require backporting labels Jan 7, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/20781404361

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/20781404376

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts
9.2 Cherrypick failed because the selected commit (0eaccf8) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

node scripts/backport --pr 233912

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts
9.2 Cherrypick failed because the selected commit (0eaccf8) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

node scripts/backport --pr 233912

Questions ?

Please refer to the Backport tool documentation

@ymao1
Copy link
Copy Markdown
Contributor Author

ymao1 commented Jan 7, 2026

💚 All backports created successfully

Status Branch Result
9.1
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

ymao1 added a commit to ymao1/kibana that referenced this pull request Jan 7, 2026
…eduled report list API (elastic#233912)

Resolves elastic#228059

## Summary

Currently, the `list` API for scheduled reports dynamically calculates
the next run time using the current time and the task rrule schedule.
Sometimes that can lead to discrepancies in the next run that's shown vs
the actual next run date. This PR updates the API to perform a `bulkGet`
on the task instance and use the actual `runAt` time as the next run
time. This should fallback to using the dynamic calculation if there are
any errors getting the task instance.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 0eaccf8)

# Conflicts:
#	x-pack/platform/plugins/private/reporting/server/routes/common/scheduled/scheduled_query.test.ts
#	x-pack/platform/plugins/private/reporting/server/routes/common/scheduled/scheduled_query.ts
ymao1 added a commit to ymao1/kibana that referenced this pull request Jan 7, 2026
…eduled report list API (elastic#233912)

Resolves elastic#228059

## Summary

Currently, the `list` API for scheduled reports dynamically calculates
the next run time using the current time and the task rrule schedule.
Sometimes that can lead to discrepancies in the next run that's shown vs
the actual next run date. This PR updates the API to perform a `bulkGet`
on the task instance and use the actual `runAt` time as the next run
time. This should fallback to using the dynamic calculation if there are
any errors getting the task instance.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 0eaccf8)

# Conflicts:
#	x-pack/platform/plugins/private/reporting/server/routes/common/scheduled/scheduled_query.test.ts
#	x-pack/platform/plugins/private/reporting/server/routes/common/scheduled/scheduled_query.ts
ymao1 added a commit that referenced this pull request Jan 7, 2026
…in scheduled report list API (#233912) (#248074)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Response Ops][Reporting] Get next run time from task instance in
scheduled report list API
(#233912)](#233912)

<!--- Backport version: 10.2.0 -->

### 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-09-05T15:49:34Z","message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Reporting:Framework","backport:version","v9.2.0","v9.4.0","v9.1.10","v8.19.10"],"title":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list
API","number":233912,"url":"https://github.com/elastic/kibana/pull/233912","mergeCommit":{"message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233912","number":233912,"mergeCommit":{"message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a"}},{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
ymao1 added a commit that referenced this pull request Jan 7, 2026
… in scheduled report list API (#233912) (#248075)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Response Ops][Reporting] Get next run time from task instance in
scheduled report list API
(#233912)](#233912)

<!--- Backport version: 10.2.0 -->

### 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-09-05T15:49:34Z","message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Reporting:Framework","backport:version","v9.2.0","v9.4.0","v9.1.10","v8.19.10"],"title":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list
API","number":233912,"url":"https://github.com/elastic/kibana/pull/233912","mergeCommit":{"message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233912","number":233912,"mergeCommit":{"message":"[Response
Ops][Reporting] Get next run time from task instance in scheduled report
list API (#233912)\n\nResolves
https://github.com/elastic/kibana/issues/228059\n\n##
Summary\n\nCurrently, the `list` API for scheduled reports dynamically
calculates\nthe next run time using the current time and the task rrule
schedule.\nSometimes that can lead to discrepancies in the next run
that's shown vs\nthe actual next run date. This PR updates the API to
perform a `bulkGet`\non the task instance and use the actual `runAt`
time as the next run\ntime. This should fallback to using the dynamic
calculation if there are\nany errors getting the task
instance.\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0eaccf862717e077a50f1b6f1d594d84e47e015a"}},{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Reporting:Framework Reporting issues pertaining to the overall framework release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.10 v9.1.10 v9.2.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Response Ops][Reporting] Get next run time from task instance in list API

4 participants