FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove a type conversion for CommaDelimitedStringCollection by iSazonov · Pull Request #11000 · PowerShell/PowerShell · GitHub

Remove a type conversion for CommaDelimitedStringCollection - #11000

Merged
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
iSazonov:cleanup-stringcomma
Nov 13, 2019
Merged

Remove a type conversion for CommaDelimitedStringCollection#11000
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
iSazonov:cleanup-stringcomma

Conversation

Ilya (iSazonov) commented Nov 6, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator

PR Summary

Now CommaDelimitedStringCollection class is available in .Net Core 3.0 but after a discussion we decided to remove the old code as very rarely used.
Users can add the converter with Update-TypeData cmdlet if needed.

PR Context

PR Checklist

Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Nov 6, 2019
Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Nov 6, 2019
@@ -5006,13 +5006,11 @@ private static IConversionData FigureLanguageConversion(Type fromType, Type toTy
return CacheConversion<StringCollection>(fromType, toType, LanguagePrimitives.ConvertToStringCollection, rank);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ilya (@iSazonov), your last commit had 1 failures in PowerShell-CI-macos
Validate start of console host.No new assemblies are loaded

Expected exactly $null, but got @{InputObject=System.Configuration.ConfigurationManager.dll; SideIndicator==>}.
at <ScriptBlock>, /Users/runner/runners/2.160.0/work/1/s/test/powershell/Host/Startup.Tests.ps1: line 125
125:         $diffs | Should -BeExactly $null

@@ -5006,13 +5006,11 @@ private static IConversionData FigureLanguageConversion(Type fromType, Type toTy
return CacheConversion<StringCollection>(fromType, toType, LanguagePrimitives.ConvertToStringCollection, rank);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ilya (@iSazonov), your last commit had 2 failures in PowerShell-CI-windows
Enter-PSHostProcess tests.By CustomPipeName.Can enter, exit, and re-enter using CustomPipeName

Expected $true, because The script was able to re-enter another process and grab the pipe of 'lste30rz.0ra'., but got $false.
at <ScriptBlock>, D:\a\1\s\test\powershell\Modules\Microsoft.PowerShell.Core\Enter-PSHostProcess.Tests.ps1: line 170
170:                     Should -BeTrue -Because "The script was able to re-enter another process and grab the pipe of '$pipeName'."

Validate start of console host.No new assemblies are loaded

Expected exactly $null, but got @{InputObject=System.Configuration.ConfigurationManager.dll; SideIndicator==>}.
at <ScriptBlock>, D:\a\1\s\test\powershell\Host\Startup.Tests.ps1: line 125
125:         $diffs | Should -BeExactly $null

@@ -5006,13 +5006,11 @@ private static IConversionData FigureLanguageConversion(Type fromType, Type toTy
return CacheConversion<StringCollection>(fromType, toType, LanguagePrimitives.ConvertToStringCollection, rank);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ilya (@iSazonov), your last commit had 1 failures in PowerShell-CI-linux
Validate start of console host.No new assemblies are loaded

Expected exactly $null, but got @{InputObject=System.Configuration.ConfigurationManager.dll; SideIndicator==>}.
at <ScriptBlock>, /home/vsts/work/1/s/test/powershell/Host/Startup.Tests.ps1: line 125
125:         $diffs | Should -BeExactly $null

Comment thread test/powershell/Host/Startup.Tests.ps1 Outdated
'System.ComponentModel.dll'
'System.ComponentModel.Primitives.dll'
'System.ComponentModel.TypeConverter.dll'
'System.Configuration.ConfigurationManager.dll'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's not worth it to add this converter to the cache at the very beginning.
This dll is 959 kb, almost 1mb, and this converter will rarely to be used (only for compatibility purpose). Pulling in the dll at startup time is not right.

Ilya (iSazonov) Nov 7, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes :-). Have you an idea how add ConvertToCommaDelimitedStringCollection() not at startup?

  • I wonder why did Windows PowerShell add this in cache?
  • Also I wonder why do we load so many dll-s at startup although it seems they are not used.

Ilya (iSazonov) Nov 7, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could add new converter using TypeTable_Types_Ps1Xml.cs like Microsoft.PowerShell.DeserializingTypeConverter but I guess that typeof(CommaDelimitedStringCollection) reference in the converter will load the assembly at startup. So we need a conclusion do we want to return back the Windows PowerShell feature.

Update: On Github I don't find PowerShell scripts using CommaDelimitedStringCollection. So we could remove the code as formally breaking change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Dongbo Wang (@daxian-dbw) Steve Lee (@SteveL-MSFT) Could you please make a conclusion should we add back the converter?

.Net Core (and .Net Framework) does not use it on CommaDelimitedStringCollection by default. I don't know why it was added in Windows PowerShell.
I think we could remove the code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since PSCore6 didn't have this and I haven't seen any complaints about it along with your GitHub search it seems unlikely anyone missed that this was gone. So it seem we should not add it back given the size.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Great, then this PR can be closed 😄

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I removed the old code in the PR and updated the PR description.

ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Nov 6, 2019
Ilya (iSazonov) changed the title Enable a type conversion for CommaDelimitedStringCollection Remove a type conversion for CommaDelimitedStringCollection Nov 13, 2019
Dongbo Wang (daxian-dbw) merged commit 525dcfe into PowerShell:master Nov 13, 2019
Ilya (iSazonov) deleted the cleanup-stringcomma branch November 14, 2019 03:07

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL