Skip to content

Conversation

@azure-sdk
Copy link
Collaborator

Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13005 See eng/common workflow

@azure-sdk azure-sdk requested a review from a team as a code owner November 22, 2025 00:31
@azure-sdk azure-sdk requested review from Copilot and danieljurek and removed request for Copilot November 22, 2025 00:31
@azure-sdk azure-sdk added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Nov 22, 2025
Copy link

@eshanhasitha eshanhasitha left a comment

Choose a reason for hiding this comment

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

Copilot AI review requested due to automatic review settings November 25, 2025 20:35
@azure-sdk azure-sdk force-pushed the sync-eng/common-djurek/codeowners-ci-work-item-spec-repo-path-13005 branch from 2347f18 to fb46836 Compare November 25, 2025 20:35
Copilot finished reviewing on behalf of azure-sdk November 25, 2025 20:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR syncs the eng/common directory with azure-sdk-tools PR #13005, adding support for tracking TypeSpec project locations. The changes enable the SDK build and release infrastructure to associate packages with their corresponding spec projects in the azure-rest-api-specs repository.

Key Changes:

  • Added SpecProjectPath property to PackageProps class to store the path from the root of azure-rest-api-specs repo to the spec project
  • Updated DevOps work item helpers to read, store, and update the Custom.SpecProjectPath field in Azure DevOps work items
  • Modified package validation scripts to pass the spec project path through the release workflow

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
eng/common/scripts/Package-Properties.ps1 Added SpecProjectPath property to PackageProps class and logic to read it from tsp-location.yaml file
eng/common/scripts/Save-Package-Properties.ps1 Added logging output for the Spec Project Path property
eng/common/scripts/Validate-All-Packages.ps1 Updated CreateUpdatePackageWorkItem to pass specProjectPath parameter to Update-DevOpsReleaseWorkItem
eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 Added Custom.SpecProjectPath field handling in work item queries, creation, and updates including new parameter in Update-DevOpsReleaseWorkItem function

}

if (Test-Path (Join-Path $directoryPath 'tsp-location.yaml')) {
$this.SpecProjectPath = (LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')).directory
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

Potential null reference exception: LoadFrom-Yaml can return null if the file doesn't exist or fails to parse (as seen in the function definition). Accessing .directory on a null object will cause a runtime error.

Consider adding null-checking:

$tspLocation = LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')
if ($tspLocation -and $tspLocation.directory) {
    $this.SpecProjectPath = $tspLocation.directory
}
Suggested change
$this.SpecProjectPath = (LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')).directory
$tspLocation = LoadFrom-Yaml (Join-Path $directoryPath 'tsp-location.yaml')
if ($tspLocation -and $tspLocation.directory) {
$this.SpecProjectPath = $tspLocation.directory
}

Copilot uses AI. Check for mistakes.



if ((!$workItem.fields.ContainsKey('Custom.SpecProjectPath') -and $packageInfo.SpecProjectPath) -or
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

Logic issue with empty string handling: The condition checks if $packageInfo.SpecProjectPath is truthy, but the parameter default value is an empty string "" (line 1265). In PowerShell, an empty string is falsy, but when the SpecProjectPath is explicitly set to an empty string in $packageInfo (line 1289), the condition on line 1338 may not behave as intended if you want to distinguish between "not set" (null) and "set to empty".

If empty string is a valid value that should trigger updates, consider using -and ![string]::IsNullOrEmpty($packageInfo.SpecProjectPath) or similar. If null should be used to indicate "not set", consider changing the parameter default to $null instead of "" on line 1265.

Suggested change
if ((!$workItem.fields.ContainsKey('Custom.SpecProjectPath') -and $packageInfo.SpecProjectPath) -or
if ((!$workItem.fields.ContainsKey('Custom.SpecProjectPath') -and -not [string]::IsNullOrEmpty($packageInfo.SpecProjectPath)) -or

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants