]> us-delaporte.pagekite.me Git - dotfiles.git/blob - psmodules/dash.psm1
Add closed issues by month for one source
[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 Invoke-AgileCmd "gh issue list -S 'label:blocked,blocker,needs context'"
72 }
73 if($bugs) {
74 Write-Host ""
75 Write-Host "## Known Bugs"
76 Invoke-AgileCmd "gh issue list -S 'label:bug'"
77 }
78 if($github) {
79 Write-Host ""
80 Write-Host "## GitHub Status (gh status)"
81 Invoke-Expression "gh status"
82 }
83 if($help) {
84 Write-Host "## Dasbhoard Help"
85 Get-Help Show-MyDashboard
86 }
87 if($leeroy){
88 Write-Host ""
89 Write-Host "## Leeroy Jenkins!:"
90 Invoke-AgileCmd "gh issue list -l 'leeroy jenkins'"
91 }
92 if($orphans) {
93 Write-Host ""
94 Write-Host "## Issues with No Milestone"
95 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
96 }
97 if($pr) {
98 Write-Host ""
99 Write-Host "## Open Pull Requests"
100 Invoke-AgileCmd "gh pr list"
101 }
102 if($requested){
103 Write-Host ""
104 Write-Host "## Open Stakeholder Requests"
105 invoke-agilecmd "gh issue list -S 'label:requested'"
106 }
107 if($todo) {
108 Write-Host ""
109 Write-Host "## Todo List"
110 todolist
111 }
112 }
113
114 function Show-MyTeamWork() {
115 $team = @('ddriddle', 'zcarrington', 'tzturner', 'mpitcel', 'edthedev')
116 $team | ForEach-Object {
117 "## $_ - Issues Assigned"
118 Get-AgileQuery -Assignee $_ | Invoke-AgileQuery | Show-MarkdownFromGitHub
119 }
120 }
121
122 function Write-AgileClosedData() {
123 $gh_cmd = 'gh issue list --state closed --json title,closedAt,milestone,url'
124 Write-AgileToFile -gh_command $gh_cmd
125 }
126
127 Export-ModuleMember -Function Write-AgileClosedData
128 Export-ModuleMember -Function Show-MyDashboard
129 Export-ModuleMember -Function Show-MyTeamWork