-
Notifications
You must be signed in to change notification settings - Fork 268
Add a naive attempt at downloading manifest #6631
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
Conversation
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
Adds an unauthenticated-first (“naive”) GitHub manifest download attempt to support public repositories without requiring GitHub CLI authentication.
Changes:
- Adds a first-pass
parseGitHubUrlNaiveand 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
downloadGithubManifestno longer checksghauth status or prompts a login before callinggh api. There are no otherghCli.Login/GetAuthStatuscall 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.
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>
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