]> apps.delaporte.us Git - dotfiles.git/blob - psmodules/dash.psm1
Bugs blockers and questions
[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"
72 Invoke-AgileCmd "gh issue list -S '$blockerQuery'"
73 Write-Host ""
74 Write-Host "## Open Questions"
75 $questionQuery = 'label:"phone a friend",question,"needs context"'
76 Invoke-AgileCmd "gh issue list -S '$questionQuery'"
77
78 }
79 if($bugs) {
80 Write-Host ""
81 Write-Host "## Known Bugs"
82 Invoke-AgileCmd "gh issue list -S 'label:bug'"
83 }
84 if($github) {
85 Write-Host ""
86 Write-Host "## GitHub Status (gh status)"
87 Invoke-Expression "gh status"
88 }
89 if($help) {
90 Write-Host "## Dasbhoard Help"
91 Get-Help Show-MyDashboard
92 }
93 if($leeroy){
94 Write-Host ""
95 Write-Host "## Leeroy Jenkins!:"
96 Invoke-AgileCmd "gh issue list -l 'leeroy jenkins'"
97 }
98 if($orphans) {
99 Write-Host ""
100 Write-Host "## Issues with No Milestone"
101 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
102 }
103 if($pr) {
104 Write-Host ""
105 Write-Host "## Open Pull Requests"
106 Invoke-AgileCmd "gh pr list"
107 }
108 if($requested){
109 Write-Host ""
110 Write-Host "## Open Stakeholder Requests"
111 invoke-agilecmd "gh issue list -S 'label:requested'"
112 }
113 if($todo) {
114 Write-Host ""
115 Write-Host "## Journal Todo Items"
116 todolist
117 Write-Host ""
118 Write-Host "## Todo.txt File"
119 todotxt
120 }
121 }
122
123 function Write-AgileClosedData() {
124 $gh_cmd = 'gh issue list --state closed --json title,closedAt,milestone,url'
125 Write-AgileToFile -gh_command $gh_cmd
126 }
127
128 Export-ModuleMember -Function Write-AgileClosedData
129 Export-ModuleMember -Function Show-MyDashboard
130 Export-ModuleMember -Function Show-MyTeamWork