Uh oh!
There was an error while loading. Please reload this page.
PowerShellForGitHub: Improve and Standardise WhatIf/Confirm Processing - #248
PowerShellForGitHub: Improve and Standardise WhatIf/Confirm Processing#248Simon Heather (X-Guardian) wants to merge 1 commit into
Conversation
Simon Heather (X-Guardian)
commented
Jun 28, 2020
Ran the whole test suite for this PR, and the |
Howard Wolosky (HowardWolosky)
commented
Jun 28, 2020
Oh no. I've immediately merged in #251 to avoid this in the future. So sorry about that. |
Simon Heather (X-Guardian)
commented
Jun 28, 2020
I've still got the branches locally, so no lost work, and I've pushed them back to my new fork of the repo, but the links to the open PRs are broken. PRs affected are:
Any idea how to fix the PRs? |
Howard Wolosky (HowardWolosky)
commented
Jun 28, 2020
Not sure yet. Doing some searching online. Will be able to look a bit more this afternoon. |
Howard Wolosky (HowardWolosky)
commented
Jun 28, 2020
I don't think you can. https://stackoverflow.com/questions/36071272/fix-unknown-repository-of-an-opened-pr-after-deleted-the-fork I think you'll just need to create new pull requests for those outstanding ones, and then close out the ones that have now been orphaned. |
Howard Wolosky (HowardWolosky)
left a comment
There was a problem hiding this comment.
Overall this looks good. Thanks for the effort.
A couple nits, and then a few that referenced the wrong value.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Howard Wolosky (HowardWolosky)
commented
Jun 29, 2020
Actually, looking at this a bit more as full files as opposed to just the diffs, I think the one thing about the pattern that I'd change is that I'd move the check to the top of the functions as opposed to right before the call to |
Uh oh!
There was an error while loading. Please reload this page.
Simon Heather (X-Guardian)
commented
Jun 29, 2020
If you are running a function with the |
Howard Wolosky (HowardWolosky)
commented
Jun 29, 2020
Sufficiently compelling argument for me. Please keep as-is. |
Simon Heather (X-Guardian)
commented
Jun 29, 2020
This PR is superseded by PR #254 |
Description
This PR improves and standardises the WhatIf/Confirm ('ShouldProcess') processing across all the functions.
Summary of changes
$PSCmdlet.ShouldProcesscheck out ofInvoke-GHRestMethodand added it to the calling functions with the correct operation and target.Write-InvocationLogline in each resource function to after the$PSCmdlet.ShouldProcesscondition block. This will prevent the log being updated ifShouldProcessis$false.WhatIf:$falseandConfirm:$falseto theOut-FileCmdlet call in theWrite-Logfunction in the Helpers module. This will prevent theWrite-Logfunction displayingWhatIfandConfirmprompts.ShouldProcessfrom non-state changing functions.ShouldProcessconditions to use an early return.Set-GitHubIssueLabelfunction to removeConfirmImpact='High'and setConfirmPreferenceto 'Low' if no labels have been specified instead.Update-GitHubRepositoryfunction to removeConfirmImpact='High'and setConfirmPreferenceto 'Low' if the repo is being renamed instead.Issues Fixed
References
N/A
Checklist
Comment-based help added/updated, including examples.Changes to the manifest file follow the manifest guidance.Unit tests were added/updated and are all passing. See testing guidelines. This includes making sure that all pipeline input variations have been covered.Relevant usage examples have been added/updated in USAGE.md.If desired, ensure your name is added to our Contributors list