From f4e553f2baf41ecf4d87d75899438cd200acd7af Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Wed, 6 Aug 2025 22:28:47 +0000 Subject: [PATCH 1/5] Use the same function to parse services from manifest in VSServer --- cli/azd/internal/vsrpc/utils.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cli/azd/internal/vsrpc/utils.go b/cli/azd/internal/vsrpc/utils.go index 90e2552fea4..18593ee8cd1 100644 --- a/cli/azd/internal/vsrpc/utils.go +++ b/cli/azd/internal/vsrpc/utils.go @@ -38,13 +38,11 @@ func appHostForProject( func servicesFromManifest(manifest *apphost.Manifest) []*Service { var services []*Service - for name, res := range manifest.Resources { - if res.Type == "project.v0" { - services = append(services, &Service{ - Name: name, - Path: *res.Path, - }) - } + for name, path := range apphost.ProjectPaths(manifest) { + services = append(services, &Service{ + Name: name, + Path: path, + }) } return services From 6c537bd3c840f3762cfd24859c9eda543a29008e Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Wed, 6 Aug 2025 22:33:13 +0000 Subject: [PATCH 2/5] test --- cli/azd/internal/vsrpc/utils_test.go | 108 +++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/cli/azd/internal/vsrpc/utils_test.go b/cli/azd/internal/vsrpc/utils_test.go index 4304a5bcf6d..f73754f8e2c 100644 --- a/cli/azd/internal/vsrpc/utils_test.go +++ b/cli/azd/internal/vsrpc/utils_test.go @@ -9,6 +9,8 @@ import ( "path/filepath" "testing" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/azure/azure-dev/cli/azd/pkg/apphost" "github.com/azure/azure-dev/cli/azd/pkg/environment/azdcontext" "github.com/azure/azure-dev/cli/azd/pkg/project" "github.com/stretchr/testify/require" @@ -59,6 +61,112 @@ func Test_azdContext(t *testing.T) { require.Equal(t, filepath.Dir(nearestUnmatched), ctxDir.ProjectDirectory()) } +func Test_servicesFromManifest(t *testing.T) { + tests := []struct { + name string + manifest *apphost.Manifest + expected []*Service + }{ + { + name: "empty manifest", + manifest: &apphost.Manifest{ + Resources: map[string]*apphost.Resource{}, + }, + expected: []*Service{}, + }, + { + name: "manifest with project resources", + manifest: &apphost.Manifest{ + Resources: map[string]*apphost.Resource{ + "webapi": { + Type: "project.v0", + Path: to.Ptr("./src/WebApi/WebApi.csproj"), + }, + "frontend": { + Type: "project.v0", + Path: to.Ptr("./src/Frontend/Frontend.csproj"), + }, + }, + }, + expected: []*Service{ + { + Name: "webapi", + Path: "./src/WebApi/WebApi.csproj", + }, + { + Name: "frontend", + Path: "./src/Frontend/Frontend.csproj", + }, + }, + }, + { + name: "manifest with mixed resource types", + manifest: &apphost.Manifest{ + Resources: map[string]*apphost.Resource{ + "api": { + Type: "project.v0", + Path: to.Ptr("./Api/Api.csproj"), + }, + "database": { + Type: "container.v1", + Image: to.Ptr("postgres:latest"), + }, + "worker": { + Type: "project.v1", + Path: to.Ptr("./Worker/Worker.csproj"), + }, + }, + }, + expected: []*Service{ + { + Name: "api", + Path: "./Api/Api.csproj", + }, + { + Name: "worker", + Path: "./Worker/Worker.csproj", + }, + }, + }, + { + name: "manifest with no project resources", + manifest: &apphost.Manifest{ + Resources: map[string]*apphost.Resource{ + "redis": { + Type: "container.v0", + Image: to.Ptr("redis:latest"), + }, + "postgres": { + Type: "container.v0", + Image: to.Ptr("postgres:latest"), + }, + }, + }, + expected: []*Service{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := servicesFromManifest(tt.manifest) + + require.Len(t, result, len(tt.expected)) + + // Convert to maps for easier comparison since order may vary + resultMap := make(map[string]string) + for _, svc := range result { + resultMap[svc.Name] = svc.Path + } + + expectedMap := make(map[string]string) + for _, svc := range tt.expected { + expectedMap[svc.Name] = svc.Path + } + + require.Equal(t, expectedMap, resultMap) + }) + } +} func createProject(prjDir string, appHostPath string) error { err := os.MkdirAll(prjDir, 0755) if err != nil { From 9474a340b089c222c70b171ff17d5e494ba3b96b Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Wed, 6 Aug 2025 22:42:37 +0000 Subject: [PATCH 3/5] update cl to release --- cli/azd/CHANGELOG.md | 9 +++------ cli/version.txt | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cli/azd/CHANGELOG.md b/cli/azd/CHANGELOG.md index ccca46cff83..5a8f6a420b4 100644 --- a/cli/azd/CHANGELOG.md +++ b/cli/azd/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 1.19.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.18.1 (2025-08-06) ### Bugs Fixed -### Other Changes +- [[5501]](https://github.com/Azure/azure-dev/pull/5501) infra gen when dotnet project is present. +- [[5566]](https://github.com/Azure/azure-dev/pull/5566) [VSServer] Ignoring projects.v1. ## 1.18.0 (2025-07-17) diff --git a/cli/version.txt b/cli/version.txt index 9d908a0acf0..ec6d649be65 100644 --- a/cli/version.txt +++ b/cli/version.txt @@ -1 +1 @@ -1.19.0-beta.1 +1.18.1 From 190fdd4dfd87ef637c4f751d49e11b5d48f43946 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 7 Aug 2025 00:04:38 +0000 Subject: [PATCH 4/5] more cl --- cli/azd/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/azd/CHANGELOG.md b/cli/azd/CHANGELOG.md index 5a8f6a420b4..7a590c7f72f 100644 --- a/cli/azd/CHANGELOG.md +++ b/cli/azd/CHANGELOG.md @@ -6,6 +6,8 @@ - [[5501]](https://github.com/Azure/azure-dev/pull/5501) infra gen when dotnet project is present. - [[5566]](https://github.com/Azure/azure-dev/pull/5566) [VSServer] Ignoring projects.v1. +- [[5518]](https://github.com/Azure/azure-dev/pull/5518) [VSServer] Add suggestion text for resource group and Container App unmarshal errors during azd deploy. +- [[5528]](https://github.com/Azure/azure-dev/pull/5528) Fix login guard to skip interactive prompts in CI/CD environments. ## 1.18.0 (2025-07-17) From 330381823db34de194bf14b54da7e777fdb45646 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 7 Aug 2025 00:06:37 +0000 Subject: [PATCH 5/5] lint --- cli/azd/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/azd/CHANGELOG.md b/cli/azd/CHANGELOG.md index 7a590c7f72f..fc292a48913 100644 --- a/cli/azd/CHANGELOG.md +++ b/cli/azd/CHANGELOG.md @@ -6,7 +6,7 @@ - [[5501]](https://github.com/Azure/azure-dev/pull/5501) infra gen when dotnet project is present. - [[5566]](https://github.com/Azure/azure-dev/pull/5566) [VSServer] Ignoring projects.v1. -- [[5518]](https://github.com/Azure/azure-dev/pull/5518) [VSServer] Add suggestion text for resource group and Container App unmarshal errors during azd deploy. +- [[5518]](https://github.com/Azure/azure-dev/pull/5518) [VSServer] Add suggestion text for resource group and Container App un-marshall errors during azd deploy. - [[5528]](https://github.com/Azure/azure-dev/pull/5528) Fix login guard to skip interactive prompts in CI/CD environments. ## 1.18.0 (2025-07-17)