Remove SupportsShouldProcess from Start-PSBootstrap in build.psm1 (closes #15490)#15491
Conversation
This addresses PowerShell#15490 on PowerShell/PowerShell
|
I don’t think implementing |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@schuelermine This function could simply gate the running of that script behind a ShouldProcess check itself, no? |
|
True, should I re-add |
|
Might be worth doing, yeah. Not sure if this function handles other things that would warrant a similar check for those parts as well? |
|
ok, I will write that when I'm back home (3hrs from now) |
|
/azp rerun |
|
Command 'rerun' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
@vexx32 While I am in support of this PR being merged, I have also opened another one w/ an attempt at implementing ShouldProcess. An alternate option, if you will. |
|
@schuelermine it looks like all the CIs are failing for this PR and not in the master branch, and I can't merge it until CI passes. I took a brief look and it's not entirely clear what's going on, but it does look possibly related to your change ( |
|
Alternately solved by #15548 |
Hopefully this will adress the issues in PR PowerShell#15491 I’m not sure why the build would fail — I hadn’t changed anything besides removing the CmdletBindingAttribute parameters… I’ve checked if build.psm1 or ci.psm1 (which is where the errors semm to be happening) ever mention “WhatIf” or “ShouldProcess” — they don’t. ci.psm1’s Invoke-CIBuild seems to be failing because Get-PSOptions (imported from build.psm1) returns $null. However, this is because of a global variable set at the top of the script, which was there before my changes occurred. I’m very confused.
|
I don’t think the failing is caused by me—here’s a copy of my reasoning from the commit message:
|
|
OK this bothers me - why does the Bootstrap step show passed when it clearly failed. I just spent weeks fixing a similar issue with the Jenkins durable-task-plugin. 🤦♂️ Looks like someone will need to update the Action to tweak that |
|
I can't look through the code right now, I'm not at my computer right now - but it seems like some function might've called Start-PSBootstrap w/ |
|
OK, yeah, that's definitely the case - Start-CIInstall has this line: Start-PSBootstrap -Confirm:$false(can't remove it now, will do soonish) |
|
Oh, I just read that you found that, too. Sorry for making that duplicate observation. |
|
I think removing ConfirmImpact in build.psm1 and adding a $ConfirmPreference declaration to ci.psm1 is a good solution - gonna do that when I'm home. |
|
Actually, $ConfirmPreference probably isn't even necessary, since Start-PSBootstrap never calls ShouldProcess or ShouldContinue. |
|
Intermittent PSGallery glitch? |
Yes, I restarted CI 5 minutes later and it passed. |
|
🎉 Handy links: |





PR Summary
Removes
SupportsShouldProcessfromStart-PSBootstrapinbuild.psm1.This addresses #15490.
PR Context
build.psm1contains the functionStart-PSBoostrap. TheCmdletBindingin it stated that it supportsShouldProcess, but this isn’t the case.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).