Skip to content

Sync eng/common directory with azure-sdk-tools for PR 10286 #45434

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

Merged

Conversation

azure-sdk
Copy link
Collaborator

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

@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 00:43
@azure-sdk azure-sdk requested a review from a team as a code owner May 22, 2025 00:43
@azure-sdk azure-sdk requested a review from chidozieononiwu May 22, 2025 00:43
@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 May 22, 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

Sync the eng/common directory with updates from the Azure SDK tools repository to improve correlation tracking and logging, and adjust the pipeline step naming.

  • Added correlation IDs and custom headers to APIView and API change detection HTTP calls
  • Enhanced logged output by pretty-printing JSON responses
  • Updated pipeline step display name for clarity

Reviewed Changes

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

File Description
eng/common/scripts/Helpers/ApiView-Helpers.ps1 Inject x-correlation-id header and pretty-print API review responses
eng/common/scripts/Detect-Api-Changes.ps1 Inject x-correlation-id, refine headers, and pretty-print JSON
eng/common/pipelines/templates/steps/detect-api-changes.yml Renamed displayName from “Detect API changes” to “Create APIView if API has changes”


$correlationId = [System.Guid]::NewGuid().ToString()
$headers = @{
"Content-Type" = "application/json"
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

Using a 'Content-Type' header on a GET request is misleading—consider replacing it with an 'Accept: application/json' header or removing it entirely.

Suggested change
"Content-Type" = "application/json"
"Accept" = "application/json"

Copilot uses AI. Check for mistakes.

$StatusCode = $Response.StatusCode
$responseContent = $Response.Content | ConvertFrom-Json | ConvertTo-Json -Depth 10
LogSuccess $responseContent
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] LogSuccess only outputs the JSON body. Including the HTTP status code in this log would make troubleshooting easier and consistent with other calls.

Suggested change
LogSuccess $responseContent
LogSuccess "Status Code: $StatusCode, Response: $responseContent"

Copilot uses AI. Check for mistakes.

Comment on lines +281 to +285
$responseContent = $Response.Content | ConvertFrom-Json | ConvertTo-Json -Depth 10
LogSuccess "Status Code: $($response.StatusCode)`nAPI review request created successfully.`n$($responseContent)"
}
elseif ($response.StatusCode -eq 208) {
LogSuccess "Status Code: $($response.StatusCode)`nThere is no API change compared with the previous version."
$responseContent = $Response.Content | ConvertFrom-Json | ConvertTo-Json -Depth 10
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Variable casing is inconsistent—$Response vs $response. Unifying on one spelling improves readability and reduces potential confusion.

Copilot uses AI. Check for mistakes.

@chidozieononiwu chidozieononiwu merged commit 5e96016 into main May 22, 2025
46 of 49 checks passed
@chidozieononiwu chidozieononiwu deleted the sync-eng/common-apiViewMVCtoAPIControllers-10286 branch May 22, 2025 06:30
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