-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Sync eng/common directory with azure-sdk-tools for PR 13005 #44146
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
c745cc1
ac18408
fba5700
0a50ebc
3c83db8
1d6fb53
b47db9e
4091e89
4838d03
b74eb1c
654cb53
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 | |
| $tspLocation = LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml') | |
| if ($tspLocation -ne $null) { | |
| $this.SpecProjectPath = $tspLocation.directory | |
| } | |
| else { | |
| $this.SpecProjectPath = $null | |
| } |
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.
[nitpick] The condition can be simplified for better readability. The current logic checks if the field is missing and there's a value, or if the field exists and has a different value. This can be more concisely expressed as: update if
$packageInfo.SpecProjectPathis present and either the field doesn't exist or has a different value. Consider:if ($packageInfo.SpecProjectPath -and ((!$workItem.fields.ContainsKey('Custom.SpecProjectPath')) -or ($workItem.fields['Custom.SpecProjectPath'] -ne $packageInfo.SpecProjectPath)))