]> apps.delaporte.us Git - dotfiles.git/blob - psmodules/dash.psm1
Fix blocker/question search.
[dotfiles.git] / psmodules / dash.psm1
1 function Get-JournalAgenda() {
2 agenda.exe -path "$HOME/Journal/{YYYY}/{MM}-{DD}.md"
3 }
4
5 function Measure-JournalTodos() {
6 $todocount = todolist | Measure-Object -Line
7 $env:todocount += '|'
8 $env:todocount += $todocount.lines
9 }
10
11
12 <#
13
14 .EXAMPLE
15
16 Get-CommitsSince -From 2023.01.01
17
18 #>
19 function Show-GitRevList() {
20 param(
21 [string]$from
22 )
23 Invoke-AgileCmd "git rev-list HEAD --count --since=$from"
24 }
25
26 Export-ModuleMember -Function Show-GitRevList
27
28
29
30 <#
31
32 .SYNOPSIS
33
34 Show a text dashboard.
35
36 .EXAMPLE
37
38 Include `Todo` list.
39 Show-MyDashboard -todo
40
41 #>
42 function Show-MyDashBoard() {
43 param(
44 # [switch]$todocount=$true,
45 [switch]$agenda=$true,
46 [switch]$blocked,
47 [switch]$bugs,
48 [switch]$gitHub,
49 [switch]$help,
50 [switch]$leeroy,
51 [switch]$orphans,
52 [switch]$pr,
53 [switch]$requested,
54 [switch]$todo
55 )
56 $todocount = $true
57 if($todocount){
58 Measure-JournalTodos
59 Write-Host ""
60 Write-Host "## Todo items for today: $env:todocount"
61 chart -var todocount
62 }
63 if($agenda){
64 Write-Host ""
65 Write-Host "## Agenda for today:"
66 Get-JournalAgenda
67 }
68 if($blocked){
69 Write-Host ""
70 Write-Host "## Blocked & Blocker Issues:"
71 $blockerQuery = "label:blocker,blight,bug,blocked,'phone a friend',question,'needs context'"
72 Invoke-AgileCmd "gh issue list -S \"$blockerQuery\""
73 }
74 if($bugs) {
75 Write-Host ""
76 Write-Host "## Known Bugs"
77 Invoke-AgileCmd "gh issue list -S 'label:bug'"
78 }
79 if($github) {
80 Write-Host ""
81 Write-Host "## GitHub Status (gh status)"
82 Invoke-Expression "gh status"
83 }
84 if($help) {
85 Write-Host "## Dasbhoard Help"
86 Get-Help Show-MyDashboard
87 }
88 if($leeroy){
89 Write-Host ""
90 Write-Host "## Leeroy Jenkins!:"
91 Invoke-AgileCmd "gh issue list -l 'leeroy jenkins'"
92 }
93 if($orphans) {
94 Write-Host ""
95 Write-Host "## Issues with No Milestone"
96 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
97 }
98 if($pr) {
99 Write-Host ""
100 Write-Host "## Open Pull Requests"
101 Invoke-AgileCmd "gh pr list"
102 }
103 if($requested){
104 Write-Host ""
105 Write-Host "## Open Stakeholder Requests"
106 invoke-agilecmd "gh issue list -S 'label:requested'"
107 }
108 if($todo) {
109 Write-Host ""
110 Write-Host "## Journal Todo Items"
111 todolist
112 Write-Host ""
113 Write-Host "## Todo.txt File"
114 todotxt
115 }
116 }
117
118 function Write-AgileClosedData() {
119 $gh_cmd = 'gh issue list --state closed --json title,closedAt,milestone,url'
120 Write-AgileToFile -gh_command $gh_cmd
121 }
122
123 Export-ModuleMember -Function Write-AgileClosedData
124 Export-ModuleMember -Function Show-MyDashboard
125 Export-ModuleMember -Function Show-MyTeamWork