X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/9ae21ab320e7b5b57c562ddce26d173da12d1cfa..196a79a87a19325fde380332b2fe3844276cf6aa:/psmodules/edgithub.psm1 diff --git a/psmodules/edgithub.psm1 b/psmodules/edgithub.psm1 index 2ccb330..2a844eb 100644 --- a/psmodules/edgithub.psm1 +++ b/psmodules/edgithub.psm1 @@ -21,6 +21,28 @@ function Get-GHClosed { } +<# +.SYNPOSIS + +Fetch GitHub issues that are tagged to discuss this morning. + +#> +function Get-GHToDiscuss { + param( + [int]$days = -14 + ) + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' } + $closed = @() + $repos | ForEach-Object { + $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + $issues = $issues | Where-Object { $_.labels -Contains 'DiscussAtStandUp' } + + return $issues +} + + <# .SYNOPSIS @@ -72,8 +94,93 @@ function Show-GHMine() { } } +<# +.SYNOPSIS + +Get GitHub issues that need sized. + +.DESCRIPTION + +Runs this GitHub search: +is:open is:issue -label:M -label:L -label:S -label:XL -label:XS + +#> +function Get-GHUnsized() { + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' } + $issues = @() + $repos | ForEach-Object { + $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + + # Ignore issues that have been updated in the last day. + $issues = $issues | Where-Object { -Not $_.labels -Contains 'XS' } + $issues = $issues | Where-Object { -Not $_.labels -Contains 'S' } + $issues = $issues | Where-Object { -Not $_.labels -Contains 'M' } + $issues = $issues | Where-Object { -Not $_.labels -Contains 'L' } + # Leave XL issues, as they need split. + + return $issues +} + +function Get-GHNoMilestone() { + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' } + $issues = @() + $repos | ForEach-Object { + $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + + # Get open issues with empty milestone + $issues = $issues | Where-Object { $null -eq $_.milestone } + return $issues +} +function Show-GHNoMilestone(){ + Get-GHNoMilestone| Show-GHIssuesAsMarkdown +} + + +function Show-GHUnsized() { + Get-GHUnsized | ForEach-Object { + # Markdown output + " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + $_.labels + } +} + +function Show-GHByAssignee() { + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'open'; OwnerName = 'techservicesillinois' } + $issues = @() + $repos | ForEach-Object { + $issues += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + + # TODO: Group output by assignee. + + return $issues +} + + + +function Show-GHToDiscuss() { + Get-GHToDiscuss | Show-GHIssuesAsMarkdown +} + + +function Show-GHIssuesAsMarkdown() { + process + { + # Markdown output + " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + } +} + Export-ModuleMember -Function Get-GHClosed Export-ModuleMember -Function Show-GHClosed Export-ModuleMember -Function Get-GHMine -Export-ModuleMember -Function Show-GHMine \ No newline at end of file +Export-ModuleMember -Function Show-GHMine +Export-ModuleMember -Function Get-GHUnsized +Export-ModuleMember -Function Show-GHUnsized +Export-ModuleMember -Function Show-GHToDiscuss +Export-ModuleMember -Function Show-GHNoMilestone \ No newline at end of file