Skip to content

Commit 246e281

Browse files
authored
Merge pull request #154 from dataplat/develop
2 parents 39e46ea + 36cf7b4 commit 246e281

File tree

464 files changed

+40752
-2726
lines changed

Some content is hidden

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

464 files changed

+40752
-2726
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
param
2+
(
3+
[Parameter()]
4+
[System.IO.DirectoryInfo]
5+
$ProjectPath = (property ProjectPath $BuildRoot),
6+
7+
[Parameter()]
8+
[System.String]
9+
$ProjectName = (property ProjectName ''),
10+
11+
[Parameter()]
12+
[System.String]
13+
$SourcePath = (property SourcePath ''),
14+
15+
[Parameter()]
16+
[System.String]
17+
$HelpSourceFolder = (property HelpSourceFolder 'docs'),
18+
19+
[Parameter()]
20+
[System.String]
21+
$OutputDirectory = (property OutputDirectory 'output'),
22+
23+
[Parameter()]
24+
[System.String]
25+
$BuiltModuleSubdirectory = (property BuiltModuleSubdirectory ''),
26+
27+
[Parameter()]
28+
[System.Management.Automation.SwitchParameter]
29+
$VersionedOutputDirectory = (property VersionedOutputDirectory $true),
30+
31+
[Parameter()]
32+
[System.String]
33+
$HelpOutputFolder = (property HelpOutputFolder 'help'),
34+
35+
[Parameter()]
36+
[cultureInfo]
37+
$HelpCultureInfo = 'en-US',
38+
39+
[Parameter()]
40+
[System.Management.Automation.SwitchParameter]
41+
$CopyHelpMamlToBuiltModuleBase = (property CopyHelpMamlToBuiltModuleBase $true),
42+
43+
# Build Configuration object
44+
[Parameter()]
45+
[System.Collections.Hashtable]
46+
$BuildInfo = (property BuildInfo @{ })
47+
)
48+
49+
function Get-GenerateHelpPSVariables
50+
{
51+
param ()
52+
53+
$script:PesterOutputFolder = Get-SamplerAbsolutePath -Path $PesterOutputFolder -RelativeTo $OutputDirectory
54+
55+
"`tPester Output Folder = '$PesterOutputFolder"
56+
57+
$script:HelpSourceFolder = Get-SamplerAbsolutePath -Path $HelpSourceFolder -RelativeTo $ProjectPath
58+
"`tHelp Source Folder = '$HelpSourceFolder'"
59+
60+
$script:HelpOutputFolder = Get-SamplerAbsolutePath -Path $HelpOutputFolder -RelativeTo $OutputDirectory
61+
"`tHelp output Folder = '$HelpOutputFolder'"
62+
63+
if ($ModuleVersion)
64+
{
65+
$script:HelpOutputVersionFolder = Get-SamplerAbsolutePath -Path $ModuleVersion -RelativeTo $HelpOutputFolder
66+
}
67+
68+
"`tHelp output Version Folder = '$HelpOutputVersionFolder'"
69+
70+
$script:HelpOutputCultureFolder = Get-SamplerAbsolutePath -Path $HelpCultureInfo -RelativeTo $HelpOutputVersionFolder
71+
"`tHelp output Culture path = '$HelpOutputCultureFolder'"
72+
73+
$script:DocOutputFolder = Get-SamplerAbsolutePath -Path 'docs' -RelativeTo $OutputDirectory
74+
"`tDocs output folder path = '$DocOutputFolder'"
75+
}
76+
77+
# Synopsis: Produces markdown help files from the built module.
78+
task Generate_help_from_built_module {
79+
. Set-SamplerTaskVariable
80+
81+
Get-GenerateHelpPSVariables
82+
83+
$generateHelpCommands = @"
84+
`$env:PSModulePath = '$Env:PSModulePath'
85+
`$targetModule = Import-Module -Name '$ProjectName' -ErrorAction Stop -Passthru
86+
87+
`$helpDestination = Join-Path '$HelpSourceFolder' -ChildPath '$HelpCultureInfo'
88+
89+
if (!(Test-Path -Path `$helpDestination)) {
90+
New-Item -Path `$helpDestination -ItemType Directory -Force -ErrorAction Ignore | Out-Null
91+
}
92+
93+
`$docOutputFolder = Join-Path '$DocOutputFolder' -ChildPath '$ProjectName'
94+
95+
`$commandsArray = @()
96+
foreach (`$publicFunction in `$targetModule.ExportedFunctions.Keys) {
97+
`$command = Get-Command -Name `$publicFunction -Module `$targetModule
98+
99+
`$newMarkdownCommandHelpParams = @{
100+
CommandInfo = `$command
101+
OutputFolder = '$DocOutputFolder'
102+
HelpVersion = `$targetModule.Version
103+
Locale = '$HelpCultureInfo'
104+
Encoding = 'utf8'
105+
Force = `$true
106+
}
107+
`$Output = New-MarkdownCommandHelp @newMarkdownCommandHelpParams
108+
109+
`$helpCommand = Import-MarkdownCommandHelp -Path `$Output -ErrorAction Ignore
110+
111+
# Add the command to the array
112+
`$commandsArray += `$helpCommand
113+
114+
`$alias = Get-Alias -Definition `$command.Name -ErrorAction Ignore
115+
116+
if (`$alias) {
117+
`$helpCommand.Aliases = @(`$alias.Name)
118+
} else {
119+
`$helpCommand.Aliases = @()
120+
}
121+
122+
`$helpCommand | Export-MarkdownCommandHelp -OutputFolder '$DocOutputFolder' -Force
123+
124+
Copy-Item -Path `$Output -Destination `$helpDestination -Force
125+
}
126+
127+
`$newMarkdownModuleFileParams = @{
128+
CommandHelp = `$commandsArray
129+
OutputFolder = '$DocOutputFolder'
130+
Force = `$true
131+
}
132+
`$markdownFile = New-MarkdownModuleFile @newMarkdownModuleFileParams
133+
134+
if (`$markdownFile) {
135+
Copy-Item -Path `$markdownFile -Destination `$helpDestination -Force
136+
}
137+
138+
"@
139+
Write-Build -Color DarkGray -Text "$generateHelpCommands"
140+
$sb = [ScriptBlock]::create($generateHelpCommands)
141+
142+
$pwshPath = (Get-Process -Id $PID).Path
143+
&$pwshPath -Command $sb -ExecutionPolicy 'ByPass'
144+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
Your contribution to this project is greatly appreciated!
66
77
TITLE: Please be descriptive not sensationalist.
8-
Prepend the title with the [DscResourceName] if your PR is specific to a DSC resource.
98
Also prepend with [BREAKING CHANGE] if relevant.
109
i.e. [BREAKING CHANGE][xFile] Add security descriptor property
1110
1211
You may remove this comment block, and the other comment blocks, but please
1312
keep the headers and the task list.
1413
Try to keep your PRs atomic: changes grouped in smallest batch affecting a single logical unit.
14+
15+
PLEASE DO NOT submit PRs that contain multiple unrelated changes.
16+
If you have multiple changes, please submit them in separate PRs.
1517
-->
1618

1719
## Pull Request (PR) description
@@ -59,4 +61,4 @@
5961
- [ ] Unit tests added/updated..
6062
- [ ] Integration tests added/updated (where possible).
6163
- [ ] Documentation added/updated (where applicable).
62-
- [ ] Code follows the [contribution guidelines](../CONTRIBUTING.md).
64+
- [ ] Code follows the [contribution guidelines](https://github.com/dataplat/FabricTools/blob/develop/CONTRIBUTING.md).

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.local.*
33
!**/README.md
44
.kitchen/
5+
*.code-workspace
56

67
~*.*
78
*.nupkg

CHANGELOG.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,81 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
## [Unreleased]
77

88
### Added
9+
910
### Changed
11+
1012
### Fixed
13+
1114
### Deprecated
15+
1216
### Removed
17+
1318
### Security
1419

15-
## 0.22.0 - 20250609
20+
## 0.30.0 - 2025-07-22
21+
22+
### Added
23+
24+
- Added unit tests for `Get-FabricWorkspaceUser` function to ensure it works correctly with multiple workspaces both in the pipeline and passed to a parameter.
25+
- Added unit tests for Aliases for `Get-FabricWorkspaceUser` function to ensure backward compatibility.
26+
- Added credits for authors to all functions and Unit tests to verify the existence of such tags (#89)
27+
- Added `NoWait` switch parameter to `New-FabricSQLDatabase` (#123)
28+
- Added functions related to Deployment Pipelines (#121):
29+
- `Add-FabricWorkspaceToStage`,
30+
- `Get-FabricDeploymentPipeline`,
31+
- `Get-FabricDeploymentPipelineOperation`,
32+
- `Get-FabricDeploymentPipelineRoleAssignments`,
33+
- `Get-FabricDeploymentPipelineStage`,
34+
- `Get-FabricDeploymentPipelineStageItem`,
35+
- `New-FabricDeploymentPipeline`,
36+
- `Remove-FabricDeploymentPipeline`,
37+
- `Remove-FabricWorkspaceFromStage`,
38+
- `Start-FabricDeploymentPipelineStage`
39+
- Added private function `Get-FabricContinuationToken` to facilitate pagination
40+
- `Invoke-FabricRestMethod` handles throttling (error 429) by pausing and repeating the request (#88)
41+
- New build automation task added `Generate_help_from_built_module`
42+
43+
### Changed
44+
45+
- `Write-Message` uses `Write-Warning` & `Write-Error` accordingly rather than `Write-Host` with colour (#136)
46+
- Updated `Get-FabricWorkspaceUser` to support pipeline input for `WorkspaceId` and `WorkspaceName` parameters.
47+
- Renamed `Get-FabricWorkspaceUsers` to match the singular form
48+
- `Get-FabricSqlDatabase` accepts Workspace as a pipeline, handles errors correctly and can filter by name (#117).
49+
- Applied splatting for several parameters in `Invoke-FabricRestMethod` and output results in debug mode
50+
- `Remove-FabricSQLDatabase` uses unified function to handle API results
51+
- Updated the `WorkspaceId`, `CapacitiesIds`,`CapacityId`,`CopyJobId`,`datamartId`,`DataPipelineId`,`DataWarehouseGUID`,`DomainId`,`EnvironmentId`,`EventhouseId`,`EventstreamId`,`ExternalDataShareId`,`ItemId`,`KQLDashboardId`,`KQLDatabaseId`,`KQLQuerysetId`,`LakehouseId`,`MirroredDatabaseId`,`MirroredWarehouseId`,`MLExperimentId`,`MLModelId`,`NotebookId`,`operationId`,`PaginatedReportId`,`ParentDomainId`,`parentEventhouseId`,`PrincipalId`,`ReflexId`,`ReportId`,`SemanticModelId`,`SparkCustomPoolId`,`SparkJobDefinitionId`,`SQLDatabaseId`,`SQLEndpointId`,`subscriptionID`,`UserId`,`WarehouseId`,`WorkspaceGUID`,`WorkspaceId`,`WorkspaceIds`, and `WorkspaceRoleAssignmentId` parameters to the datatype GUID [#125](https://github.com/dataplat/FabricTools/issues/125)
52+
- Internal function `Invoke-FabricRestMethod`: (#143)
53+
- handles API response, no need to use `Test-FabricApiResponse` from parent public function
54+
- handles pagination automatically (when `-HandleResponse` is provided)
55+
- All Deployment Pipeline functions raise an error when an exception is caught. Used splatting for params.
56+
- Refactored SQL Database functions to use enhanced capability in `Invoke-FabricRestMethod`. Used splatting for params.
57+
- `Write-Message` uses PSFramework function for logging, which logs function name (#84)
58+
- Changed the `documentation` folder to `docs/<locale>`
59+
- Code-fenced blocks included in function examples
60+
61+
### Fixed
62+
63+
- Enhanced logic in unified function `Test-FabricApiResponse` to handle API results and moved it to private functions
64+
- Fixed bug in `Get-FabricLongRunningOperation` - Uri was incorrectly created (#131)
65+
- Fixed bug in `Get-FabricLongRunningOperationResult` - uses correct statusCode (#131)
66+
- Fixed misleading message from `Remove-FabricWarehouse` (#145)
67+
- Fixed `Start-FabricDeploymentPipelineStage` that supports `-NoWait` correctly
68+
69+
### Deprecated
70+
71+
- None
72+
73+
### Removed
74+
75+
- Removed Revision History from `Get-FabricSQLDatabase`, `Get-FabricSQLDatabase`
76+
77+
**Contributors:**
78+
Rob Sewell, Kamil Nowinski and Gijs Reijn.
79+
80+
**Note:**
81+
For a full list of changes and details, please see the commit history.
82+
83+
## 0.29.0 - 2025-06-10
1684

1785
### Added
1886

CONTRIBUTING.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ Before we go any further, thanks for being here. Thanks for using the module and
66

77
## Important resources
88

9-
- docs TODO: link to docs
10-
- bugs TODO: link to issues issue template
9+
- Documentation such as coding guidelines can be found in the [wiki](https://github.com/dataplat/FabricTools/wiki)
10+
- Bugs can be reported as [issues](https://github.com/dataplat/FabricTools/issues) via the bug issue template.
11+
- Feature requests can be submitted in the issues via the feature request issue template.
12+
- Discussions can be started in the [Discussions](https://github.com/dataplat/FabricTools/discussions) section of the repository.
1113
- communicate via issues, PRs, and discussions as well as the project
1214

1315
## Develop & Build
@@ -34,7 +36,7 @@ The workflow for using this and developing the code is shown below.
3436

3537
3. Start a fresh new PowerShell session to avoid anythjing from your current working sessions to interfere with the module development and building. Develop your updates in the source directory.
3638

37-
You should also resolve all dependencies before you start developing. This will ensure that you have all the required modules, and only them, installed and loaded into your session.
39+
You should also resolve all dependencies before you start developing. This will ensure that you have all the required modules, and only them, installed and loaded into your session.
3840

3941
```PowerShell
4042
.\build.ps1 -ResolveDependency -Tasks noop -UsePSResourceGet
@@ -103,7 +105,14 @@ You should also resolve all dependencies before you start developing. This will
103105
### Fixed
104106
- Fixed issue with `New-FabricDataPipeline` not working correctly.
105107
```
106-
9. Once you are happy with your code and you have updated the changelog, push your branch to GitHub and create a PR against the repo.
108+
109+
10. Once you are happy with your code and you have updated the changelog, there is one thing left to do, which is documentation. To run the generation of the documentation, the `build.ps1` can leverage the `Generate_help_from_built_module` task:
110+
111+
```powershell
112+
./build.ps1 -Tasks Generate_help_from_built_module
113+
```
114+
115+
11. When the process finishes, the documentation should be updated. Now push your branch to GitHub and create a PR against the repo.
107116

108117
## Thanks!
109118

@@ -113,23 +122,19 @@ If you have any questions or need help, please feel free to reach out to us on t
113122

114123
## How to submit changes
115124

116-
TODO:
117-
Pull Request protocol etc. You might also include what response they'll get back from the team on submission, or any caveats about the speed of response.
125+
We use a Pull Request (PR) workflow to manage changes to the module. This means that you will need to create a new branch in your fork of the repository, make your changes, and then create a PR against the main repository. You can find full details in the [wiki](https://github.com/dataplat/FabricTools/wiki)
118126

119127
## How to report a bug
120128

121-
TODO:
122-
Bugs are problems in code, in the functionality of an application or in its UI design; you can submit them through "bug trackers" and most projects invite you to do so, so that they may "debug" with more efficiency and the input of a contributor. Take a look at Atom's example for how to teach people to report bugs to your project.
129+
If you find a bug in the module, please report it using the [issue template](https://github.com/dataplat/FabricTools/issues). This will help us track the issue and ensure that it is fixed in a timely manner.
123130

124131
## Templates
125132

126-
TODO:
127-
in this section of your file, you might also want to link to a bug report "template" like this one here which contributors can copy and add context to; this will keep your bugs tidy and relevant.
133+
There are a number of templates available in the `.github` folder of the repository. These include issue templates for bugs, feature requests, and discussions. You can use these templates to help you create a new issue or discussion.
128134

129135
## Style Guide
130136

131-
TODO:
132-
include extensions and vscode settings we use to keep things neat
137+
The Style Guide is a set of rules and guidelines that we follow to ensure that our code is consistent, readable, and maintainable. It is located in the [wiki](https://github.com/dataplat/FabricTools/wiki).
133138

134139
## Code of Conduct
135140

RequiredModules.psd1

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,23 @@
1111
# Repository = 'PSGallery'
1212
# }
1313
#}
14-
Assert = "0.9.6"
15-
InvokeBuild = 'latest'
16-
PSScriptAnalyzer = '1.19.1'
17-
Pester = 'latest'
18-
ModuleBuilder = 'latest'
19-
ChangelogManagement = 'latest'
20-
Sampler = 'latest'
21-
'Sampler.GitHubTasks' = 'latest'
22-
MarkdownLinkCheck = 'latest'
23-
PSFramework = 'latest'
24-
'Az.Accounts' = '5.0.0'
25-
'Az.Resources' = '6.15.1'
26-
'MicrosoftPowerBIMgmt' = '1.2.1111'
14+
Assert = "0.9.6"
15+
InvokeBuild = 'latest'
16+
PSScriptAnalyzer = '1.19.1'
17+
Pester = 'latest'
18+
ModuleBuilder = 'latest'
19+
ChangelogManagement = 'latest'
20+
Sampler = 'latest'
21+
'Sampler.GitHubTasks' = 'latest'
22+
MarkdownLinkCheck = 'latest'
23+
PSFramework = 'latest'
24+
'Az.Accounts' = '5.0.0'
25+
'Az.Resources' = '6.15.1'
26+
'MicrosoftPowerBIMgmt' = '1.2.1111'
27+
'Microsoft.PowerShell.PlatyPS' = @{
28+
Version = '1.0.0-rc1'
29+
Parameters = @{
30+
AllowPrerelease = $true
31+
} # TODO: Simply remove after GA
32+
}
2733
}

build.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ BuildWorkflow:
5252
- Build_NestedModules_ModuleBuilder
5353
- Create_changelog_release_output
5454

55-
5655
pack:
5756
- build
5857
- package_module_nupkg

0 commit comments

Comments
 (0)