Repository navigation
Add Git integration cmdlets - #217
Merged
Merged
Conversation
Add nine cmdlets wrapping the Fabric Git REST APIs (#48): Connect-FabricGit, Disconnect-FabricGit, Get-FabricGitConnection, Initialize-FabricGitConnection, Get-FabricGitStatus, Invoke-FabricGitCommit, Invoke-FabricGitUpdate, Get-FabricGitCredential and Update-FabricGitCredential. Connect-FabricGit requires -GitProviderType and checks it against the AzureDevOps/GitHub parameter sets; -Initialize connects and initializes in one call. Commit and update look up the workspace head and remote commit hash automatically unless -NoAutoResolve is used. Status output can be flattened and piped into Invoke-FabricGitCommit to commit selected items. Includes unit tests, generated help pages and a CHANGELOG entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux Test Results 1 files 1 063 suites 58s ⏱️ Results for commit e5e5c7e. |
WinPS51 Test Results 1 files 1 064 suites 1m 14s ⏱️ Results for commit e5e5c7e. |
WinPS71 Test Results 1 files 1 064 suites 1m 9s ⏱️ Results for commit e5e5c7e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48
Adds nine cmdlets that wrap the Fabric Git REST APIs, following the design agreed in #48 (comment).
Connect-FabricGitDisconnect-FabricGitGet-FabricGitConnectionInitialize-FabricGitConnectionGet-FabricGitStatusInvoke-FabricGitCommitInvoke-FabricGitUpdateGet-FabricGitCredentialUpdate-FabricGitCredentialDesign decisions applied
-GitProviderTypeis mandatory onConnect-FabricGit. It must match the parameter set used: Azure DevOps needs-OrganizationName/-ProjectName, GitHub needs-OwnerName. If they don't match, the cmdlet throws a clear error before calling the API. GitHub also requires-ConnectionId.Connect-FabricGit -Initialize [-InitializationStrategy] [-NoWait]connects and initializes in one call.Initialize-FabricGitConnectionis still available for workspaces that are already connected.WorkspaceHeadorRemoteCommitHash,Invoke-FabricGitCommitandInvoke-FabricGitUpdateget them fromGet-FabricGitStatus.-NoAutoResolveturns this off.Other behaviour
WorkspaceIdfrom the pipeline by property name (aliasId), soGet-FabricWorkspace | Get-FabricGitStatusworks.Get-FabricGitStatus -ChangesOnly/-ConflictsOnlyreturns one flat object per changed item. You can filter these and pipe them intoInvoke-FabricGitCommit, which commits the selected items in a single API call per workspace.-WhatIf/-Confirm.Disconnect-FabricGitandInvoke-FabricGitUpdateuseConfirmImpact = 'High'.Invoke-FabricRestMethodwith hash splatting andHandleResponse = $true, which handles long-running operations and throttling. API errors are thrown rather than swallowed.Example
Testing
tests/Unit/). They cover request URIs, methods, bodies, parameter sets, pipeline binding,-WhatIf, automatic lookup and-NoAutoResolve, and error paths. All pass.tests/QA) pass with no failures.Docs
Generate_help_from_built_module, and the cmdlets were added todocs/en-US/FabricTools.md.CHANGELOG.mdhas an entry under[Unreleased]/Added.🤖 Generated with Claude Code