Dna 381 and dna 370 - #16
Merged
Merged
Conversation
…ction for improved clarity and performance Fixed and issue where sensitiv variables where not set
…rectly handle variable scoping
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements performance optimizations and bug fixes for tenant variable management functions in the OctopusDeploy PowerShell module. The primary focus is on reducing API call overhead and correcting variable handling logic.
Changes:
- Cached variable template retrieval in Set-ProjectTenantVariable to eliminate redundant API calls, reducing execution time from ~19 seconds to <2 seconds
- Fixed sensitive variable handling by correctly using the IsSensitive flag from variable templates
- Corrected IsDefaultValue logic to properly distinguish between empty string values and default values
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| OctopusDeploy/Public/Set-ProjectTenantVariable.ps1 | Performance optimization through template caching and sensitive variable handling fix |
| OctopusDeploy/Public/Get-ProjectTenantVariable.ps1 | Fixed IsDefaultValue logic to handle empty strings correctly |
| OctopusDeploy/Public/Connect-Octopus.ps1 | Added connection confirmation message for better user feedback |
| CHANGELOG.md | Documented all changes in the unreleased section |
| .github/PULL_REQUEST_TEMPLATE.md | Modernized and simplified PR template structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $Project.Id, | ||
| $varTemplate.Id, | ||
| [Octopus.Client.Model.PropertyValueResource]::new($h.Value, $false), | ||
| [Octopus.Client.Model.PropertyValueResource]::new($h.Value, $($varTemplate.DefaultValue.IsSensitive)), |
There was a problem hiding this comment.
Trailing whitespace detected at the end of this line. Please remove the trailing whitespace after the comma for consistency with PowerShell best practices.
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.
Summary
Performance optimization and bug fixes for tenant variable management functions. Reduced Set-ProjectTenantVariable execution time from ~19s to <2s by caching API calls, fixed sensitive variable handling, and corrected IsDefaultValue logic.
Related Issues
Changes
IsSensitiveflag from template toPropertyValueResourceIsDefaultValuelogic to correctly handle variables with empty string valuesType of Change
Testing
Set-ProjectTenantVariablewith multiple variables; confirmed execution time reduced from ~19s to <2sGet-ProjectTenantVariablewith empty strings, null values, and actual values to verify correct default detectionChecklist