-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use Azure DevOps logging command format for version bump check error with file navigation #12585
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?
Conversation
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: rainersigwald <[email protected]>
throw
ing here, use the AzDO format commands (https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#formatting-commands) to report a...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.
@copilot Can you also report the file and line number of the Versions.props
file that should change?
@copilot Can you also report the file and line number of the Versions.props file that should change? |
Co-authored-by: rainersigwald <[email protected]>
Added in commit 3b385bf. The error message now includes |
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.
Pull Request Overview
This PR updates the Azure DevOps pipeline error handling for the version bump check to use a structured logging command instead of throwing a PowerShell exception, improving discoverability and navigation in the pipeline UI.
- Replaces throw with an Azure DevOps logging command (##vso[task.logissue ...])
- Adds file path and line number metadata for clickable navigation
- Explicitly exits with non-zero status using exit 1
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Summary
Fixes the error reporting in
.vsts-dotnet-ci.yml
line 48 to use proper Azure DevOps logging command format instead ofthrow
, making errors easier to find and diagnose in the Azure DevOps pipeline UI. The error message now includes file path and line number information for direct navigation.Problem
When the version bump check failed on release branches (vs* branches), the error was thrown as a PowerShell exception, which made it harder to locate and understand in the Azure DevOps pipeline logs. The error message was embedded in a
throw
statement, which doesn't utilize Azure DevOps' formatting capabilities or provide navigation to the specific file location that needs to be changed.Solution
Replace the
throw
statement with:Write-Host
to emit the proper Azure DevOps logging command:##vso[task.logissue type=error]
sourcepath
andlinenumber
properties to enable direct navigation to the file locationexit 1
to explicitly fail the step with a non-zero exit codeBefore:
After:
Benefits
eng/Versions.props
where theVersionPrefix
needs to be updatedTesting
Validated that:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.