Review queue: add filters, CSV export, batch segment assignment, and bump to 0.9.3#6
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces batch assignment functionality for review segments, adds multi-field filtering to the review queue, implements CSV export for segment analytics, updates documentation to reference Granian ASGI server, and bumps the version from 0.9.1 to 0.9.3. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User<br/>(Browser)
participant Server as Django View<br/>(review_queue)
participant DB as Database<br/>(Segments)
User->>Server: GET review queue with filters<br/>(status, assignee, query, etc.)
Server->>DB: Query all segments for user's queue
DB-->>Server: Return all queue segments
Server->>Server: _filter_review_segments()<br/>Apply status, assignee, reviewer,<br/>project, and query filters
Server->>Server: _review_queue_project_choices()<br/>Extract unique projects from filtered rows
Server-->>User: Render review_queue.html<br/>with filtered segments & active filters
User->>Server: POST /review-queue/export/<br/>segment-analytics.csv<br/>with same filter parameters
Server->>DB: Query segments
DB-->>Server: Return segments
Server->>Server: _filter_review_segments()<br/>Apply same filters
Server-->>User: Return CSV file<br/>with filtered data
sequenceDiagram
participant User as User<br/>(Browser)
participant Server as Django View<br/>(segment_batch_assign)
participant DB as Database<br/>(Segments & Audit)
User->>Server: POST /sessions/{pk}/segments/<br/>batch-assign/<br/>with selected segment IDs,<br/>assignee, reviewer, status
Server->>Server: Validate permissions<br/>(can_review_session)
alt Validation fails
Server-->>User: Return 403 Forbidden
else Validation passes
Server->>DB: Retrieve selected segments
DB-->>Server: Return segments
Server->>DB: Bulk update assignee,<br/>reviewer, status
Server->>DB: Create audit log entries<br/>for each segment change
DB-->>Server: Confirm updates & audit
Server-->>User: Redirect to session_player<br/>with success message
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can generate a title for your PR based on the changes.Add |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46a80c3466
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if status_value and status_value not in { | ||
| ObservationSegment.STATUS_TODO, | ||
| ObservationSegment.STATUS_IN_PROGRESS, | ||
| ObservationSegment.STATUS_DONE, | ||
| }: |
There was a problem hiding this comment.
Require a non-empty status for batch status updates
This validation only runs when status_value is truthy, so a request with set_status=1 and an empty/missing status bypasses the check and later writes an invalid status (''/None) during the batch loop. In that scenario, the endpoint can either persist corrupted segment state or raise a server error on save, depending on payload shape. Since this view accepts raw POST data, it should explicitly require a valid status whenever status updates are requested.
Useful? React with 👍 / 👎.
Motivation
Description
_filter_review_segmentsand_review_queue_project_choicesto centralize review-queue filtering logic used by both UI and exports.review_queueview to acceptproject,status,assignee,reviewer, andqparameters and to exposeprojectsand active filter values to the template; addedreview_queue_export_segment_analytics_csvto export filtered segments as CSV.segment_batch_assignview plus URL and UI changes insession_player.htmlto support multi-select batch assignment of assignee/reviewer/status with audit logging and validation.review_queue.htmlandsession_player.htmlto add filter controls, an export button, and batch-assign UI, and wired new routes intracker/urls.py.0.9.3, added local ASGIgranianrun instructions inREADME.mdanddocs/deployment.md, and updatedCHANGELOG.md.Testing
python manage.py test, and the tests passed including the new view testtracker.tests.test_views.ViewTests.test_segment_batch_assign_and_review_queue_filters_and_export.tracker.tests.test_viewsthat exercise segments and queue behavior were run and remained green.Codex Task
Summary by CodeRabbit
New Features
Documentation