Skip to content

Dna 381 and dna 370 - #16

Merged
LindnerBrewery merged 5 commits into
mainfrom
DNA-381_and_DNA-370
Jan 14, 2026
Merged

Dna 381 and dna 370#16
LindnerBrewery merged 5 commits into
mainfrom
DNA-381_and_DNA-370

Conversation

@LindnerBrewery

Copy link
Copy Markdown
Owner

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

  • DNA-381: Performance optimization for Set-ProjectTenantVariable
  • DNA-370: Bug fixes for tenant variable handling

Changes

  • Set-ProjectTenantVariable: Cached variable template retrieval outside loops to eliminate redundant API calls (performance improvement from ~19s to <2s)
  • Set-ProjectTenantVariable: Fixed sensitive variable handling by correctly passing IsSensitive flag from template to PropertyValueResource
  • Get-ProjectTenantVariable: Fixed IsDefaultValue logic to correctly handle variables with empty string values
  • Connect-Octopus: Added connection confirmation message displaying server URL, user, and space

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ⚡ Performance improvement
  • 📝 Documentation update
  • 🔨 Refactoring
  • ⚠️ Breaking change

Testing

  • Executed Set-ProjectTenantVariable with multiple variables; confirmed execution time reduced from ~19s to <2s
  • Tested setting sensitive variables and verified proper encryption in Octopus Deploy
  • Validated Get-ProjectTenantVariable with empty strings, null values, and actual values to verify correct default detection
  • Confirmed connection message displays server details correctly

Checklist

  • CHANGELOG.md updated
  • Code follows PowerShell best practices
  • Comment-based help updated (if applicable)
  • Tested locally

Copilot AI review requested due to automatic review settings January 14, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)),

Copilot AI Jan 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected at the end of this line. Please remove the trailing whitespace after the comma for consistency with PowerShell best practices.

Copilot uses AI. Check for mistakes.
@LindnerBrewery
LindnerBrewery merged commit 401c545 into main Jan 14, 2026
14 of 15 checks passed
@LindnerBrewery
LindnerBrewery deleted the DNA-381_and_DNA-370 branch January 14, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants