-
Notifications
You must be signed in to change notification settings - Fork 320
Sync eng/common directory with azure-sdk-tools for PR 13005 #3371
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
base: main
Are you sure you want to change the base?
Changes from all commits
40fb1c1
e0de945
d91865a
bb94d50
2264c03
2726300
7ec538e
afc1b15
978167b
864b2cd
47a39e3
ed333df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,10 @@ class PackageProps { | |||||||||||
| [HashTable]$ArtifactDetails | ||||||||||||
| [HashTable]$CIParameters | ||||||||||||
|
|
||||||||||||
| # Path from root of azure-rest-api-specs repo to spec project (read from | ||||||||||||
| # tsp-location.yaml if it exists in the package directory) | ||||||||||||
| [string]$SpecProjectPath | ||||||||||||
|
|
||||||||||||
| PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) { | ||||||||||||
| $this.Initialize($name, $version, $directoryPath, $serviceDirectory) | ||||||||||||
| } | ||||||||||||
|
|
@@ -61,6 +65,10 @@ class PackageProps { | |||||||||||
| $this.ChangeLogPath = $null | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| if (Test-Path (Join-Path $directoryPath 'tsp-location.yaml')) { | ||||||||||||
| $this.SpecProjectPath = (LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')).directory | ||||||||||||
|
||||||||||||
| $this.SpecProjectPath = (LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')).directory | |
| $yamlContent = LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml') | |
| if ($yamlContent -and $yamlContent.directory) { | |
| $this.SpecProjectPath = $yamlContent.directory | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
(!$workItem.fields.ContainsKey('Custom.SpecProjectPath') -and $packageInfo.SpecProjectPath)may not work as intended in PowerShell. When$packageInfo.SpecProjectPathis an empty string (the default value from the parameter), PowerShell will treat it as falsy, but you likely want to update the work item only when there's a non-empty value.Consider using a more explicit check:
This ensures that empty strings from the default parameter value don't trigger unnecessary updates.