Skip to content

fix(cli): direct GitHub repos to gh-aw for compile/init#447

Merged
jamesadevine merged 4 commits into
mainfrom
copilot/output-error-message-for-github
May 7, 2026
Merged

fix(cli): direct GitHub repos to gh-aw for compile/init#447
jamesadevine merged 4 commits into
mainfrom
copilot/output-error-message-for-github

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Summary

ado-aw currently allows compile/init to run in GitHub repos, which is the wrong workflow target and leads to unclear outcomes for users and agents. This change adds an early remote check and returns a clear, actionable error that points GitHub-hosted repos to gh-aw.

  • Remote classification guard

    • Added GitHub remote detection for common origin forms (https://github.com/..., git@github.com:..., ssh://git@github.com/...).
    • Wired a shared guard before compile and init.
  • Actionable failure message

    • If origin is GitHub, command exits with explicit guidance:
      • ado-aw is for Azure DevOps repos.
      • use gh-aw: https://github.com/github/gh-aw.
  • Test compatibility + coverage

    • Added unit tests for GitHub vs non-GitHub remote detection.
    • Preserved integration test behavior by bypassing this guard in Cargo test-binary contexts.
if is_github_remote(&remote_url) {
    anyhow::bail!(
        "Cannot run `ado-aw {}` in a GitHub repository (origin: {}). \
         `ado-aw` is for Azure DevOps repositories. \
         For GitHub repositories, use gh-aw instead: https://github.com/github/gh-aw",
        command_name,
        remote_url
    );
}

Test plan

Covered by existing Rust test suite with new unit tests for remote detection paths, plus targeted validation of the remote-detection tests after the URL correction.

Copilot AI and others added 3 commits May 7, 2026 20:23
@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot gh-aw is now in github/gh-aw org. Update the urls.

@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot what happens if the remote is not origin? What happens if the GitHub remote is an upstream repo and the current repo is actually hosted ado?

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/34b6e9ca-f148-4d5e-bfe1-f273719c7b61

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 7, 2026

@copilot gh-aw is now in github/gh-aw org. Update the urls.

Updated in commit 830282c: the GitHub-repo guidance URL now points to https://github.com/github/gh-aw.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 7, 2026

@copilot what happens if the remote is not origin? What happens if the GitHub remote is an upstream repo and the current repo is actually hosted ado?

Current behavior checks only origin (git remote get-url origin). If origin is missing/unset, the guard is skipped. If origin is ADO and upstream is GitHub, it will still proceed (it won’t block on upstream).

@jamesadevine jamesadevine marked this pull request as ready for review May 7, 2026 20:43
@jamesadevine jamesadevine merged commit 0ca3a25 into main May 7, 2026
1 check passed
@jamesadevine jamesadevine deleted the copilot/output-error-message-for-github branch May 7, 2026 20:54
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.

2 participants