Skip to content

Fix integrate-boards command to use GitHub App connections when available #1360

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 13, 2025

This PR addresses the issue where ado2gh integrate-boards fails when using GitHub PATs with broader permissions due to Azure DevOps changes implemented around June 2nd that require minimal PAT permissions for boards integration.

Problem

Azure DevOps now rejects GitHub PATs with any extra permissions when configuring boards integration, causing failures for customers who use the same PAT for both repository migration and boards integration (as recommended by our generated scripts).

Solution

The command now automatically detects and uses existing GitHub App service connections when available, falling back to PAT-based connections only when necessary. This leverages the existing GitHub App infrastructure already present in the codebase.

Key Changes

  • Smart connection detection: IntegrateBoardsCommandHandler now checks for existing GitHub App service connections first
  • Automatic fallback: Falls back to PAT-based approach when no GitHub App connection exists
  • Proper payload handling: Sets isGitHubApp = true when using GitHub App connections
  • Informative logging: Users can see which authentication method is being used
  • Full backward compatibility: No breaking changes to existing workflows

Example Usage

# If a GitHub App service connection exists for the org:
ado2gh integrate-boards --ado-org myorg --ado-team-project myproject --github-org myghorg --github-repo myrepo
# Output: "Using existing GitHub App service connection for Boards integration"

# If no GitHub App connection exists:
# Output: "No GitHub App service connection found, creating PAT-based endpoint for Boards integration"

Testing

  • Added comprehensive test coverage for both GitHub App and PAT scenarios
  • All existing tests continue to pass (890 unit tests)
  • Verified proper payload generation for both authentication methods

This change ensures that customers with existing GitHub App setups will automatically use the more reliable authentication method, while maintaining full compatibility for those still using PAT-based workflows.

Fixes #1357.

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
    • Triggering command: /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 43171 --endpoint 127.0.0.1:043171 --role client --parentprocessid 5656 --telemetryoptedin false (dns block)
  • https://api.github.com/orgs/octoshift-e2e-source-linux/repos
    • Triggering command: /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 43171 --endpoint 127.0.0.1:043171 --role client --parentprocessid 5656 --telemetryoptedin false (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits June 13, 2025 12:50
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] ado2gh integrate-boards doesn't work with the same GitHub PAT used for migrations Fix integrate-boards command to use GitHub App connections when available Jun 13, 2025
@Copilot Copilot AI requested a review from dylan-smith June 13, 2025 13:03
Copilot finished work on behalf of dylan-smith June 13, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ado2gh integrate-boards doesn't work with the same GitHub PAT used for migrations
2 participants