fix: switch to foundry backend urls - #9334
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Switches the RLE extension to authenticated, project-relative Foundry APIs.
Changes:
- Adds Foundry authentication, API versioning, and new environment/sandbox routes.
- Adds disk-image conversion polling and updates invocation behavior.
- Bumps the preview version and refreshes documentation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
version.txt |
Bumps version to 0.2.0-preview. |
README.md |
Documents Foundry setup and workflows. |
internal/project/docker.go |
Clarifies ACR login guidance. |
internal/cmd/invoke.go |
Updates sandbox lifecycle and polling. |
internal/cmd/invoke_test.go |
Tests new invocation routes. |
internal/cmd/deploy.go |
Deploys through the Foundry endpoint. |
internal/cmd/client.go |
Adds authenticated Foundry API client. |
internal/cmd/client_test.go |
Tests authentication and endpoints. |
go.mod |
Promotes Azure identity dependencies. |
extension.yaml |
Updates extension version. |
CHANGELOG.md |
Adds 0.2.0-preview notes. |
Comments suppressed due to low confidence (1)
cli/azd/extensions/azure.ai.rle/internal/cmd/client_test.go:80
- azd-code-reviewer: Use
t.Context()for test I/O so the request is canceled if the test ends, as required by the repository's Go 1.26 test pattern (cli/azd/AGENTS.md:356).
err := client.do(context.Background(), http.MethodGet, environmentCollectionPath, nil, nil)
Validate persisted Foundry endpoints before creating credentials and cover the full project-relative route shape in invoke tests. Correct the release heading, prerequisites, and test contexts. Authored-by: GitHub Copilot CLI v1.0.68 Model: GPT-5.4 (gpt-5.4) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (5)
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:228
- azd-code-reviewer:
GetTokenfailures are local authentication failures, but both callers wrap this error withserviceError, labeling itrle-control-planeand suggesting that the endpoint is unreachable. A signed-out user therefore gets the wrong remediation. Return a distinct local authentication error withaz login/azd auth loginguidance before the generic service-error path;azdext.ServiceErroris reserved for HTTP/gRPC service failures (cli/azd/pkg/azdext/extension_error.go:15-16).
token, err := c.credential.GetToken(ctx, policy.TokenRequestOptions{
Scopes: []string{foundryTokenScope},
})
if err != nil {
return fmt.Errorf("authenticate to Foundry: %w", err)
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:98
- azd-code-reviewer: Removing the playground URL makes the browser-launch warning below non-actionable: on headless or SSH systems, users can no longer open the UI manually. Keep the raw sandbox URL hidden, but provide a safe fallback such as a localhost proxy URL or an actionable command when
OpenBrowserfails.
"Sandbox %s ready\n",
sandbox.Id,
cli/azd/extensions/azure.ai.rle/internal/cmd/deploy.go:116
- azd-code-reviewer: Both branches call the same API, so this condition implies create/update behavior that does not exist and can drift later. Collapse it to one call.
if state.EnvironmentId == "" {
environment, err = client.createV1Environment(a.cmd.Context(), request)
} else {
environment, err = client.createV1Environment(a.cmd.Context(), request)
}
cli/azd/extensions/azure.ai.rle/README.md:159
- The code now intentionally falls back to the project endpoint saved in
.azd-rle.jsonwhenFOUNDRY_PROJECT_ENDPOINTis unset, but this says deploy always reads the environment variable. Document the fallback and precedence so users know which Foundry project will receive the deployment.
Deploy reads the Foundry project endpoint from `FOUNDRY_PROJECT_ENDPOINT` and the ACR registry from `AZURE_CONTAINER_REGISTRY_ENDPOINT`. It derives the project route segment from `/api/projects/<project>`, builds the Docker image as `<registry>.azurecr.io/<project>-<environment>:latest`, pushes it to ACR, registers that image by calling `<FOUNDRY_PROJECT_ENDPOINT>/fine_tuning/environments`, and saves the project/environment details in `.azd-rle.json`.
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:88
- This remediation assumes the endpoint came from
FOUNDRY_PROJECT_ENDPOINT, but deploy can now use the value saved in.azd-rle.json. Refer to the configured endpoint generically and explain that the environment variable overrides it; otherwise the message points users at an unset variable.
This issue also appears on line 224 of the same file.
Suggestion: fmt.Sprintf(
"Ensure the Foundry project endpoint in %s is reachable and enabled for RLE.",
foundryProjectEndpointEnvVar,
),
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (5)
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:95
normalizeFoundryProjectEndpointcurrently accepts paths with extra segments after/api/projects/<project>. That was mostly harmless when only the project segment was extracted, but this client now uses the whole normalized value as its base URL, so an endpoint such as.../api/projects/p/extrasends every request under/extra/fine_tuning/...and fails with a service error instead of being rejected. Require the project endpoint path to end after the project segment before using it as the base URL.
func newRleClient(endpoint string) (*rleClient, error) {
normalizedEndpoint, err := normalizeFoundryProjectEndpoint(endpoint)
if err != nil {
return nil, err
cli/azd/extensions/azure.ai.rle/internal/cmd/run.go:194
- Removing the runtime override disables
/webfor valid OpenEnv images whose Dockerfile defaultsENABLE_WEB_INTERFACE=false(for example, upstreamgrid_world_envanddipg_safety_env).runstill always opens and documents/web, so those environments now launch a missing playground. Keep passingENABLE_WEB_INTERFACE=trueto preserve the command's behavior.
"-p", portMapping,
image,
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:228
- A token acquisition failure is returned as an ordinary client error, so both
deployandinvokewrap it withserviceError. This reportsrle-control-planeas the failing service and suggests checking the endpoint even though no request was sent; users who need to sign in or select a credential get misleading recovery guidance. Preserve a distinct auth/local error here and avoid wrapping it as a service response.
token, err := c.credential.GetToken(ctx, policy.TokenRequestOptions{
Scopes: []string{foundryTokenScope},
})
if err != nil {
return fmt.Errorf("authenticate to Foundry: %w", err)
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:98
- The sandbox URL is hidden on the success path, but it is still exposed on failures.
project.WaitForHealthincludesbaseUrlin its timeout error, andRunShellWithContextincludes the full request URL on transport errors, soinvokecan print the data-plane URL whenever health or a shell request fails. Redact or replace those errors on the remote path to satisfy the stated URL-hiding behavior.
sandboxUrl := strings.TrimRight(sandbox.BaseUrl, "/")
if _, err := fmt.Fprintf(
a.cmd.OutOrStdout(),
"Sandbox %s ready\n",
sandbox.Id,
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:178
- The new 15-minute polling loop aborts on the first transient GET failure. Because this client has no Azure SDK retry policy, a temporary network error, 429, or 5xx during image conversion ends
invokeeven though conversion may still be progressing. Retry transient failures within the existing deadline (while still returning permanent 4xx responses) so the asynchronous wait is resilient.
deadline := time.Now().Add(remoteImageConversionTimeout)
for {
environment, err := client.getEnvironmentVersion(ctx, state.Name, state.EnvironmentVersion)
if err != nil {
return err
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Incremental pass over c9c140d..f44cb3d. The five items from my earlier review are all handled: the create/update branch is collapsed to a single call, state.Name is written back from the service response so waitForEnvironmentImage polls the authoritative name, environment list paging is capped and covered by a test, the unused flags parameter is gone from both helpers, and the 0.2.0-preview changelog heading carries a date.
Locally go build, go vet, gofmt and go test ./internal/... are clean, and golangci-lint is green in CI.
One low-priority note inline on the new paging guard.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.
Suppressed comments (14)
cli/azd/extensions/azure.ai.rle/internal/cmd/publish.go:107
- [azd-code-reviewer] Local state only indicates whether this folder was previously published; it does not determine whether the unconditional POST creates or updates the environment, especially after changing
FOUNDRY_PROJECT_ENDPOINT. This can print “Updating/Updated” for a newly created remote environment or “Created” for an existing one. Use a neutral “Publishing/Published” label or derive the result from the service response.
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:124 - [azd-code-reviewer] Use the repository's Go 1.26
errors.AsTypepattern here;errors.Asis explicitly disallowed bycli/azd/AGENTS.md:332-348and will be rewritten by the enforced modernization checks.
var localErr *azdext.LocalError
if !errors.As(stateErr, &localErr) || localErr.Code != "rle_project_not_initialized" {
cli/azd/extensions/azure.ai.rle/internal/cmd/publish.go:75
- [azd-code-reviewer] This added line exceeds the repository's 125-character Go limit and will fail the
lllcheck (cli/azd/AGENTS.md:97-108).
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:274 - [azd-code-reviewer] This added test line exceeds the repository's 125-character Go limit and will fail the
lllcheck (cli/azd/AGENTS.md:97-108).
case r.Method == http.MethodGet && r.URL.Path == testFoundryProjectPath+environmentCollectionPath+"/echo_env/versions/1.0.0":
cli/azd/extensions/azure.ai.rle/version.txt:1
- [azd-code-reviewer] The PR description says this release is
0.2.1-preview, but the release files use0.3.0-preview. Please align the intended version across the description and release metadata before publishing.
0.3.0-preview
cli/azd/extensions/azure.ai.rle/internal/cmd/show.go:1
- [azd-code-reviewer] This new Go file is missing the required Microsoft copyright header, so the repository copyright check will fail. See
cli/azd/AGENTS.md:101.
package cmd
cli/azd/extensions/azure.ai.rle/internal/cmd/environment_lookup.go:1
- [azd-code-reviewer] This new Go file is missing the required Microsoft copyright header, so the repository copyright check will fail. See
cli/azd/AGENTS.md:101.
package cmd
cli/azd/extensions/azure.ai.rle/internal/cmd/run.go:193
- [azd-code-reviewer] Removing
ENABLE_WEB_INTERFACE=trueregressesrunfor custom OpenEnv images where the web UI defaults to disabled: the command still opens/web, which will return 404. Keep enabling the UI at runtime so the documented playground behavior works for existing-source and custom-Dockerfile flows.
"-p", portMapping,
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:110
- [azd-code-reviewer] The sandbox URL is no longer printed on success, but it still reaches terminal output on failures:
project.WaitForHealthincludesbaseUrlin its returned error, and the runtime shell prints request errors containing the full URL. Sanitize those error paths as well to satisfy the requirement that sandbox data-plane URLs remain hidden.
sandboxUrl := strings.TrimRight(sandbox.BaseUrl, "/")
cli/azd/extensions/azure.ai.rle/internal/cmd/client_test.go:100
- [azd-code-reviewer] Use
errors.AsTypehere to follow the repository's enforced Go 1.26 modernization rule (cli/azd/AGENTS.md:332-348).
var serviceErr *azdext.ServiceError
if !errors.As(err, &serviceErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke_test.go:298
- [azd-code-reviewer] Use
errors.AsTypehere to follow the repository's enforced Go 1.26 modernization rule (cli/azd/AGENTS.md:332-348).
var localErr *azdext.LocalError
if !errors.As(err, &localErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:106
- [azd-code-reviewer] This added line exceeds the repository's 125-character Go limit and will fail the
lllcheck (cli/azd/AGENTS.md:97-108).
This issue also appears on line 123 of the same file.
return nil, fmt.Errorf("environment list exceeded the %d-item safety limit", environmentListPageSize*environmentListMaxPages)
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:259
- [azd-code-reviewer] This added test line exceeds the repository's 125-character Go limit and will fail the
lllcheck (cli/azd/AGENTS.md:97-108).
This issue also appears on line 274 of the same file.
case r.Method == http.MethodGet && r.URL.Path == testFoundryProjectPath+environmentCollectionPath+"/echo_env/versions/1.2.0":
cli/azd/extensions/azure.ai.rle/internal/cmd/show.go:68
- [azd-code-reviewer] The new
show --output jsoncontract is not exercised; the only show test uses default table output. Add a JSON test that unmarshalsshowResultand verifies both the selectedenvironmentandversionsfields so this machine-readable shape cannot regress unnoticed.
if output.IsJSON() {
return output.JSON(result)
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Re-reviewed after fix: command updates. The new show command and the named invoke path read well and the tests cover the new branches. Three things in the new code:
show.go:111doesn't guard an emptyEnvironmentVersioncoming from local stateinvoke.go:172andinvoke.go:189skipserviceError, soinvoke <name>reports service failures differently thanlistandshowdoshow.go:71is unreachable
Two things outside the code:
PR Governance / Check linked issueis failing. The PR needs a linked issue before it can merge.- The automated reviewer collapsed 14 suppressed comments in its latest pass. Two are worth acting on:
show.goandenvironment_lookup.goare missing the Microsoft copyright header that every other file ininternal/cmdcarries, and the PR description still says0.2.1-previewwhileversion.txtandextension.yamlnow say0.3.0-preview.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.
Suppressed comments (12)
cli/azd/extensions/azure.ai.rle/internal/cmd/publish.go:75
- This added line exceeds the repository's 125-character Go limit and will fail the enabled
lllcheck (cli/azd/AGENTS.md:97-108). Split the suggestion across lines.
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:305 - This added line exceeds the repository's 125-character Go limit and will fail the enabled
lllcheck (cli/azd/AGENTS.md:97-108). Break the condition before the path comparison.
case r.Method == http.MethodGet && r.URL.Path == testFoundryProjectPath+environmentCollectionPath+"/echo_env/versions/1.0.0":
cli/azd/extensions/azure.ai.rle/internal/cmd/run.go:193
- Removing this override disables
/webfor OpenEnv images that leave the web interface at its default or explicitly disable it, whilerunstill unconditionally opensbaseUrl + "/web". RestoreENABLE_WEB_INTERFACE=trueso the documented playground behavior remains reliable.
"-p", portMapping,
cli/azd/extensions/azure.ai.rle/version.txt:1
- The PR description says this release updates the extension to
0.2.1-preview, but the version file, manifest, and changelog all use0.3.0-preview. Align the description or release artifacts so the intended release version is unambiguous.
0.3.0-preview
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:110
- The data-plane URL is still exposed on error paths.
project.WaitForHealthincludesbaseUrlin its returned message (internal/project/runtime.go:145), and shell transport failures print the full request URL (runtime.go:177), so an unhealthy or unreachable sandbox contradicts the PR's promise to keep these URLs out of terminal output. Add a remote-safe/redacted error path before passing this value to shared runtime helpers.
sandboxUrl := strings.TrimRight(sandbox.BaseUrl, "/")
cli/azd/extensions/azure.ai.rle/internal/cmd/show.go:1
- This new Go source file is missing the required Microsoft copyright header. The repository copyright check requires the header on every Go file (
cli/azd/AGENTS.md:101).
package cmd
cli/azd/extensions/azure.ai.rle/internal/cmd/environment_lookup.go:1
- This new Go source file is missing the required Microsoft copyright header. The repository copyright check requires the header on every Go file (
cli/azd/AGENTS.md:101).
package cmd
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:128
- Use
errors.AsTypehere. This module targets Go 1.26, and the repository requires the modern typed error-matching pattern;go fixenforcement will otherwise rewrite this (cli/azd/AGENTS.md:332-358).
var localErr *azdext.LocalError
if !errors.As(stateErr, &localErr) || localErr.Code != "rle_project_not_initialized" {
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:261
- Use
errors.AsTypehere. This module targets Go 1.26, and the repository requires the modern typed error-matching pattern;go fixenforcement will otherwise rewrite this (cli/azd/AGENTS.md:332-358).
var serviceErr *azdext.ServiceError
if !errors.As(err, &serviceErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke_test.go:363
- Use
errors.AsTypehere. This module targets Go 1.26, and the repository requires the modern typed error-matching pattern;go fixenforcement will otherwise rewrite this (cli/azd/AGENTS.md:332-358).
var localErr *azdext.LocalError
if !errors.As(err, &localErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:107
- This added line exceeds the repository's 125-character Go limit and will fail the enabled
lllcheck (cli/azd/AGENTS.md:97-108). Split the formatted message across lines.
Message: fmt.Sprintf("Environment list exceeded the %d-item safety limit.", environmentListPageSize*environmentListMaxPages),
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:290
- This added line exceeds the repository's 125-character Go limit and will fail the enabled
lllcheck (cli/azd/AGENTS.md:97-108). Break the condition before the path comparison.
This issue also appears on line 305 of the same file.
case r.Method == http.MethodGet && r.URL.Path == testFoundryProjectPath+environmentCollectionPath+"/echo_env/versions/1.2.0":
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Suppressed comments (8)
cli/azd/extensions/azure.ai.rle/internal/cmd/run.go:193
- azd-code-reviewer: Removing
ENABLE_WEB_INTERFACE=truebreaks the documented local playground. The upstreamhuggingface/OpenEnvREADME says the web UI is disabled by default and must be enabled with this variable, whilerunstill opens/web. Restore the environment argument (or add the same proxy fallback used by remote invoke).
"-p", portMapping,
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:110
- azd-code-reviewer: The sandbox URL is still exposed on failure, contrary to the PR's requirement to keep data-plane URLs hidden.
project.WaitForHealthincludesbaseUrlin its error atinternal/project/runtime.go:145, and shell transport failures include the full URL at line 177. Add a redacted remote-runtime error path so these errors never reach terminal output with the sandbox URL.
sandboxUrl := strings.TrimRight(sandbox.BaseUrl, "/")
cli/azd/extensions/azure.ai.rle/version.txt:1
- azd-code-reviewer: The PR description says this release is
0.2.1-preview, butversion.txt,extension.yaml, andCHANGELOG.mdall set0.3.0-preview. Align the release metadata with the intended version or update the PR description before publishing.
0.3.0-preview
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:130
- azd-code-reviewer: This uses the legacy
errors.Aspattern. The repository targets Go 1.26 and requireserrors.AsType(cli/azd/AGENTS.md:332-348); update this so the enforced modernization check remains clean.
if !errors.As(stateErr, &localErr) || localErr.Code != "rle_project_not_initialized" {
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:263
- azd-code-reviewer: New tests must also use the repository's Go 1.26
errors.AsTypepattern (cli/azd/AGENTS.md:332-348) sogo fix ./...does not rewrite this change.
if !errors.As(err, &serviceErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke_test.go:365
- azd-code-reviewer: New tests must use the repository's Go 1.26
errors.AsTypepattern (cli/azd/AGENTS.md:332-348) sogo fix ./...does not rewrite this change.
if !errors.As(err, &localErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:273
- azd-code-reviewer: Token acquisition happens locally before any Foundry request, but every API caller later wraps this error with
serviceError, attributing it torle-control-planeand suggesting endpoint reachability. Return a local authentication error withaz login/azd auth loginguidance and preserve it inserviceError;cli/azd/AGENTS.md:203explicitly forbids external-service attribution for locally generated failures.
return fmt.Errorf("authenticate to Foundry: %w", err)
cli/azd/extensions/azure.ai.rle/internal/cmd/show.go:68
- azd-code-reviewer: The new
show --output jsoncontract is not tested; both show command tests exercise only the default table. Add a test that unmarshalsshowResultand asserts theenvironmentandversionsfields so this scripting API cannot drift unnoticed.
if output.IsJSON() {
return output.JSON(result)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.
Suppressed comments (8)
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:128
- Use
errors.AsTypehere. The Go 1.26 convention incli/azd/AGENTS.md:332-348requires it instead oferrors.As, and the repository'sgo fixcheck enforces these modernizations. (azd-code-reviewer)
if !errors.As(stateErr, &localErr) || localErr.Code != "rle_project_not_initialized" {
cli/azd/extensions/azure.ai.rle/internal/cmd/publish.go:104
- This versioned request still references the mutable
:latestimage produced byresolvePublishImage. Because disk-image conversion is asynchronous, a second publish can overwrite that tag before an earlier version pulls it, causing distinct environment versions to capture the same or wrong image. Push an immutable digest or unique tag and send that reference in the request. (azd-code-reviewer)
cli/azd/extensions/azure.ai.rle/version.txt:1 - The PR description says this release is
0.2.1-preview, butversion.txt,extension.yaml, andCHANGELOG.mdall use0.3.0-preview. Update the PR description or align the committed version so release intent is unambiguous. (azd-code-reviewer)
0.3.0-preview
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go:110
- The sandbox URL is still exposed on failure paths:
project.WaitForHealthincludesbaseUrlin its error (runtime.go:145), and shell transport errors include the full request URL (runtime.go:177) before printing it. Sanitize these remote errors or add a remote mode that suppresses endpoint values so the data-plane URL remains hidden consistently. (azd-code-reviewer)
sandboxUrl := strings.TrimRight(sandbox.BaseUrl, "/")
cli/azd/extensions/azure.ai.rle/internal/cmd/client.go:273
- Token acquisition fails before the RLE service is called, but callers wrap this error with
serviceError, attributing it torle-control-planeand suggesting endpoint configuration. That misdirects users who need to sign in and conflicts with the local-error attribution rule incli/azd/AGENTS.md:203. Preserve a typed local authentication error with anaz login/azd auth loginsuggestion instead. (azd-code-reviewer)
return fmt.Errorf("authenticate to Foundry: %w", err)
cli/azd/extensions/azure.ai.rle/internal/cmd/list_test.go:263
- Use
errors.AsTypehere. The Go 1.26 convention incli/azd/AGENTS.md:332-348requires it instead oferrors.As, and the repository'sgo fixcheck enforces these modernizations. (azd-code-reviewer)
if !errors.As(err, &serviceErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/invoke_test.go:365
- Use
errors.AsTypehere. The Go 1.26 convention incli/azd/AGENTS.md:332-348requires it instead oferrors.As, and the repository'sgo fixcheck enforces these modernizations. (azd-code-reviewer)
if !errors.As(err, &localErr) {
cli/azd/extensions/azure.ai.rle/internal/cmd/list.go:94
- An empty project returns a nil slice here, so
azd ai rle list --output jsonserializes asnullrather than the expected list value[]. Initialize the accumulator as an empty non-nil slice, and add the empty-JSON case to the existing output test. (azd-code-reviewer)
This issue also appears on line 128 of the same file.
var environments []environmentResource
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Incremental pass over 9925401..3f1dea7. Two things in the new code:
show.go:99the no-name path takes the environment name from.azd-rle.jsonbut resolves the project endpoint env-var-first, so the two halves can point at different projects.list_test.go:261useserrors.Aswhere the rest of the file useserrors.AsType.
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Re-approving on 3f1dea7 after a full pass over the Foundry endpoint switch. My earlier approval was against f44cb3d, so this refreshes it onto the current head.
Two items from my last pass are still open. Neither blocks merge:
show.goresolveTargetreads the environment name from.azd-rle.json, but resolves the project endpoint env-var-first throughresolveEnvironmentListProjectEndpoint. A staleFOUNDRY_PROJECT_ENDPOINTpoints the two halves at different projects. When the name came from saved state, reading the endpoint from that same state first would keep them consistent.- A few
errors.Ascalls remain inlist.goand the new tests where the surrounding code useserrors.AsType.
Travis Angevine (trangevi)
left a comment
There was a problem hiding this comment.
Approved, pending Jon's comments
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
Changes: