Skip to content

feat: add date filter flags to issue list (#113)#163

Merged
Zious11 merged 8 commits intodevelopfrom
worktree-feat-date-filters-113
Apr 5, 2026
Merged

feat: add date filter flags to issue list (#113)#163
Zious11 merged 8 commits intodevelopfrom
worktree-feat-date-filters-113

Conversation

@Zious11
Copy link
Copy Markdown
Owner

@Zious11 Zious11 commented Apr 5, 2026

Summary

  • Add --created-after, --created-before, --updated-after, --updated-before date filter flags to jr issue list
  • Validate dates with chrono (YYYY-MM-DD only), rejecting invalid/impossible dates early
  • --before flags use < next_day instead of <= date to handle JQL's midnight semantics correctly (includes full calendar day)
  • --created-after conflicts with --recent (both set created >= lower bound)
  • Introduced FilterOptions struct to replace growing positional args (clippy too_many_arguments)
  • Boxed IssueCommand to fix clippy large_enum_variant

Closes #113

Test plan

  • 8 unit tests for validate_date (valid dates, leap years, impossible dates, wrong formats)
  • 3 unit tests for build_filter_clauses with date clause fields (created_after, updated range, created range)
  • 1 smoke test for --created-after/--recent conflict
  • 2 handler tests with wiremock verifying exact JQL (created_after >=, created_before < next_day)
  • cargo clippy -- -D warnings clean
  • cargo fmt --all clean
  • Full test suite passes (335 unit + 182 integration)

Zious11 added 8 commits April 5, 2026 13:04
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-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.03922% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cli/issue/list.rs 97.75% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-before flags to IssueCommand::List, with validation via chrono::NaiveDate parsing.
  • Implemented JQL clause generation for date filters, using < next_day for --*-before flags to include the full calendar day.
  • Refactored build_filter_clauses to take a FilterOptions struct and boxed IssueCommand to 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.

@Zious11 Zious11 merged commit 596a921 into develop Apr 5, 2026
11 checks passed
@Zious11 Zious11 deleted the worktree-feat-date-filters-113 branch April 5, 2026 19:15
@Zious11 Zious11 mentioned this pull request Apr 5, 2026
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.

issue list: add --created-after and --created-before date filters

3 participants