Skip to content

Commit

Permalink
Merge pull request #951 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 10.0.0.0 of SqlServerDsc
  • Loading branch information
kwirkykat authored Dec 14, 2017
2 parents 9a9e24d + cee9053 commit ef62dfa
Show file tree
Hide file tree
Showing 205 changed files with 6,825 additions and 6,435 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!--
Your feedback and support is greatly appreciated, thanks for contributing!
Please prefix the issue title with the resource name, i.e. 'xSQLServerSetup: Short description of my issue'
Please prefix the issue title with the resource name, i.e. 'SqlSetup: 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):
If you like to contribute more please feel free to read the contributing section at https://github.com/PowerShell/xSQLServer#contributing.
If you like to contribute more please feel free to read the contributing section at https://github.com/PowerShell/SQLServerDsc#contributing.
-->
**Details of the scenario you tried and the problem that is occurring:**

Expand Down
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ 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 contributing section
at https://github.com/PowerShell/xSQLServer#contributing.
at https://github.com/PowerShell/SqlServerDsc#contributing.
Please prefix the PR title with the resource name,
i.e. 'xSQLServerSetup: My short description'
i.e. 'SqlSetup: 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'
i.e. 'BREAKING CHANGE: SqlSetup: My short description'
-->
**Pull Request (PR) description**
<!-- Replace this with a description of your pull request -->
Expand Down
123 changes: 122 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,128 @@
# Change log for xSQLServer
# Change log for SqlServerDsc

## Unreleased

## 10.0.0.0

- BREAKING CHANGE: Resource module has been renamed to SqlServerDsc
([issue #916](https://github.com/PowerShell/SqlServerDsc/issues/916)).
- BREAKING CHANGE: Significant rename to reduce length of resource names
- See [issue #851](https://github.com/PowerShell/SqlServerDsc/issues/851) for a
complete table mapping rename changes.
- Impact to all resources.
- Changes to CONTRIBUTING.md
- Added details to the naming convention used in SqlServerDsc.
- Changes to SqlServerDsc
- The examples in the root of the Examples folder are obsolete. A note was
added to the comment-based help in each example stating it is obsolete.
This is a temporary measure until they are replaced
([issue #904](https://github.com/PowerShell/SqlServerDsc/issues/904)).
- Added new common test (regression test) for validating the long path
issue for compiling resources in Azure Automation.
- Fix resources in alphabetical order in README.md ([issue #908](https://github.com/PowerShell/SqlServerDsc/issues/908)).
- Changes to SqlAG
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- BREAKING CHANGE: The read-only property SQLServerNetName was removed in favor
of EndpointHostName ([issue #924](https://github.com/PowerShell/SqlServerDsc/issues/924)).
Get-TargetResource will now return the value of property [NetName](https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.netname(v=sql.105).aspx)
for the property EndpointHostName.
- Changes to SqlAGDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changed the Get-MatchingDatabaseNames function to be case insensitive when
matching database names ([issue #912](https://github.com/PowerShell/SqlServerDsc/issues/912)).
- Changes to SqlAGListener
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlAGReplica
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- BREAKING CHANGE: Parameters PrimaryReplicaSQLServer and PrimaryReplicaSQLInstanceName
has been renamed to PrimaryReplicaServerName and PrimaryReplicaInstanceName
respectively ([issue #922](https://github.com/PowerShell/SqlServerDsc/issues/922)).
- BREAKING CHANGE: The read-only property SQLServerNetName was removed in favor
of EndpointHostName ([issue #924](https://github.com/PowerShell/SqlServerDsc/issues/924)).
Get-TargetResource will now return the value of property [NetName](https://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.netname(v=sql.105).aspx)
for the property EndpointHostName.
- Changes to SqlAlwaysOnService
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlDatabase
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes SqlDatabaseDefaultLocation
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlDatabaseOwner
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlDatabasePermission
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlDatabaseRecoveryModel
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlDatabaseRole
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlRS
- BREAKING CHANGE: Parameters RSSQLServer and RSSQLInstanceName has been renamed
to DatabaseServerName and DatabaseInstanceName respectively
([issue #923](https://github.com/PowerShell/SqlServerDsc/issues/923)).
- Changes to SqlServerConfiguration
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerEndpoint
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerEndpointPermission
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Now the examples files have a shorter name so that resources will not fail
to compile in Azure Automation ([issue #934](https://github.com/PowerShell/SqlServerDsc/issues/934)).
- Changes to SqlServerEndpointState
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerLogin
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerMaxDop
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerMemory
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerNetwork
- BREAKING CHANGE: Parameters SQLServer has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerPermission
- BREAKING CHANGE: Parameter NodeName has been renamed to ServerName
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerRole
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).
- Changes to SqlServerServiceAccount
- BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed
to ServerName and InstanceName respectively
([issue #308](https://github.com/PowerShell/SqlServerDsc/issues/308)).

## 9.0.0.0

- Changes to xSQLServer
Expand Down
109 changes: 87 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to xSQLServer
# Contributing to SqlServerDsc

If you are keen to make xSQLServer better, why not consider contributing your work
If you are keen to make SqlServerDsc better, why not consider contributing your work
to the project? Every little change helps us make a better resource for everyone
to use, and we would love to have contributions from the community.

Expand All @@ -10,7 +10,7 @@ We follow all of the standard contribution guidelines for DSC resources
[outlined in DscResources repository](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md),
so please review these as a baseline for contributing.

## xSQLServer specific guidelines
## SqlServerDsc specific guidelines

### Automatic formatting with VS Code

Expand All @@ -34,10 +34,74 @@ Those SQL Server products that are still supported can be listed at the

### Naming convention

The DSC resources contained in SqlServerDsc use the following naming convention:

```naming
<Module Identifier>[<Component>][<Action>]<Scope>{<Feature>|<Property>}
```

The following list describes the components that make up a resource name and
lists possible names used for each of the components. The component names are
not limited to the names in this list.

- **Module Identifier**
- **Sql**
- **Component**
- **\<none\>** - Database Engine _(No component abbreviation)_
- **AS** - Analysis Services
- **IS** - Integration Services
- **RS** - Reporting Services
- **Action** _(not required)_
- **Setup**
- **WaitFor**
- **Scope** - Where the action, feature, or property is being applied.
- **AG** (AvailabilityGroup)
- **Database**
- **Server**
- **ServiceAccount**
- **Windows**
- **Feature**
- **AlwaysOn** - This is for the overall AlwaysOn feature
- **Endpoint**
- **Firewall**
- **Network**
- **Script**
- **Property** _(not required)_
- **Alias**
- **Configuration**
- **Database**
- **DatabaseMembership**
- **DefaultLocation**
- **Listener**
- **Login**
- **MaxDop**
- **Memory**
- **Owner**
- **Permission**
- **RecoveryModel**
- **Replica**
- **Replication**
- **Role**
- **SecureConnectionLevel**
- **Service**
- **State**

#### Example of Resource Naming

The `SqlServerEndpointPermission` resource name is built using the defined
naming structure using the following components.

- **Module Identifier**: Sql
- **Component**: \<blank\>
- **Action**: \<none\>
- **Scope**: Server
- **Feature**: Endpoint
- **Property**: Permission

#### mof-based resource

All mof-based resource (with Get/Set/Test-TargetResource) should be prefixed with
'MSFT\_xSQLServer'. I.e. MSFT\_xSQLServerConfiguration
'MSFT\_Sql'. I.e. MSFT\_SqlDatabase

Please note that not all places should contain the prefix 'MSFT\_'.

Expand All @@ -49,14 +113,14 @@ This is to make those folders more user friendly, to resemble the name the user
would use in the configuration file.

```Text
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.schema.mof
DSCResources/MSFT_xSQLServerConfiguration/en-US/MSFT_xSQLServerConfiguration.strings.psd1
DSCResources/MSFT_SqlServerConfiguration/MSFT_SqlServerConfiguration.psm1
DSCResources/MSFT_SqlServerConfiguration/MSFT_SqlServerConfiguration.schema.mof
DSCResources/MSFT_SqlServerConfiguration/en-US/MSFT_SqlServerConfiguration.strings.psd1
Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1
Tests/Unit/MSFT_SqlServerConfiguration.Tests.ps1
Examples/Resources/xSQLServerConfiguration/1-AddConfigurationOption.ps1
Examples/Resources/xSQLServerConfiguration/2-RemoveConfigurationOption.ps1
Examples/Resources/SqlServerConfiguration/1-AddConfigurationOption.ps1
Examples/Resources/SqlServerConfiguration/2-RemoveConfigurationOption.ps1
```

##### Schema mof file
Expand All @@ -65,8 +129,8 @@ Please note that the `FriendlyName` in the schema mof file should not contain th
prefix `MSFT\_`.

```powershell
[ClassVersion("1.0.0.0"), FriendlyName("xSQLServerConfiguration")]
class MSFT_xSQLServerConfiguration : OMI_BaseResource
[ClassVersion("1.0.0.0"), FriendlyName("SqlServerConfiguration")]
class MSFT_SqlServerConfiguration : OMI_BaseResource
{
# Properties removed for readability.
};
Expand All @@ -75,7 +139,7 @@ class MSFT_xSQLServerConfiguration : OMI_BaseResource
#### Composite or class-based resource

Any composite (with a Configuration) or class-based resources should be prefixed
with just 'xSQLServer'
with just 'Sql'

### Localization

Expand All @@ -87,15 +151,15 @@ In each resource folder there should be, at least, a localization folder for
english language 'en-US'.
In the 'en-US' (and any other language folder) there should be a file named
'MSFT_ResourceName.strings.psd1', i.e.
'MSFT_xSQLServerSetup.strings.psd1'.
'MSFT_SqlSetup.strings.psd1'.
At the top of each resource the localized strings should be loaded, see the helper
function `Get-LocalizedData` for more information on how this is done.

The localized string file should contain the following (beside the localization
strings)

```powershell
# Localized resources for xSQLServerSetup
# Localized resources for SqlSetup
ConvertFrom-StringData @'
InstallingUsingPathMessage = Installing using path '{0}'.
Expand Down Expand Up @@ -272,17 +336,17 @@ This should be used at the top of each resource like this.
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) `
-ChildPath 'CommonResourceHelper.psm1')
$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xSQLServerSetup'
$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_SqlSetup'
```

#### Old localization helper function

To be able to support localization we have added wrappers for the cmdlets
`Write-Verbose` and `Write-Warning`, and also for creating a terminating error
message.
The localized strings are placed in a file named 'xSQLServerHelper.strings.psd1'
The localized strings are placed in a file named 'SqlServerDscHelper.strings.psd1'
which are located in each language folder in the root of the module. For English
language strings the folder is ['en-US'](https://github.com/PowerShell/xSQLServer/blob/dev/en-US).
language strings the folder is ['en-US'](https://github.com/PowerShell/SqlServerDsc/blob/dev/en-US).

##### New-TerminatingError

Expand All @@ -305,7 +369,7 @@ Helper functions or wrapper functions that are used by the resource can preferab
be placed in the resource module file. If the functions are of a type that could
be used by more than
one resource, then the functions can also be placed in the common
[xSQLServerHelper.psm1](https://github.com/PowerShell/xSQLServer/blob/dev/xSQLServerHelper.psm1)
[SqlServerDscHelper.psm1](https://github.com/PowerShell/SqlServerDsc/blob/dev/SqlServerDscHelper.psm1)
module file.

### Tests
Expand Down Expand Up @@ -340,12 +404,13 @@ 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.
To run this test locally, make sure you have the SqlServerDsc 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)
There are [stub classes](https://github.com/PowerShell/SqlServerDsc/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.

Expand Down
2 changes: 1 addition & 1 deletion DSCResources/CommonResourceHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function New-InvalidResultException
For WindowsOptionalFeature: MSFT_WindowsOptionalFeature
For Service: MSFT_ServiceResource
For Registry: MSFT_RegistryResource
For Helper: xSQLServerHelper
For Helper: SqlServerDscHelper
.PARAMETER ScriptRoot
Optional. The root path where to expect to find the culture folder. This is only needed
Expand Down
Loading

0 comments on commit ef62dfa

Please sign in to comment.