Skip to content

Instantly share code, notes, and snippets.

@jdhitsolutions
Last active April 7, 2024 11:39
Show Gist options
  • Save jdhitsolutions/36f16e9b2d89353cfa93edc8e4b5b3c3 to your computer and use it in GitHub Desktop.
Save jdhitsolutions/36f16e9b2d89353cfa93edc8e4b5b3c3 to your computer and use it in GitHub Desktop.
PowerShell Podcast Scripting Challenge

PowerShell Podcast ScriptingChallenge

This is the PowerShell scripting challenge from my appearance on the PowerShell Podcast

Base Challenge

Using whatever tools and techniques you want, write a PowerShell function that will query the Issues section of a GitHub repository and create output showing the number of open issues by label and the percentage of all open issues. Remember that multiple labels may be used with an issue.

For example, if there are 54 open issues and the bug label is used 23 times,your output would show a count of 23 and a total percentage of 42.59 for the bug label.

The function should work for any GitHub repository, but test it with the PowerShell repository. Naturally, the function should follow community accepted best practices, have parameter validation, and proper error handling.

Bonus Challenges

Once you have the function, add custom formatting to display the results in a table, including the repository name or path.

Create an alternative view that will also display the repository and the label URI that GitHub uses to create a filtered page view.

Finally, create a control script using the function to create a markdown report for the PowerShell repository showing the top 25 labels. The markdown report should have clickable links.

You will most likely end up with several files to meet all the challenge requirements.

Hint: There's more than one way to access the GitHub API.

To Participate

We hope many people will test their skills with this challenge. You are encouraged to post a comment with a link to your solution. Please do not post your solution. In about 4-6 weeks, I will post my solutions. There is no single correct solution to this challenge and the goal is to have fun and learn something new along the way.

Happy Scripting!

@jdhitsolutions
Copy link
Author

I wrote about my solution here

Label Report for powershell/powershell

This is the breakdown of labels based on 813 open issues. Total percentages might be more than 100% as issues can have multiple labels.

Count Percent of Total Label
503 61.87 Needs-Triage
302 37.15 Issue-Enhancement
114 14.02 WG-Engine
88 10.82 Issue-Bug
71 8.73 Up-for-Grabs
62 7.63 WG-Cmdlets
61 7.5 WG-Cmdlets-Utility
54 6.64 In-PR
45 5.54 WG-Language
43 5.29 WG-Cmdlets-Management
36 4.43 WG-NeedsReview
34 4.18 WG-Cmdlets-Core
33 4.06 Issue-Question
33 4.06 Issue-Discussion
25 3.08 WG-Reviewed
24 2.95 Area-FileSystem-Provider
22 2.71 Area-Maintainers-Build
20 2.46 WG-Interactive-Console
20 2.46 WG-Engine-Providers
19 2.34 Committee-Reviewed
15 1.85 KeepOpen
15 1.85 Distribution-Request
11 1.35 Needs-Investigation
10 1.23 WG-Security
10 1.23 WG-Interactive-HelpSystem
9 1.11 WG-Remoting
9 1.11 WG-Interactive-IntelliSense
8 0.98 WG-Engine-Module
8 0.98 Review - Maintainer
7 0.86 WG-Engine-Performance
7 0.86 OS-Linux
7 0.86 Area-Maintainers-Documentation
6 0.74 WG-Triaged
6 0.74 WG-Engine-Format
6 0.74 Hacktoberfest
6 0.74 Breaking-Change
5 0.62 WG-DevEx-Portability
5 0.62 OS-Windows
5 0.62 OS-macOS
4 0.49 WG-Engine-ParameterBinder
4 0.49 Waiting - DotNetCore
3 0.37 WG-Interactive-Debugging
3 0.37 Resolution-By Design
3 0.37 Issue-Meta
3 0.37 Documentation Needed in this repo
3 0.37 Area-PowerShellGet
2 0.25 WG-Interactive-PSReadLine
2 0.25 WG-DevEx-SDK
2 0.25 RFC-Required
2 0.25 Resolution-No Activity
2 0.25 Package-MSIX
2 0.25 OS-WSL
2 0.25 Needs-Repro
2 0.25 Issue-Code Cleanup
2 0.25 Area-DSC
1 0.12 WG-Quality-Test
1 0.12 WG-Engine-Pipeline
1 0.12 Resolution-Declined
1 0.12 Release-Testing
1 0.12 PowerShell-Docs needed
1 0.12 Issue-Regression
1 0.12 Hacktoberfest-Accepted
1 0.12 CL-Test
1 0.12 7.4-regression

03/07/2024 13:55:36

@pauljnav
Copy link

pauljnav commented Apr 7, 2024

Hi @jdhitsolutions / all,
Heres my solution.
Im late to this challenge but would appreciate feedback especially as I took the GitHub API approach (unauthenticated and rate-limited)
Paul

LabelCountPercent
Needs-Triage51855.52%
Issue-Enhancement30833.01%
WG-Engine12112.97%
Review - Needed11412.22%
Issue-Bug849.00%
Up-for-Grabs717.61%
WG-Cmdlets697.40%
WG-Cmdlets-Utility606.43%
Extra Small586.22%
In-PR576.11%
WG-NeedsReview515.47%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment