From 27de71ec539cc866f89577dc7a95d36bff62f6db Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Tue, 12 May 2026 11:21:06 -0400 Subject: add plusminus to jira-CR.php --- .local/bin/jira-CR.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to '.local/bin') diff --git a/.local/bin/jira-CR.php b/.local/bin/jira-CR.php index fc72906..7e5f55f 100755 --- a/.local/bin/jira-CR.php +++ b/.local/bin/jira-CR.php @@ -13,6 +13,10 @@ if (!function_exists('array_any')) { } } +$ansired = "\033[31m"; +$ansigreen = "\033[32m"; +$ansireset = "\033[0m"; + $padlen = 50; print(str_pad("\rGetting tickets from jira...", $padlen)); $ticket_lines = explode("\n", rtrim(shell_exec("jira-cli issues list -q'project IS NOT EMPTY and project != AUTO and project != NET and project != MSP and project != SYST and project != LOYAL' --order-by='Sprint' -s'Code Review' --columns=KEY,LABELS --plain | grep -v '^KEY\b'"))); @@ -22,7 +26,7 @@ $ticketLabels = array_combine( array_map(fn($x) => explode(',', explode("\t", $x)[1] ?? ''), $ticket_lines) ); -$params = 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable'; +$params = 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable,additions,deletions'; print(str_pad("\rGetting OnBDC2 PR's from github...", $padlen)); $prs_jsons[] = json_decode(shell_exec("gh pr list -L 50 -R BetterCarPeople/OnBDC2 --json '$params'"), true); @@ -56,6 +60,8 @@ foreach ($prs_json as $pr) { . (in_array("Hot", $labels) ? "🔥 Hot " : '') ); + $plusminus = $ansigreen . "+" . $pr['additions'] . $ansired . "-" . $pr['deletions'] . $ansireset; + $mergeable = $pr['mergeable'] == 'CONFLICTING' ? '🚧: Merge conflicts. ' : ''; // Show pipeline status if failed @@ -113,7 +119,7 @@ foreach ($prs_json as $pr) { $review_status = $changes . $reviewRequests . $approvals . $comments; - echo "$pr[url]?T=$title($author)$labelsText$mergeable$pipeline_status$review_status\n"; + echo "$pr[url]?T=$title($author)$labelsText$plusminus$mergeable$pipeline_status$review_status\n"; } } $has_no_pr = array_diff($tickets, array_keys($has_pr)); -- cgit 1.4.1