en-US/about_ProjectDemo.help.txt
TOPIC about_ProjectDemo AUTHOR rulasg COPYRIGHT (c) rulasg. All rights reserved. SHORT DESCRIPTION Module to create a Project for a Demo LONG DESCRIPTION Module to create a Project for a Demo KEYWORDS Powershell Testing UnitTest Module TestingHelper SEE ALSO https://github.com/rulasg/TestingHelper/ CREATE A PROJECT FOR DEMO If you want to demo GitHub Projects you need a fre repos with issues and a project that will be used to manage the issues. Use New-ProjectDemo to create a project, 2 repos and issues. > New-ProjectDemo -name testproject -Owner solidifydemo ✓ Created repository SolidifyDemo/testproject-repo-front on GitHub ✓ Edited repository solidifydemo/testproject-repo-front ✓ Created repository SolidifyDemo/testproject-repo-back on GitHub ✓ Edited repository solidifydemo/testproject-repo-back 1. Creating Issue 7e620e7d for repo [solidifydemo/testproject-repo-front] 2. Creating Issue 814a6044 for repo [solidifydemo/testproject-repo-front] 3. Creating Issue 921808ae for repo [solidifydemo/testproject-repo-front] 4. Creating Issue e58c4ee4 for repo [solidifydemo/testproject-repo-front] 5. Creating Issue 07b6fc5e for repo [solidifydemo/testproject-repo-front] 1. Creating Issue 8a85a534 for repo [solidifydemo/testproject-repo-back] 2. Creating Issue 43994e7d for repo [solidifydemo/testproject-repo-back] 3. Creating Issue d609e636 for repo [solidifydemo/testproject-repo-back] 4. Creating Issue f2a5c2c2 for repo [solidifydemo/testproject-repo-back] 5. Creating Issue 3d862891 for repo [solidifydemo/testproject-repo-back] Project [testproject] created on Owner [solidifydemo] with number [87] https://github.com/orgs/SolidifyDemo/projects/87 TEST THE CREATION OF PROJECT DEMO You can use Test-ProjectDemo to confirm that the demo has been created properly. > Test-projectDemo -name testproject -Owner solidifydemo True Use the verbose mode to see the checks that are being done. > Test-ProjectDemo -name testproject -Owner solidifydemo -verbose VERBOSE: Testing Project Demo [testproject] for owner [solidifydemo] VERBOSE: Testing if repo [solidifydemo/testproject-repo-back] exists. VERBOSE: [Test-Repo] gh repo view solidifydemo/testproject-repo-back *>&1 VERBOSE: True VERBOSE: Testing if repo [solidifydemo/testproject-repo-front] exists. VERBOSE: [Test-Repo] gh repo view solidifydemo/testproject-repo-front *>&1 VERBOSE: True VERBOSE: Testing if project [testproject] exists for owner [solidifydemo] VERBOSE: [Test-Project] gh project list --owner solidifydemo -L 1000 --format json VERBOSE: True VERBOSE: Repo [ solidifydemo/testproject-repo-back ] exists VERBOSE: Repo [ solidifydemo/testproject-repo-front ] exists VERBOSE: Project [testproject] exists VERBOSE: Found Project Demo componets. Return True on Test True DEFAULT PROJECTDEMO ENVIRONMENT VALUES To build the demo we use standard values for the repos and issues. You can use Get-Environment to get the values. > Get-Environment -name testproject -Owner solidifydemo Name : testproject Owner : solidifydemo DefaultOwner : SolidifyDemo Topic : projectdemo-testproject RepoFront : testproject-repo-front RepoBack : testproject-repo-back RepoFrontWithOwner : solidifydemo/testproject-repo-front RepoBackWithOwner : solidifydemo/testproject-repo-back IssuesAmount : 5 GET THE PROJECT NUMBER For some gh commands the project number is used to identify the project. You can use Get-ProjectNumber to get the project number. > Get-ProjectNumber -Name testproject -Owner Solidifydemo 87 FIND PROJECTDEMO REPOS ProjectDemo uses topics to scope the repos that belongs to a demo. Find all repos that bleong to a demo using the default topic "projectdemo" > gh repo list solidifydemo --topic projectdemo Showing 4 of 4 repositories in @SolidifyDemo that match your search SolidifyDemo/testproject2-repo-back Repo part of Project Demo public 0m SolidifyDemo/testproject2-repo-front Repo part of Project Demo public 0m SolidifyDemo/testproject-repo-back Repo part of Project Demo public 5m SolidifyDemo/testproject-repo-front Repo part of Project Demo public 5m To find the repos of a particular demo use the topic Topic = "projectdemo-" + $Name > gh repo list solidifydemo --topic projectdemo-testproject2 Showing 2 of 2 repositories in @SolidifyDemo that match your search SolidifyDemo/testproject2-repo-back Repo part of Project Demo public 2m SolidifyDemo/testproject2-repo-front Repo part of Project Demo public 2m ADD MORE ISSUES TO REPO There is a default of issues that are added to the demo repos during New-ProjectDemo. Is possible that to make a better demo you need more issued on the demo repos. Use Add-IssuesToRepo to add mode issues to a repo. > Add-IssueToRepo -RepoWithOwner solidifydemo/testproject2-repo-back -Amount 5 1. Creating Issue e97444a6 for repo [solidifydemo/testproject2-repo-back] 2. Creating Issue ae0c3bfb for repo [solidifydemo/testproject2-repo-back] 3. Creating Issue 92a7ce82 for repo [solidifydemo/testproject2-repo-back] 4. Creating Issue 77850d3c for repo [solidifydemo/testproject2-repo-back] 5. Creating Issue 3a262c6e for repo [solidifydemo/testproject2-repo-back] ADD ALL DEMO REPOS ISSUES TO DEMO PROJECT On demo creation issues are not added to the project. This allows to show the projet emptuy of issues. When needed use Add-ItemsToProject to add all the demo repo issues to the demo project. Use the Verbose mode to see as the issues are added. > add-ItemsToProject -name testproject -Owner solidifydemo -Verbose VERBOSE: [Get-ProjectNumber] Getting project number for project [testproject] in [solidifydemo] VERBOSE: [Get-ProjectNumber] gh project list --owner solidifydemo --format json -L 1000 VERBOSE: [Get-ProjectNumber] Found 45 projects VERBOSE: [Get-ProjectNumber] Filtering projectList by name [testproject] VERBOSE: [Get-ProjectNumber] Found project [testproject] with number [93] VERBOSE: Adding issues from [solidifydemo/testproject-repo-front] to project [93] with owner [solidifydemo] VERBOSE: Found [5 issues in repo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-front/issues/5] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-front/issues/4] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-front/issues/3] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-front/issues/2] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-front/issues/1] to project [93] with owner [solidifydemo] VERBOSE: Adding issues from [solidifydemo/testproject-repo-back] to project [93] with owner [solidifydemo] VERBOSE: Found [5 issues in repo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-back/issues/5] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-back/issues/4] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-back/issues/3] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-back/issues/2] to project [93] with owner [solidifydemo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-back/issues/1] to project [93] with owner [solidifydemo] CREATE AN EXTRA REPO FOR THE DEMO If you need an extra repo to show a 3 repo project planning follow this steps. Use the environments topics to link the repo to the demo for later removal. > $e = Get-Environment -Name testproject -Owner solidifydemo > New-Repo -RepoWithOwner solidifydemo/testproject-repo-apendix -RepoTopic $e.RepoTopic -FixedTopic $e.FixedTopic https://github.com/SolidifyDemo/testproject-repo-apendix > Add-IssueToRepo -RepoWithOwner SolidifyDemo/testproject-repo-apendix -Amount 5 1. Creating Issue 1539fb5a for repo [SolidifyDemo/testproject-repo-apendix] 2. Creating Issue 4cabf216 for repo [SolidifyDemo/testproject-repo-apendix] 3. Creating Issue d5730f34 for repo [SolidifyDemo/testproject-repo-apendix] 4. Creating Issue 3cafdfe2 for repo [SolidifyDemo/testproject-repo-apendix] 5. Creating Issue 393e63ec for repo [SolidifyDemo/testproject-repo-apendix] ADD ISSUES OF A DIFFERENT REPO It may be useful to add issues from a different repo to the demo project. Use Add-ItemsToProjectFromARepo to add issues from a different repo to the demo project. > Get-ProjectNumber -Name testproject -Owner Solidifydemo 93 > Add-ItemsToProjectFromARepo -ProjectNumber 93 -Owner solidifydemo -RepoNameWithOwner SolidifyDemo/testproject-repo-apendix -verbose VERBOSE: Adding issues from [SolidifyDemo/testproject-repo-apendix] to project [93] with owner [solidifydemo] VERBOSE: Found [5 issues in repo] VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-apendix/issues/5] to project [93] with owner [solidifydemo] VERBOSE: Performing the operation "gh issue list -R SolidifyDemo/testproject-repo-apendix --json url " on target "SolidifyDemo/testproject-repo-apendix". VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-apendix/issues/4] to project [93] with owner [solidifydemo] VERBOSE: Performing the operation "gh issue list -R SolidifyDemo/testproject-repo-apendix --json url " on target "SolidifyDemo/testproject-repo-apendix". VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-apendix/issues/3] to project [93] with owner [solidifydemo] VERBOSE: Performing the operation "gh issue list -R SolidifyDemo/testproject-repo-apendix --json url " on target "SolidifyDemo/testproject-repo-apendix". VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-apendix/issues/2] to project [93] with owner [solidifydemo] VERBOSE: Performing the operation "gh issue list -R SolidifyDemo/testproject-repo-apendix --json url " on target "SolidifyDemo/testproject-repo-apendix". VERBOSE: Adding issue [https://github.com/SolidifyDemo/testproject-repo-apendix/issues/1] to project [93] with owner [solidifydemo] VERBOSE: Performing the operation "gh issue list -R SolidifyDemo/testproject-repo-apendix --json url " on target "SolidifyDemo/testproject-repo-apendix". SHUFFLE STATUS VALUE ON ISSUES Once added the issues to the project the Status field is not set. Use the Update-FieldValueSingleSelectToProject command to set the status field to a random value. > Update-FieldValueToProject -ProjectNumber 116 -FieldName Status ............... You can use this command to SHUFFLE values of any other SINGLE SELECT field. ADD PRIORITY FIELD TO THE PROJECT Priority is a field very commonly used. Use Add-FieldSingleSelectToProject to add the Priority field to the project. Use Update-FieldValueSingleSelectToProject to set a random value to the field. > Add-FieldSingleSelectToProject -ProjectNumber 116 -FieldName "Priority" -Options "🔥Critical,🥵High,😊Normal,🥶Low" Add Priority ot project 116 > Update-FieldValueSingleSelectToProject -ProjectNumber 116 -FieldName Priority ............... Or directly use Add-PriorityFieldToProject to add the field and set a random value. > ADD OTHER SINGLE SELECT FIELDS LIKE SEVERITY Other fields are also interesting to be added to allow a good demo. Consider adding the Severity Field using Add-SeverityFieldToProject and set a random value using Update-FieldValueSingleSelectToProject. > Add-FieldSingleSelectToProject -ProjectNumber 116 -FieldName "Severity" -Options "Critical⭐️⭐️⭐️⭐️,Important⭐️⭐️⭐️,Needed⭐️⭐️,Nice⭐️" Add Severity ot project 116 > update-FieldValueSingleSelectToProject -ProjectNumber 116 -FieldName Severity ............... Or directly use Add-SeverityFieldToProject to add the field and set a random value. ADD TIMETRACKER FIELD IN PROJECT To show the Field SUM feature you need a field type numeric with values. Use Add-TimeTrackerToProject to add a field to the project and add a random value the items in the project. This command requires the ProjectNumber. > Get-ProjectNumber -Name testproject -Owner Solidifydemo 93 > Add-TimeTrackerToProject -owner solidifydemo -ProjectNumber 93 Created field Edited item "Issue 8f29721b" Edited item "Issue 55380972" Edited item "Issue 6b996ca6" Edited item "Issue ea39678a" Edited item "Issue 4fb2cbcb" Edited item "Issue 43437b6f" Edited item "Issue 88f36187" Edited item "Issue 2eef1078" Edited item "Issue 3980dce2" Edited item "Issue e092ade0" Edited item "Issue 4045c121" Edited item "Issue dea37647" Edited item "Issue 6c9efc76" Edited item "Issue 6d2f17c9" Edited item "Issue d52dc697" REMOVE A PROJECTDEMO Once done, with the philosophy of create, use, destroy, you should remove the demo. > Remove-ProjectDemo -name testproject -Owner solidifydemo Removed project [91] in [solidifydemo] Deleted repo [SolidifyDemo/testproject-repo-back] Deleted repo [SolidifyDemo/testproject-repo-front] FIND PROJECTDEMO If you can't remember the projects you have created use Find-ProrojectDemo > find-projectDemo Name : testproject2 User : raulgeu Title : testproject2 Owner : SolidifyDemo Url : https://github.com/orgs/SolidifyDemo/projects/114 Name : testproject User : rulasg Title : testproject Owner : SolidifyDemo Url : https://github.com/orgs/SolidifyDemo/projects/113 Filter by user to find yours > find-projectdemo -user rulasg Name : testproject User : rulasg Title : testproject Owner : SolidifyDemo Url : https://github.com/orgs/SolidifyDemo/projects/113 Pipe the output of Find-ProjectDemo to Remove-ProjectDemo to remove the project > find-projectdemo -user rulasg | Remove-ProjectDemo Removed project [113] in [SolidifyDemo] Deleted repo [SolidifyDemo/testproject-repo-back] Deleted repo [SolidifyDemo/testproject-repo-front] |