Skip to content

Conversation

Jeremydupras
Copy link
Contributor

@Jeremydupras Jeremydupras commented Aug 6, 2025

Description

Description
The Jobs REST API currently only lists the scheduled jobs which have the fields "descheduled = false and enabled = true". This will allow the user to see all jobs in job scheduler whether or not they are scheduled in both cluster wide call and by_node call.

There is no difference in the API call. The differences can be seen in the Descheduled and Enabled Fields. Additionally, "last_execution_time", "last_expected_execution_time", and "next_expected_execution_time" are all set to null values when the job is set to enables = false. See the example JSON output below.

Lastly, when a job is deleted it is removed the scheduledjobs data structure and the corresponding lock is removed regardless of the jobs enabled status.

{
  "jobs": [
    {
      "job_type": "scheduler_sample_extension",
      "job_id": "jobid2",
      "index_name": ".scheduler_sample_extension",
      "name": "sample-job-it",
      "descheduled": true,
      "enabled": false,
      "enabled_time": "1970-07-23T01:37:43.063Z",
      "last_update_time": "1970-07-23T01:37:43.063Z",
      "last_execution_time": "none",
      "last_expected_execution_time": "none",
      "next_expected_execution_time": "none",
      "schedule": {
        "type": "interval",
        "start_time": "1970-07-23T01:37:43.063Z",
        "interval": 1,
        "unit": "Minutes",
        "delay": "none"
      },
      "lock_duration": 10,
      "jitter": "none"
    }
  ],
  "failures": [],
  "total_jobs": 1
}

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Jeremy Dupras <[email protected]>
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 7.24638% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.29%. Comparing base (edeb3a3) to head (21ffe7d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nsport/action/TransportGetScheduledInfoAction.java 0.00% 64 Missing ⚠️

❌ Your project status has failed because the head coverage (31.29%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #806      +/-   ##
============================================
- Coverage     31.43%   31.29%   -0.14%     
+ Complexity      150      148       -2     
============================================
  Files            34       34              
  Lines          1527     1521       -6     
  Branches        137      137              
============================================
- Hits            480      476       -4     
+ Misses         1010     1009       -1     
+ Partials         37       36       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cwperks cwperks merged commit 6003c63 into opensearch-project:main Aug 7, 2025
13 of 15 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Engineering Effectiveness Board Aug 7, 2025
Jeremydupras added a commit to Jeremydupras/job-scheduler that referenced this pull request Aug 20, 2025
* adding descheduled jobs

Signed-off-by: Jeremy Dupras <[email protected]>

* changing check order

Signed-off-by: Jeremy Dupras <[email protected]>

---------

Signed-off-by: Jeremy Dupras <[email protected]>
Co-authored-by: Jeremy Dupras <[email protected]>
Signed-off-by: Jeremy Dupras <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants