Skip to content

feat: added jobservice schedule subcommand#795

Open
NishchayRajput wants to merge 5 commits into
goharbor:mainfrom
NishchayRajput:feat/jobservice-schedule
Open

feat: added jobservice schedule subcommand#795
NishchayRajput wants to merge 5 commits into
goharbor: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.

@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

@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 9.04%. Comparing base (60ad0bd) to head (5c39263).
⚠️ Report is 159 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%   9.04%   -1.95%     
=========================================
  Files         173     281     +108     
  Lines        8671   13616    +4945     
=========================================
+ Hits          953    1231     +278     
- Misses       7612   12269    +4657     
- Partials      106     116      +10     

☔ 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

@NishchayRajput NishchayRajput force-pushed the feat/jobservice-schedule branch 2 times, most recently from 5fb39d8 to 5cdc28b Compare April 14, 2026 14:35
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NishchayRajput NishchayRajput force-pushed the feat/jobservice-schedule branch from 5cdc28b to 1b3a622 Compare April 21, 2026 16:47
@qcserestipy
Copy link
Copy Markdown
Collaborator

Please update the docs such that the lint pipeline does not fail

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NishchayRajput
Copy link
Copy Markdown
Author

Please update the docs such that the lint pipeline does not fail

done

@qcserestipy qcserestipy self-requested a review May 1, 2026 09:29
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.

LGTM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@NishchayRajput NishchayRajput requested a review from Copilot May 6, 2026 16:50
@qcserestipy qcserestipy removed the Changes Requesed feedback that must be addressed before merging. label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Implementing Jobservice Dashboard in CLI

5 participants