Skip to content

Conversation

@yottahmd
Copy link
Collaborator

@yottahmd yottahmd commented Jan 17, 2026

Summary by CodeRabbit

  • New Features

    • Added paginated queue items browsing with filtering options (running or queued).
    • Added log download capability for DAG runs, steps, and sub-DAG runs.
  • Improvements

    • Queue display now shows summary statistics with item counts and utilization metrics.
    • Enhanced queue interface with pagination controls and improved data presentation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This change introduces a new paginated API endpoint for retrieving queue items (/queues/{name}/items), refactors queue structures to use item counts instead of full lists, adds logging download endpoints, and updates UI components to consume the pagination-based endpoint.

Changes

Cohort / File(s) Summary
API Specification & Code Generation
api/v2/api.yaml, api/v2/api.gen.go
New /queues/{name}/items endpoint with pagination support. Queue schema refactored: replaced queued list with queuedCount, added runningCount, introduced QueueItemsResponse type. Generated handler types and HTTP wiring for ListQueueItems.
Queue Storage & Pagination
internal/core/exec/queue.go, internal/persis/filequeue/store.go
Added ListPaginated method to QueueStore interface. Implemented paginated file-based queue retrieval in filequeue store without materializing full item sets.
Queue Service Implementation
internal/service/frontend/api/v2/queues.go
New ListQueueItems endpoint returning paginated queue items (running or queued). Refactored ListQueues to use count-based metrics instead of full item lists. Added fetchDAGRunSummary helper and updated queue aggregation logic.
UI Schema & API Types
ui/src/api/v2/schema.ts
Added four log download endpoints for DAG runs and steps. Updated queue schema to use runningCount/queuedCount and introduced QueueItemsResponse type. Wired new listQueueItems operation with pagination parameters.
UI Components
ui/src/features/queues/components/QueueCard.tsx
Added client-side pagination state for queued items. Integrated SWR-based fetching from /queues/{name}/items. Replaced queue list length references with queuedCount/runningCount. Added pagination controls and improved date/time formatting.
UI Pages
ui/src/pages/queues/index.tsx
Updated metric calculations to use queuedCount/runningCount instead of list lengths. Refactored header layout and converted arrow functions to named function declarations.
UI Visualization
ui/src/features/dags/components/visualization/Graph.tsx
Converted component from React.FC const to named function declaration. Updated helper function signatures and adjusted stroke widths in graph styles.

Sequence Diagram(s)

sequenceDiagram
    actor Client
    participant API as API Server
    participant QueueStore as Queue Store
    participant ProcStore as Proc Store

    Client->>API: GET /queues/{name}/items?type=queued&page=1&perPage=20
    activate API
    
    alt type == "queued"
        API->>QueueStore: ListPaginated(ctx, name, paginator)
        activate QueueStore
        QueueStore-->>API: PaginatedResult[QueuedItemData]
        deactivate QueueStore
    else type == "running"
        API->>ProcStore: Load running DAG runs
        activate ProcStore
        ProcStore-->>API: Running items
        deactivate ProcStore
    end
    
    API->>API: Convert items to DAGRunSummary
    API-->>Client: 200 QueueItemsResponse {items, pagination}
    deactivate API
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: queue items pagination' accurately describes the main feature added in this PR: paginated retrieval of queue items through a new ListQueueItems API endpoint.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ui/src/features/queues/components/QueueCard.tsx (1)

90-116: Clear Queue only dequeues the current page.
queuedItems is limited to the active page, but the button/tooltip/modal claim “all queued DAG runs.” With pagination, this leaves items behind and is misleading. Either iterate through all pages (or add a server-side clear endpoint) or update the copy/counts to reflect page-scoped clearing.

📝 Minimal copy fix (page-scoped clear)
- <span className="ml-1 text-xs">Clear</span>
+ <span className="ml-1 text-xs">Clear page</span>
...
- <p>Remove all queued DAG runs</p>
+ <p>Remove queued DAG runs on this page</p>
...
- <p className="text-sm">
-   Remove all queued DAG runs from "{queue.name}"?
- </p>
+ <p className="text-sm">
+   Remove queued DAG runs on this page from "{queue.name}"?
+ </p>
- <p className="text-xs text-muted-foreground">
-   {queue.queuedCount || 0} DAG runs will be removed. This cannot be undone.
- </p>
+ <p className="text-xs text-muted-foreground">
+   {queuedItems.length} DAG runs on this page will be removed. This cannot be
+   undone.
+ </p>

Also applies to: 290-316, 384-390

🤖 Fix all issues with AI agents
In `@api/v2/api.gen.go`:
- Around line 180-184: Add explicit enum validation for ListQueueItemsParamsType
by implementing a Validate() (or IsValid) function that returns an error for any
value not in the allowed set {"queued","running"}, and call this validator
wherever request params are parsed/handled instead of silently defaulting to
"queued" (replace the fallback logic in queues.go that currently forces unknown
types to "queued" with a rejection path). Also update the api.gen.go pagination
comments to reflect the actual behavior (page is clamped to >=1 and perPage
defaults to 50 and is capped at 200) so the docs match runtime enforcement.

In `@internal/core/exec/queue.go`:
- Around line 27-28: Add the missing ListPaginated method to the mockQueueStore
type used in collector_test; implement the method with the exact signature
ListPaginated(ctx context.Context, name string, pg Paginator)
(PaginatedResult[QueuedItemData], error) and return an appropriate zero-value
PaginatedResult[QueuedItemData] (or use any existing mock fields to drive
results) and nil error (or configurable error if the mock supports it) so
mockQueueStore satisfies the QueueStore interface; locate the mockQueueStore
definition in the tests and add this method there using the same receiver type.

In `@internal/service/frontend/api/v2/queues.go`:
- Around line 92-104: In the Len pass loop, getOrCreateQueue is being called
with dag == nil which causes DAG-based queues with only queued items to keep
maxConcurrency = 0; change the logic so before calling getOrCreateQueue you
detect DAG-based, non-global queues and load DAG metadata from the first queued
item (using the queue store read used for queued items in this service) to
extract MaxActiveRuns and pass that DAG into getOrCreateQueue; mirror the
approach used by updateQueueMaxConcurrency in queue_processor.go (load DAG from
first queued item, read MaxActiveRuns, then call getOrCreateQueue(queueMap,
queueName, a.config, dag)) so these queues contribute correctly to totalCapacity
and totalQueued.

In `@ui/src/features/queues/components/QueueCard.tsx`:
- Around line 143-167: The DAGRunRow tr is clickable but not
keyboard-accessible; update the DAGRunRow component to make rows focusable and
operable via keyboard by adding role="button" and tabIndex={0} to the <tr>, and
implement an onKeyDown handler that calls onDAGRunClick(dagRun) when Enter or
Space is pressed (also ensure existing onClick still uses onDAGRunClick). Keep
accessibility semantics by preserving the StatusChip and other cells and
optionally add an aria-label or aria-describedby if needed to describe the row
action.

In `@ui/src/pages/queues/index.tsx`:
- Around line 244-247: Guard the filtered-count render by first checking that
data?.queues exists before comparing lengths: update the conditional that uses
filteredQueues and data?.queues (the JSX around filteredQueues.length !==
data?.queues?.length) to require data?.queues (or data?.queues?.length != null)
first so the span is only rendered when queue data is loaded.

@yottahmd yottahmd merged commit f14f135 into main Jan 17, 2026
6 checks passed
@yottahmd yottahmd deleted the queue-pagination branch January 17, 2026 07:47
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.71%. Comparing base (c19a003) to head (69a704b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/persis/filequeue/store.go 0.00% 28 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1585      +/-   ##
==========================================
- Coverage   64.79%   64.71%   -0.09%     
==========================================
  Files         259      259              
  Lines       28871    28899      +28     
==========================================
- Hits        18707    18701       -6     
- Misses       8489     8522      +33     
- Partials     1675     1676       +1     
Files with missing lines Coverage Δ
internal/cmn/telemetry/collector.go 77.02% <ø> (ø)
internal/core/exec/queue.go 0.00% <ø> (ø)
internal/persis/filequeue/store.go 38.33% <0.00%> (-7.07%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c19a003...69a704b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants