microsoft / microsoft/kiota

Kiota deletes all but the last plugin in the workspace.json when --refresh is used

Open
#6,033 6 comments 1 reaction 0 assignees View on GitHub
type:bug
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### What are you generating using Kiota, clients or plugins?

Kiota plugin

### In what context or format are you using Kiota?

Windows executable

### Client library/SDK language

None

### Describe the bug

output files are missing after running

`kiota plugin generate --refresh` with multiple plugins in the workspace.json file.

This does not repro without the --refresh flag

### Expected behavior

Expected
six files present after command completes - 3xOpenAPI, 3xplugin manifest

Actual
two files present after command completes - 1xOpenAPI, 1xplugin manifest
These are for the last plugin in the workspace file.

### How to reproduce

workspace.json containing three Copilot plugins, with a shared output directory - this is our Copilot project structure

```
kiota plugin generate --refresh
```

### Open API description file

Not relevant - it's the workspace.json file that is the problem.

### Kiota Version

1.22.3

### Latest Kiota version known to work for scenario above?(Not required)

_No response_

### Known Workarounds

Specify an individual output directory for each plugin. This makes the project more cluttered.

### Configuration

_No response_

### Debug output

Click to expand log
```

```

### Other information

Code inspection shows the folder is being wiped in-between each plugin.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the `kiota plugin generate --refresh` entry point and how it reads `workspace.json`, focusing on the folder cleanup between plugins. Reproduce with three plugins sharing an output directory, then confirm that all six expected OpenAPI and plugin manifest files remain after generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.