Skip to content

Add Enable-ExperimentalFeature and Disable-ExperimentalFeature cmdlets - #8318

Merged
Dongbo Wang (daxian-dbw) merged 20 commits into
PowerShell:masterfrom
SteveL-MSFT:experimental-feature-cmdlets
Dec 5, 2018
Merged

Add Enable-ExperimentalFeature and Disable-ExperimentalFeature cmdlets#8318
Dongbo Wang (daxian-dbw) merged 20 commits into
PowerShell:masterfrom
SteveL-MSFT:experimental-feature-cmdlets

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Nov 20, 2018

Copy link
Copy Markdown
Member

PR Summary

Add Enable-ExperimentalFeature and Disable-ExperimentalFeature cmdlets. Remove -ListAvailable from Get-ExperimentalFeature (Breaking Change). Add ArgumentCompleter for Get-ExperimentalFeature cmdlet. Refactor some existing Experimental Feature tests. Make ConfigScope public and renamed SystemWide to AllUsers.

Implements PowerShell/PowerShell-RFC#148

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Nov 20, 2018
@rjmholt Rob Holt (rjmholt) added the Documentation Needed in this repo Documentation is needed in this repo label Nov 20, 2018

@rjmholt Rob Holt (rjmholt) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have left some small comments, but it all looks pretty good to me. We should also make sure we start the documentation process before merging this PR.

Comment thread src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs Outdated
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should write to file only if the features array changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be a separate issue for WriteValueToFile(). Opened #8325

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I disagree. We can save even running WriteValueToFile() code, which involves opening the file and reading data, by simply keeping track of whether we actually have a change to record.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we are concerned with file contention. If so, then I assume the last write to should win, and it makes sense to ensure the file actually reflects the current config state.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iSazonov Ilya (iSazonov) added CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log CL-Engine Indicates that a PR should be marked as an engine change in the Change Log labels Nov 21, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

Can we assign two CL- labels?

@SteveL-MSFT Steve Lee (SteveL-MSFT) added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Nov 28, 2018
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@PowerShell/powershell-committee reviewed this as part of the RFC review and approves of the breaking change and current cmdlet design

add enable/disable-experimentalfeature cmdlets
updated existing tests
address CodeFactor issues
fix AppVeyor failure
address Paul and Rob's feedback
@SteveL-MSFT Steve Lee (SteveL-MSFT) removed the Documentation Needed in this repo Documentation is needed in this repo label Nov 29, 2018
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Doc PR submitted and linked

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lost the comment perUserConfigFile -> _perUserConfigFile for private.

Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
Comment thread test/powershell/engine/Basic/DefaultCommands.Tests.ps1 Outdated
Comment thread test/powershell/engine/Basic/DefaultCommands.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated
Comment thread test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 Outdated

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steve Lee (@SteveL-MSFT) You skipped two my comments for Should -BeFalse

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) it was hidden under GitHub collapsing it. Thanks for calling it out. Fixed.

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) HelpUri do not pass tests.

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we need remove the cmdlets from release versions.

…ableDisableExperimentalFeatureCommand.cs

Co-Authored-By: SteveL-MSFT <[email protected]>
Comment thread src/System.Management.Automation/engine/PSConfiguration.cs Outdated
…ableDisableExperimentalFeatureCommand.cs

Co-Authored-By: SteveL-MSFT <[email protected]>
address Dongbo's feedback
@daxian-dbw

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) One test for Enable/Disable-ExperimentalFeature cmdlets failed in CI runs. Can you please take a look?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) I forgot to update the tests to reflect that the cmdlet no longer outputs the feature object. Will update.

fix tests to reflect that no object is output from cmdlets on success
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 52aef57 into PowerShell:master Dec 5, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the experimental-feature-cmdlets branch June 6, 2020 02:29
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…dlets (PowerShell#8318)

[breaking change]
Major changes are as follows:
- Add `Enable-ExperimentalFeature` and `Disable-ExperimentalFeature` cmdlets.
- Remove `-ListAvailable` from `Get-ExperimentalFeature`.
- Add `ArgumentCompleter` for `Get-ExperimentalFeature` cmdlet.
- Refactor some existing Experimental Feature tests.
- Make `ConfigScope` public and renamed `SystemWide` to `AllUsers`. Also update experimental feature code to prefer the current user config over the all user config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log CL-Engine Indicates that a PR should be marked as an engine change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants