Skip to content

Commit

Permalink
Merge pull request #346 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 5.0.0.0 of xSqlServer
  • Loading branch information
kwirkykat authored Jan 26, 2017
2 parents 39de900 + eaf23cb commit bf2bf09
Show file tree
Hide file tree
Showing 65 changed files with 12,927 additions and 6,245 deletions.
14 changes: 6 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
_Please provide the following information regarding your issue (place N/A if certain fields don't apply in your case:_

_Your feedback and support is greatly appreciated, thanks for contributing! If you like to contribute more please feel free to read the [contributing section](https://github.com/PowerShell/xSQLServer#contributing)._

Please prefix the issue title with the resource name, i.e. 'xSQLServerSetup: Short description of my issue'

Please provide the following information regarding your issue (place N/A if the fields that don't apply to your issue):

---- DELETE THIS LINE AND ABOVE ----

Expand All @@ -9,10 +14,3 @@ _Please provide the following information regarding your issue (place N/A if cer
**Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:**

**Version of the DSC module you're using, or 'dev' if you're using current dev branch:**

---- DELETE THIS LINE AND BELOW ----

_Your feedback and support is greatly appreciated._

_If you are able to resolve this issue or add new features, you may submit a Pull Request against this project._
_Please see the [Contribution Guideliness](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md) for information on how to contribute._
19 changes: 8 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
Thanks for submitting a Pull Request (PR) to this project.
This template will help you create your pull request (PR).
_Thanks for submitting a Pull Request (PR) to this project. Your contribution to this project is greatly appreciated!_

Please make sure you have read the [Contribution Guidelines](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md).
Please make sure you have read the [contributing section](https://github.com/PowerShell/xSQLServer#contributing)

To aid community reviewers in reviewing and merging your pull request (PR), please take the time to run through the below checklist
Please prefix the PR title with the resource name, i.e. 'xSQLServerSetup: My short description'
If this is a breaking change, then also prefix the PR title with 'BREAKING CHANGE:', i.e. 'BREAKING CHANGE: xSQLServerSetup: My short description'

Your contribution to this project is greatly appreciated!
To aid community reviewers in reviewing and merging your PR, please take the time to run through the below checklist.
Change to [x] for each task in the task list that applies to this PR.

---- DELETE THIS LINE AND ABOVE ----
---- DELETE THIS LINE AND EVERYTHING ABOVE ----

[Replace this with a description of your pull request]

This Pull Request (PR) fixes the following issues:
[Replace this with the list of issues. Use format: Fixes #123]
[Replace this with the list of issues or n/a. Use format: Fixes #123]

- [ ] Change details added to Unreleased section of CHANGELOG.md?
- [ ] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
- [ ] Examples appropriately updated?
- [ ] New/changed code adheres to [Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
- [ ] [Unit and (optional) Integration tests](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) created/updated where possible?

---- DELETE THIS LINE AND BELOW ----

Your contribution to this project is greatly appreciated.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DSCResource.Tests
DSCResource.Tests
.vs
.vscode
node_modules
10 changes: 10 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD029": {
"style": "ordered"
},
"MD034": false,
"MD024": false,
"MD013": false,
"no-hard-tabs": true
}
108 changes: 108 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,114 @@

## Unreleased

## 5.0.0.0

- Improvements how tests are initiated in AppVeyor
- Removed previous workaround (issue #201) from unit tests.
- Changes in appveyor.yml so that SQL modules are removed before common test is run.
- Now the deploy step are no longer failing when merging code into Dev. Neither is the deploy step failing if a contributor had AppVeyor connected to the fork of xSQLServer and pushing code to the fork.
- Changes to README.md
- Changed the contributing section to help new contributors.
- Added links for each resource so it is easier to navigate to the parameter list for each resource.
- Moved the list of resources in alphabetical order.
- Moved each resource parameter list into alphabetical order.
- Removed old text mentioning System Center.
- Now the correct product name is written in the installation section, and a typo was also fixed.
- Fixed a typo in the Requirements section.
- Added link to Examples folder in the Examples section.
- Change the layout of the README.md to closer match the one of PSDscResources
- Added more detailed text explaining what operating systemes WMF5.0 can be installed on.
- Verified all resource schema files with the README.md and fixed some errors (descriptions was not verified).
- Added security requirements section for resource xSQLServerEndpoint and xSQLAOGroupEnsure.
- Changes to xSQLServerSetup
- The resource no longer uses Win32_Product WMI class when evaluating if SQL Server Management Studio is installed. See article [kb974524](https://support.microsoft.com/en-us/kb/974524) for more information.
- Now it uses CIM cmdlets to get information from WMI classes.
- Resolved all of the PSScriptAnalyzer warnings that was triggered in the common tests.
- Improvement for service accounts to enable support for Managed Service Accounts as well as other nt authority accounts
- Changes to the helper function Copy-ItemWithRoboCopy
- Robocopy is now started using Start-Process and the error handling has been improved.
- Robocopy now removes files at the destination path if they no longer exists at the source.
- Robocopy copies using unbuffered I/O when available (recommended for large files).
- Added a more descriptive text for the parameter `SourceCredential` to further explain how the parameter work.
- BREAKING CHANGE: Removed parameter SourceFolder.
- BREAKING CHANGE: Removed default value "$PSScriptRoot\..\..\" from parameter SourcePath.
- Old code, that no longer filled any function, has been replaced.
- Function `ResolvePath` has been replaced with `[Environment]::ExpandEnvironmentVariables($SourcePath)` so that environment variables still can be used in Source Path.
- Function `NetUse` has been replaced with `New-SmbMapping` and `Remove-SmbMapping`.
- Renamed function `GetSQLVersion` to `Get-SqlMajorVersion`.
- BREAKING CHANGE: Renamed parameter PID to ProductKey to avoid collision with automatic variable $PID
- Changes to xSQLServerScript
- All credential parameters now also has the type [System.Management.Automation.Credential()] to better work with PowerShell 4.0.
- It is now possible to configure two instances on the same node, with the same script.
- Added to the description text for the parameter `Credential` describing how to authenticate using Windows Authentication.
- Added examples to show how to authenticate using either SQL or Windows authentication.
- A recent issue showed that there is a known problem running this resource using PowerShell 4.0. For more information, see [issue #273](https://github.com/PowerShell/xSQLServer/issues/273)
- Changes to xSQLServerFirewall
- BREAKING CHANGE: Removed parameter SourceFolder.
- BREAKING CHANGE: Removed default value "$PSScriptRoot\..\..\" from parameter SourcePath.
- Old code, that no longer filled any function, has been replaced.
- Function `ResolvePath` has been replaced with `[Environment]::ExpandEnvironmentVariables($SourcePath)` so that environment variables still can be used in Source Path.
- Adding new optional parameter SourceCredential that can be used to authenticate against SourcePath.
- Solved PSSA rules errors in the code.
- Get-TargetResource no longer return $true when no products was installed.
- Changes to the unit test for resource
- xSQLServerSetup
- Added test coverage for helper function Copy-ItemWithRoboCopy
- Changes to xSQLServerLogin
- Removed ShouldProcess statements
- Added the ability to enforce password policies on SQL logins
- Added common test (xSQLServerCommon.Tests) for xSQLServer module
- Now all markdown files will be style checked when tests are running in AppVeyor after sending in a pull request.
- Now all [Examples](/Examples/Resources) will be tested by compiling to a .mof file after sending in a pull request.
- Changes to xSQLServerDatabaseOwner
- The example 'SetDatabaseOwner' can now compile, it wrongly had a `DependsOn` in the example.
- Changes to SQLServerRole
- The examples 'AddServerRole' and 'RemoveServerRole' can now compile, it wrongly had a `DependsOn` in the example.
- Changes to CONTRIBUTING.md
- Added section 'Tests for examples files'
- Added section 'Tests for style check of Markdown files'
- Added section 'Documentation with Markdown'
- Added texts to section 'Tests'
- Changes to xSQLServerHelper
- added functions
- Get-SqlDatabaseRecoveryModel
- Set-SqlDatabaseRecoveryModel
- Examples
- xSQLServerDatabaseRecoveryModel
- 1-SetDatabaseRecoveryModel.ps1
- xSQLServerDatabasePermission
- 1-GrantDatabasePermissions.ps1
- 2-RevokeDatabasePermissions.ps1
- 3-DenyDatabasePermissions.ps1
- xSQLServerFirewall
- 1-CreateInboundFirewallRules
- 2-RemoveInboundFirewallRules
- Added tests for resources
- xSQLServerDatabaseRecoveryModel
- xSQLServerDatabasePermissions
- xSQLServerFirewall
- Changes to xSQLServerDatabaseRecoveryModel
- BREAKING CHANGE: Renamed xSQLDatabaseRecoveryModel to xSQLServerDatabaseRecoveryModel to align wíth naming convention.
- BREAKING CHANGE: The mandatory parameters now include SQLServer, and SQLInstanceName.
- Changes to xSQLServerDatabasePermission
- BREAKING CHANGE: Renamed xSQLServerDatabasePermissions to xSQLServerDatabasePermission to align wíth naming convention.
- BREAKING CHANGE: The mandatory parameters now include PermissionState, SQLServer, and SQLInstanceName.
- Added support for clustered installations to xSQLServerSetup
- Migrated relevant code from xSQLServerFailoverClusterSetup
- Removed Get-WmiObject usage
- Clustered storage mapping now supports asymmetric cluster storage
- Added support for multi-subnet clusters
- Added localized error messages for cluster object mapping
- Updated README.md to reflect new parameters
- Updated description for xSQLServerFailoverClusterSetup to indicate it is deprecated.
- xPDT helper module
- Function GetxPDTVariable was removed since it no longer was used by any resources.
- File xPDT.xml was removed since it was not used by any resources, and did not provide any value to the module.
- Changes xSQLServerHelper moduled
- Removed the globally defined `$VerbosePreference = 'Continue'` from xSQLServerHelper.
- Fixed a typo in a variable name in the function New-ListenerADObject.
- Now Restart-SqlService will correctly show the services it restarts. Also fixed PSSA warnings.

## 4.0.0.0

- Fixes in xSQLServerConfiguration
Expand Down
48 changes: 30 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,40 @@ one resource, then the functions can also be placed in the common [xSQLServerHel

### Tests

For a review of a Pull Request (PR) to start, all tests must pass without error. If you need help to figure why some test don't pass, just write a comment in the Pull Request (PR), or submit an issue, and somebody will come along and assist.

To run all tests manually run the following.

```powershell
Install-Module Pester
cd '<path to cloned repository>\Tests'
Invoke-Pester
```

#### Tests for style check of Markdown files

When sending in a Pull Request (PR) a style check will be performed on all Markdown files, and if the tests find any error the build will fail.
See the section [Documentation with Markdown](#documentation-with-markdown) how these errors kan be found before sending in the PR.

The Markdown tests can be run locally if the packet manager 'npm' is available. To have npm available you need to install [node.js](https://nodejs.org/en/download/).
If 'npm' is not available, a warning text will print and the rest of the tests will continue run.

#### Tests for examples files

When sending in a Pull Request (PR) all example files will be tested so they can be compiled to a .mof file. If the tests find any errors the build will fail.
Before the test runs in AppVeyor the module will be copied to the first path of `$env:PSModulePath`.
To run this test locally, make sure you have the xSQLServer module deployed to a path where it can be used. See `$env:PSModulePath` to view the existing paths.

#### Using SMO stub classes

There are [stub classes](https://github.com/PowerShell/xSQLServer/blob/dev/Tests/Unit/Stubs/SMO.cs) for the SMO classes which can be used and improved on when creating tests where SMO classes are used in the code being tested.

#### AppVeyor

AppVeyor is the platform where the tests is run when sending in a Pull Request (PR). Due to a change in the build worker that AppVeyor provides it has already have the SMO assemblies loaded, which make our stub SMO classes unable to be initiated.
To get around this we need to get a clean PowerShell environment to run our tests in. One way is to use `Start-Job`. So this change needs to be done to the unit test template before sending in a Pull Request (PR).
AppVeyor is the platform where the tests is run when sending in a Pull Request (PR). All tests are run on a clean AppVeyor build worker for each push to the Pull Request (PR).
The tests that are run on the build worker are common tests, unit tests and integration tests (with some limitations).

```powershell
#
AppVeyor build worker loads the SMO assembly which makes the SMO stub classes unable to be initiated.
Running the tests in a Start-Job script block give us a clean environment. This is a workaround.
#>
$testJob = Start-Job -ArgumentList $PSScriptRoot -ScriptBlock {
param
(
[System.String] $PSScriptRoot
)
# Unit test template goes here
}
$testJob | Receive-Job -Wait
```
### Documentation with Markdown

If using Visual Studio Code to edit Markdown files it can be a good idea to install the markdownlint extension. It will help to do style checking.
The file [.markdownlint.json](/.markdownlint.json) is prepared with a default set of rules which will automatically be used by the extension.

This file was deleted.

This file was deleted.

Loading

0 comments on commit bf2bf09

Please sign in to comment.