summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zach.decook@bettercarpeople.com>2026-05-05 14:06:23 -0400
committerZach DeCook <zach.decook@bettercarpeople.com>2026-05-05 14:06:23 -0400
commit0e22ef25094a057ea618bc9c40499c67f93e7dd9 (patch)
tree8244d14521cae219072b0d34b548aadd45240bb4
parenteef1102f81c06211e0951cf270c9e86929ebbbc2 (diff)
downloaddotfiles-0e22ef25094a057ea618bc9c40499c67f93e7dd9.tar.gz
Add labels and mergeable status
-rwxr-xr-x.local/bin/jira-CR.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/.local/bin/jira-CR.php b/.local/bin/jira-CR.php
index a8955f7..cb8d637 100755
--- a/.local/bin/jira-CR.php
+++ b/.local/bin/jira-CR.php
@@ -15,14 +15,19 @@ if (!function_exists('array_any')) {
 
 $padlen = 50;
 print(str_pad("\rGetting tickets from jira...", $padlen));
-$tickets = explode("\n", rtrim(`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 --plain | grep -v '^KEY$'`));
+$ticket_lines = explode("\n", rtrim(`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'`));
+$tickets = array_map(fn($x) => explode("\t", $x)[0], $ticket_lines);
+$ticketLabels = array_combine(
+    $tickets,
+    array_map(fn($x) => explode(',', explode("\t", $x)[1] ?? ''), $ticket_lines)
+);
 
 print(str_pad("\rGetting OnBDC2 PR's from github...", $padlen));
-$prs_jsons[] = json_decode(`gh pr list -L 50 -R BetterCarPeople/OnBDC2 --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName'`, true);
+$prs_jsons[] = json_decode(`gh pr list -L 50 -R BetterCarPeople/OnBDC2 --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable'`, true);
 print(str_pad("\rGetting maple-ai PR's from github...", $padlen));
-$prs_jsons[] = json_decode(`gh pr list -R BetterCarPeople/maple-ai --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName'`, true);
+$prs_jsons[] = json_decode(`gh pr list -R BetterCarPeople/maple-ai --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable'`, true);
 print(str_pad("\rGetting maple-web PR's from github...", $padlen));
-$prs_jsons[] = json_decode(`gh pr list -R BetterCarPeople/maple-web --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName'`, true);
+$prs_jsons[] = json_decode(`gh pr list -R BetterCarPeople/maple-web --json 'title,url,statusCheckRollup,reviews,author,reviewDecision,reviewRequests,headRefName,mergeable'`, true);
 
 print(str_pad("\r", $padlen));
 print("\r");
@@ -43,6 +48,14 @@ foreach ($prs_json as $pr) {
         }
         $author = $pr['author']['login'];
 
+        $labels = $ticketLabels[$pr_ticket] ?? [];
+        $labelsText = trim(
+            (in_array("Successful_Demonstration", $labels) ? "📺 Demo'd " : '')
+            . (in_array("Hot", $labels) ? "🔥 Hot " : '')
+        );
+
+        $mergeable = $pr['mergeable'] == 'CONFLICTING' ? '🚧: Merge conflicts. ' : '';
+
         // Show pipeline status if failed
         $failedPipes = [];
         foreach ($pr['statusCheckRollup'] as $scr) {
@@ -99,7 +112,7 @@ foreach ($prs_json as $pr) {
         // Show review requested for
         // show other review statuses
         
-        echo "$pr[url]?T=$title($author)$pipeline_status$review_status\n";
+        echo "$pr[url]?T=$title($author)$labelsText$mergeable$pipeline_status$review_status\n";
     }
 }
 $has_no_pr = array_diff($tickets, array_keys($has_pr));