Skip to content

Commit 38598d0

Browse files
authored
Merge branch 'main' into SqlPermissionWithRole
2 parents 3d3bc96 + 603095d commit 38598d0

File tree

182 files changed

+3849
-2609
lines changed

Some content is hidden

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

182 files changed

+3849
-2609
lines changed

.github/copilot-instructions.md

Lines changed: 286 additions & 56 deletions
Large diffs are not rendered by default.

.github/workflows/code-analysis-built-module.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ jobs:
3434
run: |
3535
Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue'
3636
.\build.ps1 -ResolveDependency -Tasks 'noop'
37-
# This is a workaround for the issue: https://github.com/PoshCode/ModuleBuilder/pull/136
38-
- name: Patch ModuleBuilder
39-
shell: powershell
40-
run: |
41-
Write-Information -MessageData 'Patching ModuleBuilder v3.1.7.' -InformationAction 'Continue'
42-
.\build.ps1 -Tasks 'noop'
43-
Install-PSResource -Name 'Viscalyx.Common' -Repository 'PSGallery' -TrustRepository -Quiet -Confirm:$false
44-
Install-ModulePatch -Uri https://raw.githubusercontent.com/viscalyx/Viscalyx.Common/refs/heads/main/patches/ModuleBuilder_3.1.7_patch.json -Force
4537
- name: Build Module
4638
shell: powershell
4739
run: |

.github/workflows/code-analysis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ jobs:
3434
run: |
3535
Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue'
3636
.\build.ps1 -ResolveDependency -Tasks 'noop'
37-
# This is a workaround for the issue: https://github.com/PoshCode/ModuleBuilder/pull/136
38-
- name: Patch ModuleBuilder
39-
shell: powershell
40-
run: |
41-
Write-Information -MessageData 'Patching ModuleBuilder v3.1.7.' -InformationAction 'Continue'
42-
.\build.ps1 -Tasks 'noop'
43-
Install-PSResource -Name 'Viscalyx.Common' -Repository 'PSGallery' -TrustRepository -Quiet -Confirm:$false
44-
Install-ModulePatch -Uri https://raw.githubusercontent.com/viscalyx/Viscalyx.Common/refs/heads/main/patches/ModuleBuilder_3.1.7_patch.json -Force
4537
- name: Build Module
4638
shell: powershell
4739
run: |

.vscode/analyzersettings.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
<#
7575
The following types are not rules but parse errors reported by PSScriptAnalyzer
76-
so they cannot be ecluded. They need to be filtered out from the result of
76+
so they cannot be excluded. They need to be filtered out from the result of
7777
Invoke-ScriptAnalyzer.
7878
7979
TypeNotFound - Because classes in the project cannot be found unless built.

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
"fastbuild",
7676
"CODEOWNERS",
7777
"analyzersettings",
78-
"sqlcmd"
78+
"sqlcmd",
79+
"PBIRS",
80+
"SSRS"
7981
],
8082
"cSpell.ignorePaths": [
8183
".git"

CHANGELOG.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,67 @@ The format is based on and uses the types of changes according to [Keep a Change
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

66
## [Unreleased]
7+
78
### Removed
89

10+
- SqlServerDsc
11+
- Revert workaround in GitHub Actions workflows as new version of ModuleBuilder
12+
was released.
913
- SqlServerDsc.Common
10-
- Removed the function `Get-RegistryPropertyValue` and `Format-Path` in
11-
favor of the commands with the same names in the module _DscResource.Common_.
14+
- Removed the function `Get-RegistryPropertyValue`, `Format-Path` and
15+
`Test-PendingRestart` in favor of the commands with the same names in
16+
the module _DscResource.Common_.
17+
- SqlRSSetup
18+
- The DSC resource has been refactored into a class-based resource.
19+
- The parameter `SourcePath` was replaced with `MediaPath`.
20+
- The parameter `IAcceptLicensTerms` was replaced with a boolean parameter
21+
`AcceptLicensingTerms`.
22+
- The parameter `SourceCredential` was removed. Because of this, the
23+
functionality that allowed copying the media from a UNC path using
24+
those credentials was also removed. If this was something you used,
25+
please open an issue.
26+
- The version validation no longer gets the current version from the
27+
installed package (using `Get-Package`), but instead from the registry.
28+
- Prior when install was successful, the resource checked whether there
29+
were any pending rename operations. Since the install returns 3010
30+
if a restart is needed it is now assumed that the setup process takes
31+
care of this. If that is not the case, and this check is needed, then
32+
open an issue to discuss in what cases this is needed.
33+
- The `Edition` option 'Development` was replaced by the value
34+
`Developer`.
35+
- The read-only properties `CurrentVersion`, `ServiceName` and `ErrorDumpDirectory`
36+
were removed.
1237

1338
### Added
1439

1540
- Public commands:
1641
- `Get-SqlDscInstalledInstance` to retrieve installed SQL instances.
1742
- `Get-SqlDscRSSetupConfiguration` to retrieve the setup configuration of
1843
SQL Server Reporting Services or Power BI Report Server ([issue #2072](https://github.com/dsccommunity/SqlServerDsc/issues/2072)).
44+
- Add additional properties to `Get-SqlDscRSSetupConfiguration` output.
1945
- `Install-SqlDscReportingService` to install SQL Server Reporting Services
2046
([issue #2010](https://github.com/dsccommunity/SqlServerDsc/issues/2010)).
47+
- Add `PassThru` parameter to return exit code.
2148
- `Install-SqlDscBIReportServer` to install SQL Server BI Report Server.
2249
([issue #2010](https://github.com/dsccommunity/SqlServerDsc/issues/2010)).
50+
- Add `PassThru` parameter to return exit code.
2351
- `Repair-SqlDscReportingService` to repair an already installed SQL Server
2452
Reporting Services ([issue #2064](https://github.com/dsccommunity/SqlServerDsc/issues/2064)).
53+
- Add `PassThru` parameter to return exit code.
2554
- `Repair-SqlDscBIReportServer` to repair an already installed SQL Server
2655
BI Report Server ([issue #2064](https://github.com/dsccommunity/SqlServerDsc/issues/2064)).
56+
- Add `PassThru` parameter to return exit code.
2757
- `Test-SqlDscRSInstalled` to test whether an instance is installed or not
2858
([issue #2078](https://github.com/dsccommunity/SqlServerDsc/issues/2078)).
2959
- `Uninstall-SqlDscReportingService` to uninstall SQL Server Reporting
3060
Services ([issue #2065](https://github.com/dsccommunity/SqlServerDsc/issues/2065)).
61+
- Add `PassThru` parameter to return exit code.
3162
- `Uninstall-SqlDscBIReportServer` to uninstall SQL Server BI Report Server
3263
([issue #2065](https://github.com/dsccommunity/SqlServerDsc/issues/2065)).
33-
- `Test-SqlDscIsRole` to be used like `Test-SqlDscIsLogin` but tests for a
64+
- Add `PassThru` parameter to return exit code.
65+
- `ConvertTo-SqlDscEditionName` to return the edition name of the specified
66+
edition ID.
67+
- `Test-SqlDscIsRole` to be used like `Test-SqlDscIsLogin` but tests for a
3468
server role as principal.
3569
- Private function:
3670
- `Invoke-ReportServerSetupAction` to run setup actions for Reporting
@@ -60,18 +94,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6094
- Fix style formatting in all PowerShell script files.
6195
- Update module description on GitHub, in the conceptual help, and in
6296
the module manifest.
63-
- `Set-SqlDscServerPermission`
64-
- Added support for assigning permissions to a server role.
97+
- Now integration tests will fail on an exception when the command `Test-DscConfiguration`
98+
is run.
99+
- Added Test-SqlDscIsRole to be used like Test-SqlDscIsLogin but tests
100+
for a server role as principal.
101+
- Refine and enhance clarity in Copilot instructions.
65102
- SqlSetup
66103
- Fixed issue with AddNode where cluster IP information was not being passed to
67104
setup.exe ([issue #1171](https://github.com/dsccommunity/SqlServerDsc/issues/1171)).
105+
- SqlRSSetup
106+
- The DSC resource has been refactored into a class-based resource.
107+
- `Set-SqlDscServerPermission`
108+
- Added support for assigning permissions to a server role.
68109

69110
### Fixed
70111

71112
- Fixed workaround for the GitHub Actions to support building module in Windows
72113
PowerShell.
114+
- Fix tests to redirect output streams correctly.
73115
- SqlServerDsc
74116
- Fix localization tests.
117+
- Cleanup in unit tests for classes.
118+
- Cleanup in localization string files.
75119
- `SqlAudit`
76120
- Fix localization strings in `Assert` method.
77121
- `Save-SqlDscSqlServerMediaFile`
@@ -95,6 +139,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
95139
- Change the alias command to real command name, to pass HQRM tests.
96140
- `SqlServiceAccount`
97141
- Change the alias command to real command name, to pass HQRM tests.
142+
- `Get-SqlDscRSSetupConfiguration`
143+
- The integration test was updated to verify so that the `CurrentVersion`
144+
and `ProductVersion` strings can be converted to valid versions and
145+
that they always are higher than what we expect.
146+
- `SqlRS`
147+
- Re-enable integration tests.
148+
- `SqlAG`
149+
- Fix SeedingMode existence condition.
150+
- `SqlAGReplica`
151+
- Fix SeedingMode existence condition.
98152

99153
## [17.0.0] - 2024-09-30
100154

azure-pipelines.yml

Lines changed: 99 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ stages:
123123
- job: Test_Unit
124124
displayName: 'Unit'
125125
pool:
126-
vmImage: 'windows-2019'
126+
vmImage: 'windows-2022'
127127
timeoutInMinutes: 0
128128
variables:
129129
# This sets environment variable $env:SqlServerDscCI.
@@ -204,9 +204,6 @@ stages:
204204
SQL2016_WIN2019:
205205
JOB_VMIMAGE: 'windows-2019'
206206
TEST_CONFIGURATION: 'Integration_SQL2016'
207-
SQL2016_WIN2022:
208-
JOB_VMIMAGE: 'windows-2022'
209-
TEST_CONFIGURATION: 'Integration_SQL2016'
210207
SQL2017_WIN2019:
211208
JOB_VMIMAGE: 'windows-2019'
212209
TEST_CONFIGURATION: 'Integration_SQL2017'
@@ -219,12 +216,18 @@ stages:
219216
SQL2019_WIN2022:
220217
JOB_VMIMAGE: 'windows-2022'
221218
TEST_CONFIGURATION: 'Integration_SQL2019'
219+
SQL2019_WIN2025:
220+
JOB_VMIMAGE: 'windows-2025'
221+
TEST_CONFIGURATION: 'Integration_SQL2019'
222222
SQL2022_WIN2019:
223223
JOB_VMIMAGE: 'windows-2019'
224224
TEST_CONFIGURATION: 'Integration_SQL2022'
225225
SQL2022_WIN2022:
226226
JOB_VMIMAGE: 'windows-2022'
227227
TEST_CONFIGURATION: 'Integration_SQL2022'
228+
SQL2022_WIN2025:
229+
JOB_VMIMAGE: 'windows-2025'
230+
TEST_CONFIGURATION: 'Integration_SQL2022'
228231
pool:
229232
vmImage: $(JOB_VMIMAGE)
230233
timeoutInMinutes: 0
@@ -289,12 +292,18 @@ stages:
289292
SQL2019_WIN2022:
290293
JOB_VMIMAGE: 'windows-2022'
291294
TEST_CONFIGURATION: 'Integration_SQL2019_RS'
295+
SQL2019_WIN2025:
296+
JOB_VMIMAGE: 'windows-2025'
297+
TEST_CONFIGURATION: 'Integration_SQL2019_RS'
292298
SQL2022_WIN2019:
293299
JOB_VMIMAGE: 'windows-2019'
294300
TEST_CONFIGURATION: 'Integration_SQL2022_RS'
295301
SQL2022_WIN2022:
296302
JOB_VMIMAGE: 'windows-2022'
297303
TEST_CONFIGURATION: 'Integration_SQL2022_RS'
304+
SQL2022_WIN2025:
305+
JOB_VMIMAGE: 'windows-2025'
306+
TEST_CONFIGURATION: 'Integration_SQL2022_RS'
298307
pool:
299308
vmImage: $(JOB_VMIMAGE)
300309
timeoutInMinutes: 0
@@ -352,12 +361,15 @@ stages:
352361
displayName: 'Commands'
353362
strategy:
354363
matrix:
355-
SQL2022_WIN2019:
364+
PowerBI_WIN2019:
356365
JOB_VMIMAGE: 'windows-2019'
357366
TEST_CONFIGURATION: 'Integration_PowerBI'
358-
SQL2022_WIN2022:
367+
PowerBI_WIN2022:
359368
JOB_VMIMAGE: 'windows-2022'
360369
TEST_CONFIGURATION: 'Integration_PowerBI'
370+
PowerBI_WIN2025:
371+
JOB_VMIMAGE: 'windows-2025'
372+
TEST_CONFIGURATION: 'Integration_PowerBI'
361373
pool:
362374
vmImage: $(JOB_VMIMAGE)
363375
timeoutInMinutes: 0
@@ -418,9 +430,6 @@ stages:
418430
SQL2016_WIN2019:
419431
JOB_VMIMAGE: 'windows-2019'
420432
TEST_CONFIGURATION: 'Integration_SQL2016'
421-
SQL2016_WIN2022:
422-
JOB_VMIMAGE: 'windows-2022'
423-
TEST_CONFIGURATION: 'Integration_SQL2016'
424433
SQL2017_WIN2019:
425434
JOB_VMIMAGE: 'windows-2019'
426435
TEST_CONFIGURATION: 'Integration_SQL2017'
@@ -433,12 +442,18 @@ stages:
433442
SQL2019_WIN2022:
434443
JOB_VMIMAGE: 'windows-2022'
435444
TEST_CONFIGURATION: 'Integration_SQL2019'
445+
SQL2019_WIN2025:
446+
JOB_VMIMAGE: 'windows-2025'
447+
TEST_CONFIGURATION: 'Integration_SQL2019'
436448
SQL2022_WIN2019:
437449
JOB_VMIMAGE: 'windows-2019'
438450
TEST_CONFIGURATION: 'Integration_SQL2022'
439451
SQL2022_WIN2022:
440452
JOB_VMIMAGE: 'windows-2022'
441453
TEST_CONFIGURATION: 'Integration_SQL2022'
454+
SQL2022_WIN2025:
455+
JOB_VMIMAGE: 'windows-2025'
456+
TEST_CONFIGURATION: 'Integration_SQL2022'
442457
pool:
443458
vmImage: $(JOB_VMIMAGE)
444459
timeoutInMinutes: 0
@@ -517,8 +532,8 @@ stages:
517532
displayName: 'Integration'
518533
strategy:
519534
matrix:
520-
SQL2016_WIN2022:
521-
JOB_VMIMAGE: 'windows-2022'
535+
SQL2016_WIN2019:
536+
JOB_VMIMAGE: 'windows-2019'
522537
TEST_CONFIGURATION: 'Integration_SQL2016'
523538
SQL2017_WIN2022:
524539
JOB_VMIMAGE: 'windows-2022'
@@ -613,9 +628,6 @@ stages:
613628
SQL2016_WIN2019:
614629
JOB_VMIMAGE: 'windows-2019'
615630
TEST_CONFIGURATION: 'Integration_SQL2016'
616-
SQL2016_WIN2022:
617-
JOB_VMIMAGE: 'windows-2022'
618-
TEST_CONFIGURATION: 'Integration_SQL2016'
619631
SQL2017_WIN2019:
620632
JOB_VMIMAGE: 'windows-2019'
621633
TEST_CONFIGURATION: 'Integration_SQL2017'
@@ -628,12 +640,83 @@ stages:
628640
SQL2019_WIN2022:
629641
JOB_VMIMAGE: 'windows-2022'
630642
TEST_CONFIGURATION: 'Integration_SQL2019'
643+
SQL2019_WIN2025:
644+
JOB_VMIMAGE: 'windows-2025'
645+
TEST_CONFIGURATION: 'Integration_SQL2019'
631646
SQL2022_WIN2019:
632647
JOB_VMIMAGE: 'windows-2019'
633648
TEST_CONFIGURATION: 'Integration_SQL2022'
634649
SQL2022_WIN2022:
635650
JOB_VMIMAGE: 'windows-2022'
636651
TEST_CONFIGURATION: 'Integration_SQL2022'
652+
SQL2022_WIN2025:
653+
JOB_VMIMAGE: 'windows-2025'
654+
TEST_CONFIGURATION: 'Integration_SQL2022'
655+
variables:
656+
SKIP_DATABASE_ENGINE_DEFAULT_INSTANCE: true
657+
SKIP_ANALYSIS_MULTI_INSTANCE: true
658+
SKIP_ANALYSIS_TABULAR_INSTANCE: true
659+
SMODefaultModuleName: 'SqlServer'
660+
pool:
661+
vmImage: $(JOB_VMIMAGE)
662+
timeoutInMinutes: 0
663+
steps:
664+
- task: DownloadPipelineArtifact@2
665+
displayName: 'Download Build Artifact'
666+
inputs:
667+
buildType: 'current'
668+
artifactName: $(buildArtifactName)
669+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
670+
- task: PowerShell@2
671+
name: configureWinRM
672+
displayName: 'Configure WinRM'
673+
inputs:
674+
targetType: 'inline'
675+
script: 'winrm quickconfig -quiet'
676+
pwsh: false
677+
- powershell: |
678+
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
679+
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
680+
Remove-Module -Name CommonTestHelper
681+
name: cleanCIWorker
682+
displayName: 'Clean CI worker'
683+
- powershell: |
684+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
685+
# Run the integration tests in a specific group order.
686+
# Group 1
687+
'tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1'
688+
# Group 2
689+
'tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1'
690+
# Group 3
691+
'tests/Integration/Resources/DSC_SqlRS.Integration.Tests.ps1'
692+
)
693+
name: test
694+
displayName: 'Run Reporting Services Integration Test'
695+
- task: PublishTestResults@2
696+
displayName: 'Publish Test Results'
697+
condition: succeededOrFailed()
698+
inputs:
699+
testResultsFormat: 'NUnit'
700+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
701+
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
702+
703+
- stage: Integration_Test_Resources_PowerBIReportServer
704+
displayName: 'Integration Test Resources - Power BI Report Server'
705+
dependsOn: Quality_Test_and_Unit_Test
706+
jobs:
707+
- job: Test_Integration
708+
displayName: 'Integration'
709+
strategy:
710+
matrix:
711+
PowerBI_WIN2019:
712+
JOB_VMIMAGE: 'windows-2019'
713+
TEST_CONFIGURATION: 'Integration_PowerBI'
714+
PowerBI_WIN2022:
715+
JOB_VMIMAGE: 'windows-2022'
716+
TEST_CONFIGURATION: 'Integration_PowerBI'
717+
PowerBI_WIN2025:
718+
JOB_VMIMAGE: 'windows-2025'
719+
TEST_CONFIGURATION: 'Integration_PowerBI'
637720
variables:
638721
SKIP_DATABASE_ENGINE_DEFAULT_INSTANCE: true
639722
SKIP_ANALYSIS_MULTI_INSTANCE: true
@@ -690,8 +773,8 @@ stages:
690773
displayName: 'Integration'
691774
strategy:
692775
matrix:
693-
SQL2016_WIN2022:
694-
JOB_VMIMAGE: 'windows-2022'
776+
SQL2016_WIN2019:
777+
JOB_VMIMAGE: 'windows-2019'
695778
TEST_CONFIGURATION: 'Integration_SQL2016'
696779
SQL2017_WIN2022:
697780
JOB_VMIMAGE: 'windows-2022'

0 commit comments

Comments
 (0)