Skip to content

Conversation

azure-sdk
Copy link
Collaborator

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

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 16:00
@azure-sdk azure-sdk requested a review from a team as a code owner October 14, 2025 16:00
@azure-sdk azure-sdk requested a review from raych1 October 14, 2025 16:00
@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 Oct 14, 2025
Copy link
Contributor

@Copilot 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 synchronizes the eng/common directory with azure-sdk-tools PR 12467, introducing improvements to the API review creation process. The changes refactor parameter handling to support package information files directly while maintaining backward compatibility with existing workflows.

Key Changes

  • Modified function signatures to accept packageInfo objects instead of separate package name parameters
  • Added parameter checking logic to support both legacy and new parameter patterns
  • Introduced PackageInfoFiles parameter as a new way to specify packages for API review

Reviewed Changes

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

File Description
eng/common/scripts/Detect-Api-Changes.ps1 Removed $pkgArtifactName parameter from function call to align with refactored signature
eng/common/scripts/Create-APIReview.ps1 Refactored to accept packageInfo objects throughout, added parameter priority logic, and introduced PackageInfoFiles parameter support
eng/common/pipelines/templates/steps/create-apireview.yml Added typed parameter definitions and PackageInfoFiles parameter to pipeline template

if ($supportsPackageInfoParam) {
LogInfo "Calling $FindArtifactForApiReviewFn with packageInfo parameter"
$packages = &$FindArtifactForApiReviewFn $ArtifactPath $pkgArtifactName $packageInfo
$packages = &$FindArtifactForApiReviewFn $ArtifactPath $packageInfo
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

The function call removes the $pkgArtifactName parameter but doesn't check whether the function expects it. In Create-APIReview.ps1, the same function is called with parameter detection logic (lines 183-201) to determine whether to pass 2 or 3 arguments. This file should implement the same check to avoid breaking calls to functions that still expect $pkgArtifactName.

Copilot uses AI. Check for mistakes.

# Check if the function supports the packageInfo parameter
$functionInfo = Get-Command $FindArtifactForApiReviewFn -ErrorAction SilentlyContinue
$supportsPackageInfoParam = $false

Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Excessive whitespace on line 186. Remove the trailing spaces to maintain consistent code formatting.

Suggested change

Copilot uses AI. Check for mistakes.

# Call function with appropriate parameters
if ($supportsPackageInfoParam) {
LogInfo "Calling $FindArtifactForApiReviewFn with packageInfo parameter"
$packages = &$FindArtifactForApiReviewFn $ArtifactPath $pkgArtifactName $packageInfo
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

When $supportsPackageInfoParam is true, the function is called with three parameters: $ArtifactPath, $pkgArtifactName, and $packageInfo. However, the parameter name check only verifies that 'packageInfo' exists in the parameter list. This doesn't guarantee the function expects exactly these three parameters in this order. Consider also checking the total parameter count to ensure compatibility.

Copilot uses AI. Check for mistakes.

@azure-sdk azure-sdk force-pushed the sync-eng/common-users/raych1/update-api-view-template-12467 branch from 04b9963 to 85ea89d Compare October 14, 2025 16:07
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.

2 participants