Update work order table to show branch name, and the commit operations count bug that is showing commits of the whole main branch vs. the work order changes.

This commit is contained in:
sean-eskerium
2025-10-31 22:42:00 -04:00
parent a292ce2dfb
commit 068018a6a3
3 changed files with 8 additions and 7 deletions

View File

@@ -164,10 +164,10 @@ export function WorkOrderRow({
<span className="text-sm text-gray-900 dark:text-white">{displayRepo}</span>
</td>
{/* Request Summary */}
{/* Branch */}
<td className="px-4 py-2">
<p className="text-sm text-gray-900 dark:text-white line-clamp-2">
{workOrder.github_issue_number ? `Issue #${workOrder.github_issue_number}` : "Work order in progress"}
{workOrder.git_branch_name || <span className="text-gray-400 dark:text-gray-500">-</span>}
</p>
</td>

View File

@@ -113,7 +113,7 @@ export function WorkOrderTable({ workOrders, selectedRepositoryId, onStartWorkOr
Repository
</th>
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300">
Request Summary
Branch
</th>
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300 w-32">Status</th>
<th className="px-4 py-3 text-left text-sm font-medium text-gray-700 dark:text-gray-300 w-32">Actions</th>

View File

@@ -7,19 +7,20 @@ import subprocess
from pathlib import Path
async def get_commit_count(branch_name: str, repo_path: str | Path) -> int:
"""Get the number of commits on a branch
async def get_commit_count(branch_name: str, repo_path: str | Path, base_branch: str = "main") -> int:
"""Get the number of commits added on a branch compared to base
Args:
branch_name: Name of the git branch
repo_path: Path to the git repository
base_branch: Base branch to compare against (default: "main")
Returns:
Number of commits on the branch
Number of commits added on this branch (not total branch history)
"""
try:
result = subprocess.run(
["git", "rev-list", "--count", branch_name],
["git", "rev-list", "--count", f"origin/{base_branch}..{branch_name}"],
cwd=str(repo_path),
capture_output=True,
text=True,