Add New-CosmosDbTransactionalBatch command to support transactional batch operations#517
Add New-CosmosDbTransactionalBatch command to support transactional batch operations#517ArmaanMcleod wants to merge 28 commits intoPlagueHO:mainfrom
New-CosmosDbTransactionalBatch command to support transactional batch operations#517Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for transactional batch operations in Cosmos DB by introducing the New-CosmosDbTransactionalBatch command. This allows multiple operations (Create, Upsert, Read, Replace, Delete) to be executed atomically or non-atomically against documents within the same partition key.
Key Changes:
- New public function
New-CosmosDbTransactionalBatchfor executing batch operations - New private helper function for setting custom type names on batch operation results
- Comprehensive unit and integration test coverage using Pester v5 syntax (first Pester v5 tests in the codebase)
- Custom format file for displaying transactional batch operation results
- Complete documentation in markdown format
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| source/Public/transactionalbatch/New-CosmosDbTransactionalBatch.ps1 | New public function implementing transactional batch operations with support for various operation types and atomic/non-atomic modes |
| source/Private/transactionalbatch/Set-CosmosDbTransactionalBatchOperationType.ps1 | Helper function to set custom type names on batch operation result objects |
| tests/Unit/CosmosDB.transactionalbatch.Tests.ps1 | Comprehensive unit tests covering all function scenarios including error handling |
| tests/Integration/CosmosDB.integration.Tests.ps1 | Integration tests verifying batch operations against actual Cosmos DB service |
| source/formats/transactionalbatch.formats.ps1xml | Custom format definitions for displaying batch operation results in table, wide, and list views |
| source/en-US/CosmosDB.strings.psd1 | Localization string for ShouldProcess message |
| source/CosmosDB.psd1 | Module manifest updates to export new function and include format file |
| docs/New-CosmosDbTransactionalBatch.md | Complete documentation with examples and parameter descriptions |
| CHANGELOG.md | Change log entry documenting the new feature |
source/Private/transactionalbatch/Set-CosmosDbTransactionalBatchOperationType.ps1
Show resolved
Hide resolved
source/Public/transactionalbatch/New-CosmosDbTransactionalBatch.ps1
Outdated
Show resolved
Hide resolved
source/Public/transactionalbatch/New-CosmosDbTransactionalBatch.ps1
Outdated
Show resolved
Hide resolved
…h.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function New-CosmosDbTransactionalBatch | ||
| { | ||
| [CmdletBinding(SupportsShouldProcess = $true)] | ||
| [OutputType([System.Object[]])] | ||
| param ( |
There was a problem hiding this comment.
Missing comment-based help. Public functions should include comment-based help with at least .SYNOPSIS, .DESCRIPTION, .PARAMETER, .EXAMPLE, .OUTPUTS, and .NOTES sections as per PowerShell guidelines (CodingGuidelineID: 1000003). The private helper function Set-CosmosDbTransactionalBatchOperationType correctly includes comment-based help, but this public-facing cmdlet does not.
There was a problem hiding this comment.
Probably not necessary since this command is in the docs folder
source/Public/transactionalbatch/New-CosmosDbTransactionalBatch.ps1
Outdated
Show resolved
Hide resolved
source/Public/transactionalbatch/New-CosmosDbTransactionalBatch.ps1
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rties (wide, list, table)
Pull Request
Description
Added
New-CosmosDbTransactionalBatchfunction for executing atomic transactional batch operations against a collection.Supports Create, Upsert, Read, Replace, and Delete operations on multiple documents within the same partition key
Related Issues
Fixes #516
Improvements / Enhancements
Testing
Contributor Mention
cc @PlagueHO
This change is