Skip to content

Commit 86790b8

Browse files
authored
Merge pull request #22 from Azure/dev
Merge from Azure/azure-powershell/dev
2 parents f6f8587 + 38ab463 commit 86790b8

File tree

8,106 files changed

+3132075
-290549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,106 files changed

+3132075
-290549
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Cmdlet(s)
2+
3+
### PowerShell Version
4+
Instructions: to get PowerShell version, type `$PSVersionTable` and look for the value associated with `PSVersion`
5+
6+
### Module Version
7+
8+
### OS Version
9+
Instructions: to get OS version, type `$PSversionTable` and look for value associated with `BuildVersion`
10+
11+
### Description
12+
13+
### Debug Output
14+
Instructions: to get Debug Output, set `$DebugPreference="Continue"` and then execute the cmdlet or script causing the issue
15+
16+
### Script/Steps for Reproduction

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- DO NOT DELETE THIS TEMPLATE -->
2+
3+
## Description
4+
<!--
5+
Please add an informative description that covers the changes made by the pull request.
6+
7+
If applicable, reference the bug/issue that this pull request fixes here.
8+
-->
9+
10+
---
11+
12+
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices [here](https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx).
13+
14+
- [ ] **I have read the [contribution guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md).**
15+
- [ ] **If changes were made to any cmdlet, the XML help was regenerated using the [platyPSHelp module](https://github.com/Azure/azure-powershell/blob/dev/documentation/platyPSHelp-documentation.md).**
16+
- [ ] **If any large changes are made to a service, they are reflected in the respective [change log](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#updating-the-change-log).**
17+
18+
### [General Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#general-guidelines)
19+
- [ ] Title of the pull request is clear and informative.
20+
- [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/dev/documentation/cleaning-up-commits.md).
21+
- [ ] The pull request does not introduce [breaking changes](https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes.md) (unless a major version change occurs in the assembly and module).
22+
23+
### [Testing Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#testing-guidelines)
24+
- [ ] Pull request includes test coverage for the included changes.
25+
- [ ] PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.
26+
27+
### [Cmdlet Signature Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-signature-guidelines)
28+
- [ ] New cmdlets that make changes or have side effects should implement `ShouldProcess` and have `SupportShouldProcess=true` specified in the cmdlet attribute. You can find more information on `ShouldProcess` [here](https://gist.github.com/markcowl/338e16fe5c8bbf195aff9f8af0db585d#what-is-the-change).
29+
- [ ] Cmdlet specifies `OutputType` attribute if any output is produced - if the cmdlet produces no output, it should implement a `PassThrough` parameter.
30+
31+
### [Cmdlet Parameter Guidelines](https://github.com/Azure/azure-powershell/blob/dev/CONTRIBUTING.md#cmdlet-parameter-guidelines)
32+
- [ ] Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
33+
- [ ] Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
34+
- [ ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ Backup*/
181181
UpgradeLog*.XML
182182
UpgradeLog*.htm
183183

184+
# The Backup*/ rule will ignore the backup and restore cmdlets
185+
# for Azure web apps. Exclude that directory from being ignored here.
186+
!/src/ResourceManager/Websites/Commands.Websites/Cmdlets/BackupRestore
187+
184188
# SQL Server files
185189
*.mdf
186190
*.ldf
@@ -192,3 +196,8 @@ UpgradeLog*.htm
192196

193197
# Microsoft Fakes
194198
FakesAssemblies/
199+
200+
.vs/
201+
/tools/*.dll
202+
*.GhostDoc.xml
203+
pingme.txt

AzurePowershell.Test.targets

Lines changed: 247 additions & 86 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 180 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,182 @@
1-
# Contribute Code or Provide Feedback
1+
# Contribute Code or Provide Feedback for Azure PowerShell
22

3-
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
3+
This repository contains a set of PowerShell cmdlets for developers and administrators to develop, deploy, and manage Microsoft Azure applications.
44

5-
If you encounter any bugs with Microsoft Azure PowerShell please file an issue in the [Issues](https://github.com/WindowsAzure/azure-sdk-tools/issues) section of the project.
5+
## Basics
6+
7+
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
8+
9+
In the Azure Developer Experience, you are at Step 5:
10+
11+
[API Design Review](https://github.com/Azure/adx-documentation-pr#begin-api-design-review) -> [Engage with ADX team](https://github.com/Azure/adx-documentation-pr/blob/master/README.md#engage-with-adx-team) -> [Swagger specification](https://github.com/Azure/adx-documentation-pr#create-swagger-specification) -> [SDKs](https://github.com/Azure/adx-documentation-pr#sdks) -> _**[CLIs](https://github.com/Azure/adx-documentation-pr#clis)**_
12+
13+
## Table of Contents
14+
15+
[Before Starting](#before-starting)
16+
- [Onboarding](#onboarding)
17+
- [GitHub Basics](#github-basics)
18+
- [GitHub Workflow](#github-workflow)
19+
- [Forking the Azure/azure-powershell repository](#forking-the-azureazure-powershell-repository)
20+
- [Code of Conduct](#code-of-conduct)
21+
22+
[Filing Issues](#filing-issues)
23+
24+
[Making Changes](#making-changes)
25+
- [Pull Requests](#pull-requests)
26+
- [SDK for .NET](#sdk-for-net)
27+
- [Pull Request Guidelines](#pull-request-guidelines)
28+
- [Cleaning up commits](#cleaning-up-commits)
29+
- [Updating the change log](#updating-the-change-log)
30+
- [General guidelines](#general-guidelines)
31+
- [Testing guidelines](#testing-guidelines)
32+
- [Cmdlet signature guidelines](#cmdlet-signature-guidelines)
33+
- [Cmdlet parameter guidelines](#cmdlet-parameter-guidelines)
34+
- [Cmdlet pipeline guidelines](#cmdlet-pipeline-guidelines)
35+
36+
## Before Starting
37+
38+
### Onboarding
39+
40+
Make sure that your GitHub account is part of the Azure organization. [Use this page](http://aka.ms/azuregithub) to link your account.
41+
42+
Before cloning this repository, please make sure you have started in our [documentation repository](https://github.com/Azure/adx-documentation-pr) (you will only have access to that page if you are part of the Azure organization).
43+
44+
### GitHub Basics
45+
46+
#### GitHub Workflow
47+
48+
If you don't have experience with Git and GitHub, some of the terminology and process can be confusing. [Here is a guide to understanding the GitHub flow](https://guides.github.com/introduction/flow/) and [here is a guide to understanding the basic Git commands](https://services.github.com/kit/downloads/github-git-cheat-sheet.pdf).
49+
50+
#### Forking the Azure/azure-powershell repository
51+
52+
Unless you are working with multiple contributors on the same file, we ask that you fork the repository and submit your pull request from there. [Here is a guide to forks in GitHub](https://guides.github.com/activities/forking/).
53+
54+
### Code of Conduct
55+
56+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
57+
58+
## Filing Issues
59+
60+
You can find all of the issues that have been filed in the [Issues](https://github.com/Azure/azure-powershell/issues) section of the repository.
61+
62+
If you encounter any bugs with Microsoft Azure PowerShell, please file an issue [here](https://github.com/Azure/azure-powershell/issues/new) and make sure to fill out the provided template with the requested information.
63+
64+
To suggest a new feature or changes that could be made to Azure PowerShell, file an issue the same way you would for a bug, but remove the provided template and replace it with information about your suggestion.
65+
66+
You can find the code complete and release dates of the next three Azure PowerShell releases in the [Milestones](https://github.com/Azure/azure-powershell/milestones) section of the Issue page. Each milestone will display the issues that are being worked on for the corresponding release.
67+
68+
## Making Changes
69+
70+
### Pull Requests
71+
72+
You can find all of the pull requests that have been opened in the [Pull Request](https://github.com/Azure/azure-powershell/pulls) section of the repository.
73+
74+
To open your own pull request, click [here](https://github.com/Azure/azure-powershell/compare). When creating a pull request, keep the following in mind:
75+
- Make sure you are pointing to the fork and branch that your changes were made in
76+
- Choose the correct branch you want your pull request to be merged into
77+
- The **dev** branch is for active development; changes in this branch will be in the next Azure PowerShell release
78+
- The **master** branch contains a snapshot of the source code at the time of the last release
79+
- The **release-X.X.X** branch is for active development during a release
80+
- The pull request template that is provided **should be filled out**; this is not something that should just be deleted or ignored when the pull request is created
81+
- Deleting or ignoring this template will elongate the time it takes for your pull request to be reviewed
82+
- The SLA for reviewing pull requests is **two business days**
83+
84+
### SDK for .NET
85+
86+
Before making any changes to the Azure PowerShell repository, the corresponding NuGet packages must have been published from the [Azure SDK for .NET](https://github.com/Azure/azure-sdk-for-net) repository.
87+
88+
For more information on how to make changes to the SDK for .NET repository and publish the corresponding packages to NuGet, click [here](https://github.com/Azure/azure-sdk-for-net/blob/AutoRest/README.md).
89+
90+
### Pull Request Guidelines
91+
92+
A pull request template will automatically be included as a part of your PR. Please fill out the checklist as specified. Pull requests **will not be reviewed** unless they include a properly completed checklist.
93+
94+
The following is a list of guidelines that pull requests opened in the Azure PowerShell repository must adhere to. You can find a more complete discussion of PowerShell cmdlet best practices [here](https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx).
95+
96+
#### Cleaning up Commits
97+
98+
If you are thinking about making a large change to your Azure PowerShell cmdlets, **break up the change into small, logical, testable chunks, and organize your pull requests accordingly**.
99+
100+
Often when a pull request is created with a large number of files changed and/or a large number of lines of code added and/or removed, GitHub will have a difficult time opening up the changes on their site. This forces the Azure PowerShell team to uses separate software, such as CodeFlow or Beyond Compare, to do a code review on the pull request.
101+
102+
If you find yourself creating a pull request and are unable to see all the changes on GitHub, we recommend **splitting the pull request into multiple pull requests that are able to be reviewed on GitHub**.
103+
104+
If splitting up the pull request is not an option, we recommend **creating individual commits for different parts of the pull request, which can be reviewed individually on GitHub**.
105+
106+
For more information on cleaning up the commits in a pull request, such as how to rebase, squash, and cherry-pick, click [here](./documentation/cleaning-up-commits.md).
107+
108+
#### Updating the change log
109+
110+
Any public API changes that are made to a service must be reflected in the respecitve change log. This change log will allow customers to easily track what has been changed between releases of a service.
111+
112+
For ResourceManager services, the change log is located at `src\ResourceManager\SERVICE\ChangeLog.md`.
113+
114+
For ServiceManagement services, the change log is located at `src\ServiceManagement\Services\Commands.Utilities\ChangeLog.md`.
115+
116+
For Storage, this change log is located at `src\Storage\ChangeLog.md`.
117+
118+
#### Breaking Changes
119+
120+
Breaking changes should **not** be introduced into the repository without giving customers at least six months notice. For a description of breaking changes in Azure PowerShell, see [here](https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes.md).
121+
122+
Whenever a service team announces a breaking change, they must add it to the `upcoming-breaking-changes.md` file in their respective service folder. When the service team is ready to release the module with the breaking change, they must move the corresponding information from `upcoming-breaking-changes.md` into the `current-breaking-changes.md` file located in their service folder.
123+
124+
#### General guidelines
125+
126+
The following guidelines must be followed in **EVERY** pull request that is opened.
127+
128+
- Title of the pull request is clear and informative
129+
- There are a small number of commits that each have an informative message
130+
- A description of the changes the pull request makes is included, and a reference to the bug/issue the pull request fixes is included, if applicable
131+
- All files have the Microsoft copyright header
132+
- Cmdlets refer to the management libraries through NuGet references - no dlls are checked in
133+
- The pull request does not introduce [breaking changes](https://github.com/markcowl/azure-powershell/blob/doc1/documentation/changes.md#breaking-change-definition) (unless a major version change occurs in the assembly and module)
134+
135+
#### Testing guidelines
136+
137+
The following guidelines must be followed in **EVERY** pull request that is opened.
138+
139+
- Pull request includes test coverage for the included changes
140+
- Tests must use xunit, and should either use Moq to mock management client calls, or use the scenario test framework
141+
- Test code should not contain hard coded values for resource names, resource locations, subscriptions, tenants, or similar values. Test scripts, when run live, should be executable using any subscription and any location in Azure
142+
- PowerShell scripts used in tests must do any necessary setup as part of the test or suite setup, and should not use hard-coded values for existing resources
143+
- Test should not use App.config files for settings
144+
- Tests should use the built-in PowerShell functions for generating random names when unique names are necessary - this will store names in the test recording
145+
- Tests should use `Start-Sleep` to pause rather than `Thread.Sleep`
146+
147+
#### Cmdlet signature guidelines
148+
149+
The following guidelines must be followed in pull requests that add, edit, or remove a cmdlet.
150+
151+
- Cmdlet name uses an approved PowerShell verb - use enums for `VerbsCommon`, `VerbsCommunication`, `VerbLifecycle`, `VerbsOther` whenever possible
152+
- Cmdlet noun name uses the AzureRm prefix for management cmdlets, and the Azure prefix for data plane cmdlets
153+
- Cmdlet specifies the `OutputType` attribute if any output is produced; if the cmdlet produces no output, it should implement a `PassThrough` parameter
154+
- If the cmdlet makes changes or has side effects, it should implement `ShouldProcess` and have `SupportsShouldProcess = true` specified in the cmdlet attribute. See a discussion about correct `ShouldProcess` implementation [here](https://gist.github.com/markcowl/338e16fe5c8bbf195aff9f8af0db585d#what-is-the-change).
155+
- Cmdlets should derive from AzureRmCmdlet for management cmdlets, and AzureDataCmdlet for data cmdlets
156+
- If multiple parameter sets are implemented, the cmdlet should specify a `DefaultParameterSetName` in its cmdlet attribute
157+
158+
#### Cmdlet parameter guidelines
159+
160+
The following guidelines must be followed in pull requests that add, edit, or remove a parameter.
161+
162+
- Cmdlets should have no more than four positional parameters
163+
- Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets
164+
- Parameter types should not expose types from the management library - complex parameter types should be defined in the module
165+
- Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet
166+
- Parameters should be explicitly marked as `Mandatory` or not, and should contain a `HelpMessage`
167+
- No parameter is of type `object`
168+
- Management cmdlets should have the following parameters and aliases:
169+
- `ResourceGroupName` with (optional) alias to `ResourceGroupName` type `string` marked as `[ValueFromPipelineByPropertyName]`
170+
- `Name` with alias to `ResourceName` type `string` marked as `[ValueFromPipelineByPropertyName]`
171+
- `Location` (if appropriate) type `string`
172+
- `Tag` type `HashTable`
173+
174+
#### Cmdlet pipeline guidelines
175+
176+
The following guidelines must be followed in pull requests that make changes to pipeline parameters.
177+
178+
- Complex parameters should take values from the pipeline when possible, and certainly when they match the output type of another cmdlets
179+
- Only one parameter should use `ValueFromPipeline` per parameter set; parameters from different parameter sets may have this attribute, but should not be convertible
180+
- No parameter is of type `object`
181+
- Each management cmdlet should have a parameter set that takes `ResourceGroupName` and `Name` from the pipeline by property value
182+
- For a given resource type, it should be possible to pipe the output of `Get` and `New` cmdlets to the input of `Set`, `Update`, `Remove` and other action cmdlets for that resource

0 commit comments

Comments
 (0)