Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions cli/azd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Comment thread
vhvb1989 marked this conversation as resolved.

## 1.18.0 (2025-07-17)

Expand Down
12 changes: 5 additions & 7 deletions cli/azd/internal/vsrpc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
108 changes: 108 additions & 0 deletions cli/azd/internal/vsrpc/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cli/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.0-beta.1
1.18.1
Loading