Mark a feature as skipped by moving it to the end of the priority queue. This doesn't delete the feature but gives it a very high priority number so it will be processed last.
(project_name: str, feature_id: int)
| 526 | |
| 527 | @router.patch("/{feature_id}/skip") |
| 528 | async def skip_feature(project_name: str, feature_id: int): |
| 529 | """ |
| 530 | Mark a feature as skipped by moving it to the end of the priority queue. |
| 531 | |
| 532 | This doesn't delete the feature but gives it a very high priority number |
| 533 | so it will be processed last. |
| 534 | """ |
| 535 | project_name = validate_project_name(project_name) |
| 536 | project_dir = _get_project_path(project_name) |
| 537 | |
| 538 | if not project_dir: |
| 539 | raise HTTPException(status_code=404, detail=f"Project '{project_name}' not found in registry") |
| 540 | |
| 541 | if not project_dir.exists(): |
| 542 | raise HTTPException(status_code=404, detail="Project directory not found") |
| 543 | |
| 544 | _, Feature = _get_db_classes() |
| 545 | |
| 546 | try: |
| 547 | with get_db_session(project_dir) as session: |
| 548 | feature = session.query(Feature).filter(Feature.id == feature_id).first() |
| 549 | |
| 550 | if not feature: |
| 551 | raise HTTPException(status_code=404, detail=f"Feature {feature_id} not found") |
| 552 | |
| 553 | # Set priority to max + 1 to push to end (consistent with MCP server) |
| 554 | max_priority = session.query(Feature).order_by(Feature.priority.desc()).first() |
| 555 | feature.priority = (max_priority.priority + 1) if max_priority else 1 |
| 556 | |
| 557 | session.commit() |
| 558 | |
| 559 | return {"success": True, "message": f"Feature {feature_id} moved to end of queue"} |
| 560 | except HTTPException: |
| 561 | raise |
| 562 | except Exception: |
| 563 | logger.exception("Failed to skip feature") |
| 564 | raise HTTPException(status_code=500, detail="Failed to skip feature") |
| 565 | |
| 566 | |
| 567 | # ============================================================================ |
nothing calls this directly
no test coverage detected