[Agents Extension] Adding a new "init from code" flow - #6828
Conversation
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
…ure-dev into trangevi/init-from-code
…6829) * Initial plan * Replace containsString/searchString with strings.Contains in test file Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * Revert unrelated go.mod/go.sum changes Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
…ure-dev into trangevi/init-from-code
…load (#6830) * Initial plan * Use filepath.Clean() for path validation to prevent path traversal attacks Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * Revert unrelated go.mod/go.sum changes Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
* Initial plan * fix: capture error from loadAiCatalog in selectNewModel Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * fix: revert go.mod/go.sum changes and add user-facing error message for loadAiCatalog failure Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * fix: remove fmt.Printf from loadAiCatalog error path Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
spboyer
left a comment
There was a problem hiding this comment.
Three issues found:
-
Hardcoded personal branch in runtime code (High)
init_from_code.go:520 scaffolds from branch trangevi/existing-acr instead of main or a stable tag. If that branch is deleted/renamed/force-pushed, azd init will fail for all users. Use a stable reference. -
Nil pointer panic when ACR selection prompt fails (High)
In the multi-ACR path, if Prompt().Select() returns an error, code logs but continues. selectedConnection remains nil, then selectedConnection.Name/Target are dereferenced unconditionally, causing a panic. Return the prompt error or guard against nil. -
Response bodies deferred inside loop (Medium)
defer fileResp.Body.Close() inside a loop downloading many files. Bodies are not closed until function return, causing excess memory/socket usage. Close each body immediately after reading instead of deferring.
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
…ure-dev into trangevi/init-from-code
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
This will allow for a more basic starting experience. A user won't need to already have an AZD environment/project, won't need to reference a template, and won't need to provide a manifest. Running the base command from where a users code is will walk them through the initial setup of everything they need.