Skip to content

Conversation

@trangevi
Copy link
Member

In order to support downloading from a public repository without needing to login, we'll attempt a naive download without using the azd logic requiring auth to the gh cli

Copy link
Contributor

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

Adds an unauthenticated-first (“naive”) GitHub manifest download attempt to support public repositories without requiring GitHub CLI authentication.

Changes:

  • Adds a first-pass parseGitHubUrlNaive and attempts download via that parse before falling back to the existing azd-based parsing.
  • Refactors GitHub manifest download flow to support the new naive attempt and fallback behavior.
  • Removes GitHub CLI auth/login prompting from downloadGithubManifest.
Comments suppressed due to low confidence (1)

cli/azd/extensions/azure.ai.agents/internal/cmd/init.go:1383

  • downloadGithubManifest no longer checks gh auth status or prompts a login before calling gh api. There are no other ghCli.Login/GetAuthStatus call sites in this file now, so fetching manifests (and subsequent directory downloads) from private repos will regress and fail unless the user happens to already be logged in. Consider restoring the previous auth-check/login flow (or retrying on 401/403) at least for the non-naive path, so private repos continue to work while still allowing unauthenticated access for public repos.
func downloadGithubManifest(
	ctx context.Context, urlInfo *GitHubUrlInfo, apiPath string, ghCli *github.Cli, console input.Console) (string, error) {
	// This method assumes that either the repo is public, or the user has already been prompted to log in to the github cli
	// through our use of the underlying azd logic.

	content, err := ghCli.ApiCall(ctx, urlInfo.Hostname, apiPath, github.ApiCallOptions{
		Headers: []string{"Accept: application/vnd.github.v3.raw"},
	})
	if err != nil {
		return "", fmt.Errorf("failed to get content: %w", err)
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Jan 28, 2026

@trangevi I've opened a new pull request, #6634, to work on those changes. Once the pull request is ready, I'll request review from you.

Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
…ery params (#6634)

* Initial plan

* Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Final review completed

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unintended changes to other extensions

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Address PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Update download directory as well

Signed-off-by: trangevi <trangevi@microsoft.com>

* Initial plan

* Rebased on latest base branch

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Co-authored-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi merged commit d1042db into main Jan 29, 2026
19 checks passed
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.

4 participants