Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging #if statements for Az #7712

Merged
merged 26 commits into from
Nov 28, 2018
Merged

Tagging #if statements for Az #7712

merged 26 commits into from
Nov 28, 2018

Conversation

MiYanni
Copy link
Contributor

@MiYanni MiYanni commented Oct 31, 2018

Description

This is for: #6793

Status Name Location Notes
Tagged StartAzureRmAksDashboard.cs src\ResourceManager\Aks\Commands.Aks\Commands\  
Tagged AddAzureASAccount.cs src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Commands\  
Resolved Export-AzureAsInstanceLog.cs src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Commands\  
Resolved Restart-AzureAsInstance.cs src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Commands\  
Tagged AsAzureAuthenticationProvider.cs src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Models\  
Tagged AsAzureClientSession.cs src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Models\  
Tagged RequestSettings.cs src\ResourceManager\Automation\Commands.Automation\Common\  
Tagged BatchClient.ApplicationPackages.cs src\ResourceManager\AzureBatch\Commands.Batch\Models\  
Low Risk NewAzureContainerGroupCommand.cs src\ResourceManager\ContainerInstance\Commands.ContainerInstance\Commands\ Command parameter was removed
Tagged SaveAzureDataFactoryLog.cs src\ResourceManager\DataFactories\Commands.DataFactories\DataSlices\  
Tagged DataFactoryClient.DataSlices.cs src\ResourceManager\DataFactories\Commands.DataFactories\Models\  
Low Risk DataLakeAnalyticsClient.cs src\ResourceManager\DataLakeAnalytics\Commands.DataLakeAnalytics\Models\ USqlCredential returned instead of USqlSecret. USqlCredential returned instead of ObsoleteUSqlCredential.
Tagged KeyVaultManagementCmdletBase.cs src\ResourceManager\KeyVault\Commands.KeyVault\Models\  
Tagged ModelExtensions.cs src\ResourceManager\KeyVault\Commands.KeyVault\Models\  
Tagged PSKeyVault.cs src\ResourceManager\KeyVault\Commands.KeyVault\Models\  
Tagged PSKeyVaultAccessPolicy.cs src\ResourceManager\KeyVault\Commands.KeyVault\Models\  
Tagged VaultManagementClient.cs src\ResourceManager\KeyVault\Commands.KeyVault\Models\  
Low Risk NewAzureVirtualNetworkCommand.cs src\ResourceManager\Network\Commands.Network\VirtualNetwork\ EnableVmProtection parameter was removed, but marked as deprecated in AzureRM
Low Risk ConnectAzureRmAccount.cs src\ResourceManager\Profile\Commands.Profile\Account\ Credential for UserParameterSet was removed
High Risk CertUtils.cs src\ResourceManager\RecoveryServices\Commands.RecoveryServices\Utilities\ No methods are 'actually' used from this file. Whole file should be removed. All methods are referenced in the below cmdlet.
High Risk GetAzureRMRecoveryServicesVaultSettingsFile.cs src\ResourceManager\RecoveryServices\Commands.RecoveryServices\Vault\ Different interface (parameter sets) enirely for Az. Migration may be difficult.
Tagged ApiVersionHelper.cs src\ResourceManager\Resources\Commands.ResourceManager\Cmdlets\Components\  
Tagged CamelCasePropertyNamesWithOverridesContractResolver.cs src\ResourceManager\Resources\Commands.ResourceManager\Cmdlets\Json\  
High Risk ResourcesBaseCmdlet.cs src\ResourceManager\Resources\Commands.Resources\Models.ResourceGroups\ GalleryTemplatesClient property removed
Low Risk ResourcesExtensions.cs src\ResourceManager\Resources\Commands.Resources\Models.ResourceGroups\ ToPSGalleryItem method was removed
Tagged AzureEndpointsCommunicator.cs src\ResourceManager\Sql\Commands.Sql\Common\  
High Risk BaseSqlVulnerabilityAssessmentAdapter.cs src\ResourceManager\Sql\Commands.Sql\VulnerabilityAssessment\Services\ ScanResultsContainerName is not being populated with a value
High Risk VulnerabilityAssessmentEndpointsCommunicator.cs src\ResourceManager\Sql\Commands.Sql\VulnerabilityAssessment\Services\ CreateBlobStorageContainer no longer creates a container
Resolved GetAzureAppServicePlan.cs src\ResourceManager\Websites\Commands.Websites\Cmdlets\AppServicePlans\  
Resolved NewAzureAppServicePlan.cs src\ResourceManager\Websites\Commands.Websites\Cmdlets\AppServicePlans\  
Resolved SetAzureAppServicePlan.cs src\ResourceManager\Websites\Commands.Websites\Cmdlets\AppServicePlans\  
Resolved GetAzureWebApp.cs src\ResourceManager\Websites\Commands.Websites\Cmdlets\WebApps\  
Resolved AppServicePlanBaseCmdlet.cs src\ResourceManager\Websites\Commands.Websites\Models.WebApp\  
Tagged CmdletHelpers.cs src\ResourceManager\Websites\Commands.Websites\Utilities\  
Low Risk WebsitesClientExtensions.cs src\ResourceManager\Websites\Commands.Websites\Utilities\ Completely re-implemented interface
Resolved ValidateServerFarmAttribute.cs src\ResourceManager\Websites\Commands.Websites\Validations\  
Resolved ExtensionMethods.cs src\ServiceManagement\Compute\Sync\Upload\ Copied all ServiceManagement Compute (required) files to ResourceManager Compute
Low Risk NetcoreExtension.cs src\StackAdmin\Compute\Commands.Compute\Extension\ Completely re-implemented interface
Tagged ApiVersionHelper.cs src\StackAdmin\Resources\Commands.ResourceManager\Cmdlets\Components\  
Low Risk CamelCasePropertyNamesWithOverridesContractResolver.cs src\StackAdmin\Resources\Commands.ResourceManager\Cmdlets\Json\  
High Risk ResourceClient.cs src\StackAdmin\Resources\Commands.Resources\Models.ResourceGroups\ GalleryTemplatesClient property removed
High Risk ResourcesBaseCmdlet.cs src\StackAdmin\Resources\Commands.Resources\Models.ResourceGroups\ GalleryTemplatesClient property removed
Low Risk ResourcesExtensions.cs src\StackAdmin\Resources\Commands.Resources\Models.ResourceGroups\ ToPSGalleryItem method was removed
Tagged CmdletOperationContext.cs src\Storage\Commands.Storage\Common\  
Low Risk StorageCloudCmdletBase.cs src\Storage\Commands.Storage\Common\ UserAgent not being updated in the request
Tagged BreakingChangeAnalyzer.cs tools\StaticAnalysis\BreakingChangeAnalyzer\  
Tagged BreakingChangeAttributesAnalyzer.cs tools\StaticAnalysis\BreakingChangeAttributesAnalyzer\  
Tagged CmdletBreakingChangeAttributeLoader.cs tools\StaticAnalysis\BreakingChangeAttributesAnalyzer\  
Tagged DependencyAnalyzer.cs tools\StaticAnalysis\DependencyAnalyzer\  
Tagged HelpAnalyzer.cs tools\StaticAnalysis\HelpAnalyzer\  
Tagged SignatureVerifier.cs tools\StaticAnalysis\SignatureVerifier\  
Tagged EnvironmentHelpers.cs tools\Tools.Common\Helpers\  
Tagged AssemblyLoader.cs tools\Tools.Common\Loaders\  
Tagged CmdletLoader.cs tools\Tools.Common\Loaders\  
Tagged AnalysisLogger.cs tools\Tools.Common\Loggers\  

Key

  • Tagged: The #if NETSTANDARD was simply tagged with either // TODO: Remove IfDef or // TODO: Remove IfDef code. These changes are unlikely to cause issues and/or won't require any special attention for migration.
  • Low Risk: There are differences between net452 and netstandard. These may need information added to the migration guide. They have minimal/low risk changes.
  • High Risk: There are differences between net452 and netstandard. These likely need information added to the migration guide. The changes may fundamentally alter how the files/cmdlets works.
  • Resolved: The #if NETSTANDARD was removed and not necessary.

Checklist

# Conflicts:
#	src/ResourceManager/Profile/Commands.Profile/Account/ConnectAzureRmAccount.cs
@maddieclayton
Copy link
Contributor

@MiYanni Please fix merge conflicts.

@@ -18,6 +18,7 @@ namespace Tools.Common.Helpers
{
public static class EnvironmentHelpers
{
// TODO: Remove IfDef code
Copy link
Member

Choose a reason for hiding this comment

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

What actually happens if we remove this code?

Copy link
Contributor Author

@MiYanni MiYanni Nov 13, 2018

Choose a reason for hiding this comment

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

This code is unused in Az as the way that modules are loaded has changed. AppDomains don't exist in NetStandard/Core.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think this is only relevant for the dependency analyzer below.

#if !NETSTANDARD
AppDomain.Unload(_appDomain);
#endif
issueLogger.Decorator.Remove("AssemblyFileName");
Copy link
Member

Choose a reason for hiding this comment

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

doesn't this change behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Az analysis does not use an AppDomain. AppDomains don't exist in NetStandard/Core.

public HelpAnalyzer()
{
Name = "Help Analyzer";
}
public AnalysisLogger Logger { get; set; }
public string Name { get; private set; }

// TODO: Remove IfDef code
Copy link
Member

Choose a reason for hiding this comment

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

same question - what happens when we remove the remote appdomain? Doesn't this impact assembly loading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Az analysis does not use an AppDomain. AppDomains don't exist in NetStandard/Core.

EnvironmentHelpers.CreateProxy<AssemblyLoader>(directoryPath, out _testDomain);

// TODO: Remove IfDef
#if NETSTANDARD
Copy link
Member

Choose a reason for hiding this comment

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

In this case, particularly, how is execution impacted by not using a remote appdomain? This funntionality isn't available in netcore, but I'm wondering how we can continue the same detection of conflicting assemblies if we don't have some capability to load two versions of the same assembly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cormacpayne Have any insight for this?


try
{
var assembly = Assembly.LoadFrom(assemblyPath);
foreach (var type in assembly.GetCmdletTypes())
{
var cmdlet = type.GetAttribute<CmdletAttribute>();
// TODO: Remove IfDef code
Copy link
Member

Choose a reason for hiding this comment

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

How do we get eauivalent functionality in netstandard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. This would be either @praries880 or @cormacpayne domain.

* Update cmdlet Test-AzureRmNetworkWatcherConnectivity, add validation on destination id, address and port.
* Minor changes for upcoming AzureRM to Az transition

## Version 6.10.0
Copy link
Member

Choose a reason for hiding this comment

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

??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is correct.

@@ -0,0 +1,257 @@
// ----------------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

this compute stuff looks like it doesn't belong here - please remove or make sur ethis is chedked in separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This allowed me to edit the changes for these files without affecting the ServiceManagement code, which shouldn't be modified. Make sense? This work needed to be done anyway, so it was much easier to do this now while I'm updating the rest of the files for Az.

@@ -0,0 +1,27 @@
// ----------------------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

let's split out the compute sync/vhdmanagement additions into a separate pr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is literally copy-paste files and changing them to be tagged for Az. Does it save us time or effort to split it into a new PR?

Copy link
Member

@markcowl markcowl Nov 19, 2018

Choose a reason for hiding this comment

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

So, if it isn't easier to make this part of deleting the servicemanagement and Net452 artifacts, this is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need these changes for this PR: #7913

# Conflicts:
#	src/ResourceManager/Automation/Commands.Automation/Common/RequestSettings.cs
#	src/ResourceManager/Compute/Commands.Compute/ChangeLog.md
#	src/ResourceManager/RecoveryServices/Commands.RecoveryServices/ChangeLog.md
#	src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Json/CamelCasePropertyNamesWithOverridesContractResolver.cs
#	src/ResourceManager/Resources/Commands.Resources/ChangeLog.md
#	src/ResourceManager/Sql/Commands.Sql/ChangeLog.md
#	src/ResourceManager/Sql/Commands.Sql/Common/AzureEndpointsCommunicator.cs
#	src/ResourceManager/Sql/Commands.Sql/VulnerabilityAssessment/Services/BaseSqlVulnerabilityAssessmentAdapter.cs
#	src/Storage/Commands.Storage/ChangeLog.md
…rshell into ifdef-tagging

# Conflicts:
#	src/ResourceManager/Compute/Commands.Compute/ChangeLog.md
#	src/ResourceManager/Network/Commands.Network/ChangeLog.md
#	src/ResourceManager/Resources/Commands.Resources/ChangeLog.md
#	src/ResourceManager/Sql/Commands.Sql/ChangeLog.md
#	src/ResourceManager/Sql/Commands.Sql/Common/AzureEndpointsCommunicator.cs
markcowl
markcowl previously approved these changes Nov 27, 2018
@markcowl markcowl removed their assignment Nov 27, 2018
@MiYanni MiYanni merged commit 3471c65 into Azure:preview Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants