Commit 89123bc
committed
Add status filtering and transaction consolidation
Add comprehensive status filtering support and consolidate transaction fetching:
- docs/maniphest-cli.md: Added a new 'Status Filtering' section with pattern syntax, examples, combining with other filters, negation, and metadata notes. Also updated examples to include --status usage and metadata.
- phabfive/cli.py: Added --status option help text and examples in CLI usage, imported parse_status_patterns, parse status patterns from args, and wired status_patterns into task_search calls. Also updated --show-history description to include status history and show-metadata to indicate status matching.
- phabfive/status_transitions.py: New module implementing StatusPattern parsing and matching, status ordering map, helper functions get_status_order, _parse_single_condition, parse_status_patterns, and StatusPattern class with matching logic for from/to/in/been/never/raised/lowered and negation support.
- phabfive/maniphest.py: Reorganized imports, added transaction consolidation method _fetch_all_transactions to fetch columns/priority/status in one call, updated matching functions to accept pre-fetched transactions (_task_matches_priority_patterns, added _task_matches_status_patterns), updated _task_matches_any_pattern and task_search to use consolidated transactions, added status_transitions_map and matching_status_map handling, updated history and metadata builders to include status history and matched status booleans, and refactored history fetching to use consolidated method.
- tests/test_status_transitions.py: Added comprehensive unit tests for status parsing and matching including orders, parsing errors, pattern combinations, and matching behavior.
- tox.ini: Added py314 to envlist.
These changes implement status transition filtering end-to-end: CLI, parsing, matching, history display, tests, and docs. Tests and new module are isolated; transaction fetching consolidation touches maniphest to reduce API calls and integrate status handling.
🔧 feat(status_transitions): Improve status order handling with API response
Enhance status transition logic to dynamically build status order from
Phabricator's maniphest.querystatuses API. Add fallback to hardcoded
order when API response is unavailable. Modify functions to accept
optional API response for more flexible status progression tracking.
🔧 Refactor: Update status order and test cases
Modify status order to reflect new workflow and update
corresponding test cases. Remove 'In Progress' and 'Stalled'
statuses, adjust order of 'Blocked', 'Wontfix', 'Invalid',
'Duplicate', and 'Resolved' statuses. Update test assertions
to match new status order and workflow.1 parent 75e0df4 commit 89123bc
File tree
6 files changed
+1272
-43
lines changed- docs
- phabfive
- tests
6 files changed
+1272
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
416 | 535 | | |
417 | 536 | | |
418 | 537 | | |
| |||
421 | 540 | | |
422 | 541 | | |
423 | 542 | | |
| 543 | + | |
424 | 544 | | |
425 | 545 | | |
426 | 546 | | |
| |||
429 | 549 | | |
430 | 550 | | |
431 | 551 | | |
| 552 | + | |
432 | 553 | | |
433 | 554 | | |
434 | 555 | | |
435 | 556 | | |
436 | 557 | | |
| 558 | + | |
437 | 559 | | |
438 | 560 | | |
439 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
160 | 175 | | |
161 | 176 | | |
162 | 177 | | |
| |||
251 | 266 | | |
252 | 267 | | |
253 | 268 | | |
| 269 | + | |
254 | 270 | | |
255 | 271 | | |
256 | 272 | | |
| |||
400 | 416 | | |
401 | 417 | | |
402 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
403 | 430 | | |
404 | 431 | | |
405 | 432 | | |
| |||
411 | 438 | | |
412 | 439 | | |
413 | 440 | | |
| 441 | + | |
414 | 442 | | |
415 | 443 | | |
416 | 444 | | |
| |||
0 commit comments