Skip to content

Commit 993dd53

Browse files
ayeshurunAlon YeshurunCopilot
authored
docs(agents): fix new-item-type agent to require command_support.yaml review and prohibit VCR cassette creation (#200)
Co-authored-by: Alon Yeshurun <alonyeshurun+microsoft@microsoft.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent c2f4315 commit 993dd53

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

.github/agents/new-item-type.agent.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: New Item Type
33
description: Guide and assist with onboarding a new Microsoft Fabric item type into the Fabric CLI
44
argument-hint: Tell me which Fabric item type you want to add (e.g., "Add support for DataActivator")
5-
tools: ['runInTerminal', 'terminalLastCommand', 'search', 'fetch', 'read_file']
5+
tools: ['runInTerminal', 'terminalLastCommand', 'search', 'fetch', 'read_file']
66
---
77

88
# New Item Type Onboarding Agent
@@ -60,7 +60,7 @@ Use this table to determine which steps apply to the new item type before readin
6060

6161
### Simple Item (no definition, no params)
6262

63-
Only needs Steps 1-3, 9 (add to the standard multi-case match), and 11 (ALL_ITEM_TYPES + basic_item_parametrize).
63+
Only needs Steps 1-3, 9 (add to the standard multi-case match), 10a (review `command_support.yaml` for `unsupported_items`), 11 (ALL_ITEM_TYPES + basic_item_parametrize), 12, and 13.
6464

6565
**Examples:** `Dashboard`, `Datamart`
6666

@@ -72,19 +72,19 @@ Needs Steps 1-4, 9, 10 (export + import + cp + mv), 11 (ALL_ITEM_TYPES + basic_i
7272

7373
### Item with Creation Parameters
7474

75-
Needs Steps 1-3, 7-9, 11 (ALL_ITEM_TYPES but NOT basic_item_parametrize), 12, and 13.
75+
Needs Steps 1-3, 7-9, 10, 11 (ALL_ITEM_TYPES but NOT basic_item_parametrize), 12, and 13.
7676

7777
**Examples:** `Lakehouse` (enableSchemas), `Warehouse` (enableCaseInsensitive), `KQLDatabase` (dbType, eventhouseId)
7878

7979
### Item with OneLake Folders
8080

81-
Needs Steps 1-3, 5, 9, 11, 12, and 13.
81+
Needs Steps 1-3, 5, 9, 10, 11, 12, and 13.
8282

8383
**Examples:** `Lakehouse` (Files, Tables), `Warehouse` (Files, Tables), `KQLDatabase` (Tables, Shortcut)
8484

8585
### Item with Job Support
8686

87-
Needs Steps 1-3, 6, 9, 11, 12, and 13.
87+
Needs Steps 1-3, 6, 9, 10, 11, 12, and 13.
8888

8989
**Examples:** `Notebook` (RunNotebook), `DataPipeline` (Pipeline), `SparkJobDefinition` (sparkjob)
9090

@@ -324,10 +324,28 @@ case ItemType.NEW_ITEM:
324324

325325
This file controls which CLI commands are enabled for each item type. Add the new item type's snake_case name to the appropriate command sections based on the API Support Matrix from the Prerequisites.
326326

327-
**Always add to these sections** (basic item support):
328-
- No changes needed for `ls`, `cd`, `exists`, `get`, `set`, `rm`, `open`, `mkdir` -- these work for all item types via the generic items API.
327+
> **This step applies to ALL item types, not just items with definition support.** Sub-step 10a (`unsupported_items` review) always applies. Sub-steps 10b-10e apply only to items with definition support.
328+
329+
#### 10a. Check `unsupported_items` lists (always)
330+
331+
Review the `unsupported_items` sections for `rm`, `get`, `set`, and `mkdir`. If the new item type does **not** support one of these operations via the Fabric REST API, add it to the relevant `unsupported_items` list. Check existing entries (e.g., `dashboard`, `paginated_report`) for reference.
332+
333+
> **Ask the requestor:** "Can this item type be deleted (rm), read with detailed properties (get), updated (set), and created (mkdir) via the standard items API?" Add the item to `unsupported_items` for any command it does not support.
334+
335+
```yaml
336+
# Example: item cannot be deleted or created via API
337+
rm:
338+
unsupported_items:
339+
# ... existing items ...
340+
- new_item # <-- Add here if rm is NOT supported
341+
mkdir:
342+
unsupported_items:
343+
# ... existing items ...
344+
- new_item # <-- Add here if mkdir is NOT supported
345+
```
346+
347+
#### 10b. Add to `export` (if the item supports `getItemDefinition` API)
329348

330-
**Add to `export` if the item supports `getItemDefinition` API:**
331349
```yaml
332350
commands:
333351
fs:
@@ -338,23 +356,26 @@ commands:
338356
- new_item # <-- Add here, maintain alphabetical order
339357
```
340358

341-
**Add to `import` if the item supports `createItem` with definition:**
359+
#### 10c. Add to `import` (if the item supports `createItem` with definition)
360+
342361
```yaml
343362
import:
344363
supported_items:
345364
# ... existing items ...
346365
- new_item # <-- Add here
347366
```
348367

349-
**Add to `mv` if the item supports all three definition APIs:**
368+
#### 10d. Add to `mv` (if the item supports all three definition APIs)
369+
350370
```yaml
351371
mv:
352372
supported_items:
353373
# ... existing items ...
354374
- new_item # <-- Add here
355375
```
356376

357-
**Add to `cp` if the item supports all three definition APIs:**
377+
#### 10e. Add to `cp` (if the item supports all three definition APIs)
378+
358379
```yaml
359380
cp:
360381
supported_items:
@@ -375,6 +396,8 @@ commands:
375396

376397
Add the new item type to the parametrized test lists so that existing tests automatically cover the new item type.
377398

399+
> **IMPORTANT: Do NOT create VCR cassette recording files.** Only modify the parametrization lists in `conftest.py`. The recording files under `tests/test_commands/recordings/` are generated separately by running the tests against a live environment and should never be hand-crafted or generated by this agent.
400+
378401
#### 11a. Add to `ALL_ITEM_TYPES`
379402

380403
This list drives the comprehensive test suite (cd, ls, exists, rm, get, set, mkdir).
@@ -553,7 +576,7 @@ After completing all applicable steps, run these commands to verify each integra
553576
| 7. Creation params | `grep -n 'ItemType.NEW_ITEM' src/fabric_cli/utils/fab_cmd_mkdir_utils.py \| grep -i param` | Has creation params |
554577
| 8. Creation payload | `grep -n 'ItemType.NEW_ITEM' src/fabric_cli/utils/fab_cmd_mkdir_utils.py \| grep -i payload` | Has creation payload |
555578
| 9. Import payload | `grep -n 'ItemType.NEW_ITEM' src/fabric_cli/core/hiearchy/fab_item.py` | Always |
556-
| 10. Command support | `grep -n 'new_item' src/fabric_cli/core/fab_config/command_support.yaml` | Has definitions |
579+
| 10. Command support | `grep -n 'new_item' src/fabric_cli/core/fab_config/command_support.yaml` | Always (check both supported_items and unsupported_items) |
557580
| 11a. ALL_ITEM_TYPES | `grep -n 'NEW_ITEM' tests/test_commands/conftest.py \| grep -i all_item` | Always |
558581
| 11b. basic_item | `grep -n 'NEW_ITEM' tests/test_commands/conftest.py \| grep -i basic` | Basic items only |
559582
| 11c. mv params | `grep -n 'NEW_ITEM' tests/test_commands/conftest.py \| grep -i mv` | Has mv support |

0 commit comments

Comments
 (0)