-
Notifications
You must be signed in to change notification settings - Fork 109
Fix false success reporting in ado2gh integrate-boards when GitHub PAT permissions are incorrect #1354
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
…lity Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
ado2gh integrate-boards
reports success when it actually failedCo-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Unit Test Results 1 files 1 suites 21s ⏱️ Results for commit 1ec632c. |
1ec632c
to
ff4ca08
Compare
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ppression Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The |
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
You're absolutely right. I removed the unnecessary IntegrateBoardsCommandHandler tests since I didn't change any behavior in the command handler itself - only enhanced the underlying AdoApi service methods. The tests for those service methods are sufficient to verify the new error handling behavior. The changes are in commit 13bdd79. |
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
…s to bubble up Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
The build gave this linter error: Always run |
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
... Fixed the IDE0005 linter error by removing the unnecessary |
Problem
The
ado2gh integrate-boards
command was incorrectly reporting success when it actually failed due to GitHub PAT permission issues. This occurred because the Azure DevOps API returns HTTP 200 (OK) responses but includes error messages in the response body when the GitHub PAT has insufficient or incorrect permissions.This PR will not fix the failing ADO integration tests, but it will improve the error message that both users and engineers get in this situation. Previously the test logs would show everything successful and the integration test would fail when trying to assert that the boards integration had been properly configured. Now the test logs will properly recognize and log the error when it occurs configuring boards integration.
Example of the Issue
When running with a GitHub PAT that has too many permissions, the command would log:
The command reported success despite the clear error messages in the API responses.
Solution
Enhanced error handling in the ADO API service methods used by the integrate-boards workflow:
GetGithubHandle
- Enhanced existing error checking to also detecterrorMessage
in responsesGetBoardsGithubRepoId
- Added error detection for repository access failuresCreateBoardsGithubConnection
- Added error detection for connection creation failuresAddRepoToBoardsGithubConnection
- Added error detection for repository addition failuresEach method now:
errorMessage
fields in the appropriate data provider sectionsOctoshiftCliException
with error details when issues are detectedTesting
Added comprehensive test coverage:
Impact
Fixes #1353.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
dev.azure.com
/usr/lib/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/gh-gei/gh-gei/src/OctoshiftCLI.IntegrationTests/bin/Debug/net8.0/OctoshiftCLI.IntegrationTests.runtimeconfig.json --depsfile /home/REDACTED/work/gh-gei/gh-gei/src/OctoshiftCLI.IntegrationTests/bin/Debug/net8.0/OctoshiftCLI.IntegrationTests.deps.json /home/REDACTED/work/gh-gei/gh-gei/src/OctoshiftCLI.IntegrationTests/bin/Debug/net8.0/testhost.dll --port 38455 --endpoint 127.0.0.1:038455 --role client --parentprocessid 3590 --telemetryoptedin false
(dns block)http://www.microsoft.com:80/pkiops/crl/Microsoft%20Identity%20Verification%20Root%20Certificate%20Authority%202020.crl
dotnet build
(http block)http://www.microsoft.com:80/pkiops/crl/Microsoft%20Public%20RSA%20Timestamping%20CA%202020.crl
dotnet build
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 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.