fix: allow multiple history status filters#2085
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesMulti-Status History Filtering
sequenceDiagram
participant CLI as CLI (dagu history)
participant Parser as Parser (parseStatuses / remoteStatusValues)
participant Client as RemoteClient
participant Server as Remote API
CLI->>Parser: read --status "running,queued"
Parser-->>CLI: return [running, queued]
CLI->>Client: build query with multiple statuses
Client->>Client: encode repeated "status" params
Client->>Server: GET /runs?status=running&status=queued
Server-->>Client: 200 OK (runs list)
Client-->>CLI: display filtered runs
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cmd/remote_client.go`:
- Around line 169-175: The status handling currently serializes query.Statuses
into a single comma-separated string (using fmt.Sprintf and strings.Join into
params["status"]); instead, emit repeated query parameters so the request
becomes ?status=1&status=2. Replace the block that builds params["status"] to
iterate query.Statuses and call params.Add("status", fmt.Sprintf("%d", status))
for each entry (or, if params is not url.Values, change params to url.Values and
use Add) so multiple status values are sent as repeated parameters per the
OpenAPI explode:true declaration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6e2cbc37-71a1-44bd-b7c9-0d4c728a175d
📒 Files selected for processing (6)
internal/cmd/flags.gointernal/cmd/history.gointernal/cmd/history_test.gointernal/cmd/remote_client.gointernal/cmd/remote_commands.gointernal/cmd/remote_commands_test.go
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
dagu history --statusto accept comma-separated status filtersTesting
go test ./internal/cmd/...go test ./internal/intg -run TestHistoryCommand -count=1go test ./internal/persis/filedagrun/...Closes #2083
Summary by CodeRabbit
New Features
Bug Fixes
Tests