feat: add date filter flags to issue list (#113)#163
Merged
Conversation
Also refactors build_filter_clauses to use a FilterOptions struct (fixes clippy::too_many_arguments), and boxes IssueCommand in the Command enum (fixes clippy::large_enum_variant from Task 2).
…113) Address PR review findings: - Test created_after_clause is included in output - Test updated_after + updated_before together (covers updated field name) - Test created date range combination (after + before)
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds absolute date-based filtering flags to jr issue list, enabling users to filter issues by created/updated date ranges without writing raw JQL, while handling Jira’s date-at-midnight semantics correctly.
Changes:
- Added
--created-after/--created-before/--updated-after/--updated-beforeflags toIssueCommand::List, with validation viachrono::NaiveDateparsing. - Implemented JQL clause generation for date filters, using
< next_dayfor--*-beforeflags to include the full calendar day. - Refactored
build_filter_clausesto take aFilterOptionsstruct and boxedIssueCommandto address clippy lints; added unit/smoke/handler tests for validation, conflicts, and exact JQL output.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cli_smoke.rs | Adds smoke test ensuring --created-after conflicts with --recent. |
| tests/cli_handler.rs | Adds wiremock handler tests verifying generated JQL for created-after and created-before (+1 day). |
| src/main.rs | Dereferences boxed IssueCommand when dispatching to issue handler. |
| src/jql.rs | Adds validate_date helper and unit tests for valid/invalid/impossible dates. |
| src/cli/mod.rs | Adds new date flags to jr issue list and boxes the issue subcommand to reduce enum size. |
| src/cli/issue/list.rs | Validates date flags early and adds corresponding JQL filter clauses via FilterOptions. |
| docs/superpowers/specs/2026-04-05-date-filters-design.md | Design spec documenting semantics, validation, and flag interactions. |
| docs/superpowers/plans/2026-04-05-date-filters.md | Implementation plan documenting step-by-step changes and test strategy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--created-after,--created-before,--updated-after,--updated-beforedate filter flags tojr issue listYYYY-MM-DDonly), rejecting invalid/impossible dates early--beforeflags use< next_dayinstead of<= dateto handle JQL's midnight semantics correctly (includes full calendar day)--created-afterconflicts with--recent(both setcreated >=lower bound)FilterOptionsstruct to replace growing positional args (clippytoo_many_arguments)IssueCommandto fix clippylarge_enum_variantCloses #113
Test plan
validate_date(valid dates, leap years, impossible dates, wrong formats)build_filter_clauseswith date clause fields (created_after, updated range, created range)--created-after/--recentconflict>=, created_before< next_day)cargo clippy -- -D warningscleancargo fmt --allclean