Skip to content

feat: added jobservice schedule subcommand#795

Open
NishchayRajput wants to merge 3 commits intogoharbor:mainfrom
NishchayRajput:feat/jobservice-schedule
Open

feat: added jobservice schedule subcommand#795
NishchayRajput wants to merge 3 commits intogoharbor:mainfrom
NishchayRajput:feat/jobservice-schedule

Conversation

@NishchayRajput
Copy link
Copy Markdown

@NishchayRajput NishchayRajput commented Apr 3, 2026

Description

Briefly describe what this pull request does and why the change is needed.

This PR adds schedule management commands under harbor jobservice schedules to improve Job Service Dashboard parity for CLI users.
It enables listing schedules, checking global scheduler status, and pausing or resuming all schedules from the CLI.

Type of Change

Please select the relevant type.

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Chore / maintenance

Changes

  • Added schedule command group support: list, status, pause-all, resume-all.
  • Added schedule API handlers and schedule table/status rendering support.
  • Added schedule command docs (CLI docs + man pages) and schedule helper unit tests.

Command and Flag Behavior

Commands added

  • harbor jobservice schedules list
  • harbor jobservice schedules status
  • harbor jobservice schedules pause-all
  • harbor jobservice schedules resume-all

Supported flags by command

  • harbor jobservice schedules list

    • --page
    • --page-size
    • supports global --output-format json|yaml
  • harbor jobservice schedules status

    • no schedule-specific flags
    • supports global --output-format json|yaml
  • harbor jobservice schedules pause-all

    • no schedule-specific flags
  • harbor jobservice schedules resume-all

    • no schedule-specific flags

Default behavior

  • list uses page 1 and page-size 20 when flags are omitted.
  • status reports the global scheduler state for job_type=all.
  • pause-all and resume-all operate directly on the global scheduler and are non-interactive.

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NishchayRajput NishchayRajput changed the title feat: jobservice schedule feat: added jobservice schedule subcommand Apr 3, 2026
@NucleoFusion
Copy link
Copy Markdown
Contributor

Can you convert this to a draft, since this would cause conflicts with the other PR #793
And we can wait till the other gets merged

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@qcserestipy qcserestipy self-requested a review April 7, 2026 12:34
Copy link
Copy Markdown
Collaborator

@qcserestipy qcserestipy left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! LGTM, pls fix linting and wait for other PRs to be merged before.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 11.42857% with 155 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.08%. Comparing base (60ad0bd) to head (5fb39d8).
⚠️ Report is 131 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/jobservice_handler.go 0.00% 32 Missing ⚠️
cmd/harbor/root/jobservice/schedules/list.go 0.00% 29 Missing ⚠️
pkg/utils/jobservice/errors.go 0.00% 22 Missing ⚠️
cmd/harbor/root/jobservice/schedules/status.go 0.00% 19 Missing ⚠️
cmd/harbor/root/jobservice/schedules/pause_all.go 0.00% 14 Missing ⚠️
cmd/harbor/root/jobservice/schedules/resume_all.go 0.00% 14 Missing ⚠️
cmd/harbor/root/jobservice/schedules/cmd.go 0.00% 12 Missing ⚠️
cmd/harbor/root/jobservice/cmd.go 0.00% 11 Missing ⚠️
pkg/views/jobservice/schedules/view.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #795      +/-   ##
=========================================
- Coverage   10.99%   8.08%   -2.91%     
=========================================
  Files         173     279     +106     
  Lines        8671   13340    +4669     
=========================================
+ Hits          953    1078     +125     
- Misses       7612   12148    +4536     
- Partials      106     114       +8     

☔ 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.

Copy link
Copy Markdown
Collaborator

@qcserestipy qcserestipy left a comment

Choose a reason for hiding this comment

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

Lint fails

@qcserestipy qcserestipy added the Changes Requesed feedback that must be addressed before merging. label Apr 7, 2026
@qcserestipy
Copy link
Copy Markdown
Collaborator

Please also check that the commands should be only accessible for admins. Please make sure that a user needs elevated priviledges.

@NishchayRajput
Copy link
Copy Markdown
Author

NishchayRajput commented Apr 7, 2026

Please also check that the commands should be only accessible for admins. Please make sure that a user needs elevated priviledges.

image image

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NishchayRajput NishchayRajput force-pushed the feat/jobservice-schedule branch from 62d38c0 to 5fb39d8 Compare April 7, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes Requesed feedback that must be addressed before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Implementing Jobservice Dashboard in CLI

3 participants