Skip to content

Add --created-before and --updated-before filters to maniphest search#129

Merged
holmboe merged 1 commit intomasterfrom
date-before
Feb 20, 2026
Merged

Add --created-before and --updated-before filters to maniphest search#129
holmboe merged 1 commit intomasterfrom
date-before

Conversation

@holmboe
Copy link
Contributor

@holmboe holmboe commented Feb 20, 2026

Summary

This PR adds support for filtering tasks created or updated more than N days ago, complementing the existing --created-after and --updated-after filters that find tasks within the last N days.

New Filters

  • --created-before=N: Tasks created more than N days ago
  • --updated-before=N: Tasks updated more than N days ago

Use Cases

These filters enable several useful queries:

  • Find stale tasks: --updated-before=14 --priority="in:High" (high-priority tasks not updated in 2 weeks)
  • Date ranges: Combine with "after" filters to create ranges (e.g., --created-after=30 --created-before=7 for tasks created between 7-30 days ago)
  • Old tasks: --created-before=90 (tasks older than 3 months)

Implementation Details

  • Uses Phabricator API constraints createdEnd and modifiedEnd
  • Follows the same pattern as existing --created-after and --updated-after filters
  • Supports all search code paths (no tag, OR logic, AND logic)
  • Includes YAML template support via supported_params
  • Fully documented with examples in docs/maniphest-cli.md

Changes

  • CLI (phabfive/cli.py): Added options to help and parameter extraction
  • Core (phabfive/maniphest.py): Added parameters to task_search() with Unix timestamp conversion and API constraint mapping
  • Docs (docs/maniphest-cli.md): Added examples and updated all filter references

Test Plan

Tested with:

# Find stale high-priority tasks
uv run phabfive maniphest search --tag '*' --updated-before=7

# Find old tasks
uv run phabfive maniphest search --tag '*' --created-before=30

# Complex query with multiple filters
uv run phabfive maniphest search --tag '*' --priority='in:High' \
  --status='not:in:Resolved' --column="not:in:Done" --updated-before=7

All filters work correctly and appear properly in filter descriptions.

🤖 Generated with Claude Code

This adds support for filtering tasks created or updated more than N days ago,
complementing the existing --created-after and --updated-after filters.

New filters:
- --created-before=N: Tasks created more than N days ago
- --updated-before=N: Tasks updated more than N days ago

These filters use the Phabricator API constraints createdEnd and modifiedEnd
to filter tasks by date. They can be combined with the existing "after" filters
to create date ranges (e.g., tasks created between 7 and 30 days ago).

Changes:
- CLI: Added new options to help and parameter extraction
- Core: Added parameters to task_search() with Unix timestamp conversion
- API: Applied createdEnd/modifiedEnd constraints in all search code paths
- Docs: Added examples and updated filter documentation
- YAML: Added support in search templates via supported_params

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@holmboe holmboe merged commit 74a7a2b into master Feb 20, 2026
15 checks passed
@holmboe holmboe deleted the date-before branch February 20, 2026 19:00
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.

1 participant