Azure / Azure/azure-dev

init with an existing agent manifest doesn't show preview of file collisions

Open
#7,518 0 comments 1 reaction 2 assignees Claimed by @therealjohn View on GitHub
enhancement ext-agents
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

## Goal
Always show a preview of which files have a collision, or if none do, don't show a warning.

## Context
- Developers need a way to see which files have collisions so they can decide to keep or overwrite.
- Developers only need a warning if there are actual file collisions.

## Current Behavior
A warning is shown even when there are no collisions (there are just existing files in the directory).
When there are collisions, they are not listed.

```
v0.1.20-preview
Visit the docs at https://aka.ms/azd-ai-agent-docs

? An existing agent manifest was found at "agent.manifest.yaml". Use it?: Yes
Let's get your project initialized.

Initializing an app to run on Azure (azd init)

WARNING: The current directory is not empty.
Initializing an app in this directory may overwrite existing files.
```

## Desired Behavior
Show the collisions like:

```
WARNING: The current directory is not empty. Initializing an app in this directory may overwrite existing files.

"README.md"
"src/agent.yaml"
```
If there are no collisions, do not show the "WARNING: The current directory is not empty. Initializing an app in this directory may overwrite existing files.".

## Implementation Notes (optional but powerful)
- Format the file paths as relative and make them red to indicate a collision.
- The warning should be formatted like other warning messages and appear yellow.

## Acceptance Criteria
- [ ] Unit tests added or updated
- [ ] Existing test suite passes
- [ ] Lint or format passes
- [ ] Files are listed when there are collisions and the warning appears
- [ ] Files are not listed and no warning when there are no collisions

## How to Test
1. Copy this file into a directory: https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/agent-framework/echo-agent/agent.yaml
2. Then run `azd ai agent init`
3. Select yes to use the existing agent.yaml manifest
4. Complete the init steps

Verify No warnings or collisions.

Repeat step #2 in that same directory again, select yes to use the agent.yaml manifest again.

Verify there is a warning and shows the collisions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.