Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DevOps.ServiceConnections.ps1 with fix for issue #106 #108

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

moulincourt
Copy link
Collaborator

Utilized "replace" method to remove undue backslashes from the export function's resultant filename.

Description

Utilized "replace" method to remove undue backslashes from the export function's resultant filename. Changes made will fix issue #106.

Related Issue

#106

Motivation and Context

Issue #106 occurs because backslashes are not removed from the service connection name prior to export. This breaks the Out-File cmdlet because the path will always be incorrect..

How Has This Been Tested?

# Define variables
$OutputPath = "C:/temp"
$serviceconnection = @{
    name = "CI/CD template Repo Connection"
    description = "desc is nill in this case"
}

# test string without replace -> will fail
# Result: C:/temp/CI/CD template Repo Connection.ado.sc.json
$filename_no_replace = "$OutputPath/$($serviceConnection.name).ado.sc.json"
Write-Output -InputObject $filename_no_replace

# test string without replace -> will fail
# Result: C:/temp/CICD template Repo Connection.ado.sc.json
$filename_with_replace = "$OutputPath/$($serviceConnection.name.replace('/','')).ado.sc.json"
Write-Output -InputObject $filename_with_replace

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Utilized "replace" method to remove undue backslashes from the export function's resultant filename.
Fixed my own screw up; used a dot instead of a comma causing the replace method to go haywire.
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Test Results

531 tests   531 ✅  10s ⏱️
185 suites    0 💤
  1 files      0 ❌

Results for commit b57f8df.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b21b063) 99.44% compared to head (b57f8df) 99.44%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #108   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files          11       11           
  Lines         715      715           
=======================================
  Hits          711      711           
  Misses          4        4           
Flag Coverage Δ
unittests 99.44% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@webtonize webtonize left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution!

@webtonize webtonize merged commit bad43bd into main Jan 15, 2024
6 checks passed
@webtonize webtonize deleted the fix-issue-106 branch January 15, 2024 20:58
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