Skip to content

feat: added jobservice queue subcommand#793

Open
NishchayRajput wants to merge 4 commits intogoharbor:mainfrom
NishchayRajput:feat/jobservice-queue
Open

feat: added jobservice queue subcommand#793
NishchayRajput wants to merge 4 commits intogoharbor:mainfrom
NishchayRajput:feat/jobservice-queue

Conversation

@NishchayRajput
Copy link
Copy Markdown

Description

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

This PR adds queue management commands under harbor jobservice queues to improve Job Service Dashboard parity for CLI users.
It enables listing queue state and executing queue lifecycle actions (stop/pause/resume) using either interactive or non-interactive flows.

Type of Change

Please select the relevant type.

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

Changes

  • Added queue command group support: list, stop, pause, resume.
  • Added queue API handlers and queue table rendering support.
  • Added queue command docs (CLI docs + man pages) and queue helper unit tests.

Command and Flag Behavior

Commands added

  • harbor jobservice queues list
  • harbor jobservice queues stop
  • harbor jobservice queues pause
  • harbor jobservice queues resume

Supported flags by command

  • harbor jobservice queues list

    • no queue-specific flags
    • supports global --output-format json|yaml
  • harbor jobservice queues stop

    • --type <type|all> (repeatable and comma-separated)
    • --interactive / -i
  • harbor jobservice queues pause

    • --type <type|all> (repeatable and comma-separated)
    • --interactive / -i
  • harbor jobservice queues resume

    • --type <type|all> (repeatable and comma-separated)
    • --interactive / -i

Default interactive behavior

  • Interactive UI is the default for stop, pause, and resume when --type is not provided.
  • Non-interactive mode is used automatically when one or more --type values are provided.

Interactive selection behavior

  • resume: only paused queues are shown.
  • pause: only unpaused queues are shown.
  • stop: all available queues are shown.

Type normalization behavior

  • Supports repeated flags: --type A --type B
  • Supports comma-separated values: --type A,B
  • Deduplicates queue types
  • all short-circuits to global action semantics

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@NishchayRajput NishchayRajput marked this pull request as ready for review April 3, 2026 07:06
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 1.14504% with 259 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.90%. Comparing base (60ad0bd) to head (80eb00c).
⚠️ Report is 131 commits behind head on main.

Files with missing lines Patch % Lines
cmd/harbor/root/jobservice/queues/utils.go 0.00% 101 Missing ⚠️
cmd/harbor/root/jobservice/queues/pause.go 0.00% 23 Missing ⚠️
cmd/harbor/root/jobservice/queues/resume.go 0.00% 23 Missing ⚠️
cmd/harbor/root/jobservice/queues/stop.go 0.00% 23 Missing ⚠️
pkg/utils/jobservice/errors.go 0.00% 22 Missing ⚠️
cmd/harbor/root/jobservice/queues/list.go 0.00% 19 Missing ⚠️
pkg/api/jobservice_handler.go 0.00% 19 Missing ⚠️
cmd/harbor/root/jobservice/cmd.go 0.00% 11 Missing ⚠️
pkg/views/jobservice/queues/view.go 0.00% 11 Missing ⚠️
cmd/harbor/root/jobservice/queues/cmd.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #793      +/-   ##
=========================================
- Coverage   10.99%   7.90%   -3.09%     
=========================================
  Files         173     280     +107     
  Lines        8671   13427    +4756     
=========================================
+ Hits          953    1061     +108     
- Misses       7612   12253    +4641     
- Partials      106     113       +7     

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

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
@qcserestipy qcserestipy self-requested a review April 7, 2026 16:22
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.

In principle LGTM, the commands however should be only accessible for admins. Please make sure that a user needs elevated priviledges.
also lint fails, please fix

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

In principle LGTM, the commands however should be only accessible for admins. Please make sure that a user needs elevated priviledges. also lint fails, please fix

image image

Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
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