Skip to content

[WIP] Az.Ssh #2

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

Open
wants to merge 8 commits into
base: myTrack2
Choose a base branch
from
Open

[WIP] Az.Ssh #2

wants to merge 8 commits into from

Conversation

vthiebaut10
Copy link
Owner

Description

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from the scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT change version of module in pull request

Copy link

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

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

Some initial comments

//As Compute module must not reference to storage SDK, the types of parameters and return values of
//public APIs within this project should not expose any types defined in storage SDK.

public class ComputeClient

Choose a reason for hiding this comment

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

Usually, editors are set to convert tab characters into spaces. Not sure if that is true for Az cmdlets.

Suggested change
public class ComputeClient
public class ComputeClient

# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.7.2'

Choose a reason for hiding this comment

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

We normally target 4.6.1 for WindowsPowerShell 5.1 compatibility.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I will confirm with Azure PowerShell if that is the case for their modules as well. I set it to 4.7.2 because other Az PowerShell modules all do the same.


namespace Microsoft.Azure.PowerShell.Cmdlets.Ssh.Common
{
class SshResourceIdCompleterAttribute : ArgumentCompleterAttribute

Choose a reason for hiding this comment

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

In PowerShell code base, we are always explicit about type accessiblity.

Suggested change
class SshResourceIdCompleterAttribute : ArgumentCompleterAttribute
private class SshResourceIdCompleterAttribute : ArgumentCompleterAttribute

Copy link
Owner Author

Choose a reason for hiding this comment

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

When I do this change I get an error:
"Elements defined in a namespace cannot be explicitly declared as private, protected, protected internal, or private protected."

Choose a reason for hiding this comment

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

Sorry, I guess this would be internal. I assume it is not a type intended for public use?

DefaultParameterSetName = InteractiveParameterSet)]
[OutputType(typeof(bool))]
[Alias("Enter-AzArcServer")]
public class EnterAzVMCommand : SshBaseCmdlet

Choose a reason for hiding this comment

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

Suggested change
public class EnterAzVMCommand : SshBaseCmdlet
public sealed class EnterAzVMCommand : SshBaseCmdlet

[Cmdlet("Export",
ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SshConfig")]
[OutputType(typeof(PSSshConfigEntry))]
public class ExportAzSshConfig : SshBaseCmdlet

Choose a reason for hiding this comment

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

Suggested change
public class ExportAzSshConfig : SshBaseCmdlet
public sealed class ExportAzSshConfig : SshBaseCmdlet

@vthiebaut10 vthiebaut10 changed the title Az.Ssh [WIP] Az.Ssh Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants