summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zach.decook@bettercarpeople.com>2026-05-12 11:21:06 -0400
committerZach DeCook <zach.decook@bettercarpeople.com>2026-05-12 11:21:06 -0400
commit27de71ec539cc866f89577dc7a95d36bff62f6db (patch)
tree61e52a22779723f4ac64b5ffb7e9d0a698c8e538
parentc154fdc703c381dd92123bdff9c8287620309792 (diff)
downloaddotfiles-27de71ec539cc866f89577dc7a95d36bff62f6db.tar.gz
add plusminus to jira-CR.php
-rwxr-xr-x.local/bin/jira-CR.php10
1 files changed, 8 insertions, 2 deletions
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));