From e0ba1c5ea8102d399daae1831fac66429dcde4b2 Mon Sep 17 00:00:00 2001 From: michaeldeongreen Date: Sat, 9 May 2026 14:07:29 -0500 Subject: [PATCH 1/2] Swap to feature workspace + chat-driven confirmation in prompt Test of the updated swap-to-feature.prompt.md flow that moves the YES confirmation into the chat UI instead of a live terminal prompt. scripts/workspace_swap.py output for branch swap-file-smoke-test: - New per-branch value set: Patterns_Variables.VariableLibrary/valueSets/ swap-file-smoke-test.json - settings.json valueSetsOrder updated - Patterns_Semantic_Model.SemanticModel: Direct Lake URL repointed to feature workspace + lakehouse - Import_Patterns_Data.Notebook: META block lakehouse dependency repointed to feature workspace + lakehouse .github/prompts/swap-to-feature.prompt.md updated to instruct the agent to ask for confirmation in the chat UI (vscode_askQuestions) and then pipe YES into the script (echo "YES" | python ...) so the terminal never blocks on the script's interactive Confirm: prompt. --- .github/prompts/swap-to-feature.prompt.md | 13 +++++++++++-- .../notebook-content.py | 6 +++--- .../definition/expressions.tmdl | 2 +- .../settings.json | 3 ++- .../valueSets/swap-file-smoke-test.json | 14 ++++++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json diff --git a/.github/prompts/swap-to-feature.prompt.md b/.github/prompts/swap-to-feature.prompt.md index 43a5b01..98f9f88 100644 --- a/.github/prompts/swap-to-feature.prompt.md +++ b/.github/prompts/swap-to-feature.prompt.md @@ -2,6 +2,15 @@ description: Swap the repo's IDs to your feature workspace and create the value set for the current branch. mode: agent --- -Run `python scripts/workspace_swap.py` from the repo root and report the output to me. The script will rewrite tracked Fabric files (semantic model, notebooks) so they point at your feature workspace instead of dev, create a feature value set, and update settings.json. It reads the feature workspace and lakehouse GUIDs from `.env` at the repo root — if `.env` is missing or empty, it will fall back to an interactive prompt. +The script `scripts/workspace_swap.py` rewrites tracked Fabric files (semantic model, notebooks) so they point at your feature workspace instead of dev, creates a feature value set, and updates settings.json. It reads `FEATURE_WORKSPACE_ID` and `FEATURE_LAKEHOUSE_ID` from `.env` at the repo root and asks for a `YES` confirmation before applying. When invoked through this prompt, that confirmation must happen here in chat — never in the terminal — to avoid live-prompt handling problems. -After the script finishes, summarize what changed and remind me to commit and push the changes, then sync the workspace from the Fabric UI. +Follow this exact sequence: + +1. Read `.env` at the repo root and read the dev workspace + lakehouse IDs from `data/fabric/Patterns_Variables.VariableLibrary/variables.json`. +2. Show me the planned swap in chat (current branch, dev → feature workspace ID, dev → feature lakehouse ID). +3. Use the chat UI to ask me a single question with two options: `YES` and `NO` (uppercase, exact). Do not proceed until I answer. +4. If I answer `YES`, run `echo "YES" | python scripts/workspace_swap.py`. The piped `YES` satisfies the script's confirmation gate non-interactively, so the terminal never blocks. Report the full output. +5. If I answer `NO`, do nothing further and confirm in chat that the swap was not applied. +6. After a successful run only, summarize what changed and remind me to commit and push the changes, then sync the workspace from the Fabric UI. + +Do not run the script directly without piping `YES` (it will block on the terminal prompt). Do not skip the chat confirmation — the in-script confirmation is bypassed by the pipe and the chat dialog is the gate. diff --git a/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py b/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py index c102bd8..9197ff1 100644 --- a/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py +++ b/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py @@ -8,12 +8,12 @@ # META }, # META "dependencies": { # META "lakehouse": { -# META "default_lakehouse": "c185283c-9dd9-4e40-a17c-aa6303e3a2e9", +# META "default_lakehouse": "c3d82cf3-d753-4609-910c-35a91a72577d", # META "default_lakehouse_name": "PatternsLakehouse", -# META "default_lakehouse_workspace_id": "d7270f11-feba-4990-baa6-d45e47f23737", +# META "default_lakehouse_workspace_id": "6aca848e-fa1e-4b9c-b30b-d5c9f1668f20", # META "known_lakehouses": [ # META { -# META "id": "c185283c-9dd9-4e40-a17c-aa6303e3a2e9" +# META "id": "c3d82cf3-d753-4609-910c-35a91a72577d" # META } # META ] # META } diff --git a/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl b/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl index 6935a6a..8421a9a 100644 --- a/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl +++ b/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl @@ -1,6 +1,6 @@ expression 'DirectLake - PatternsLakehouse' = let - Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/d7270f11-feba-4990-baa6-d45e47f23737/c185283c-9dd9-4e40-a17c-aa6303e3a2e9", [HierarchicalNavigation=true]) + Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/6aca848e-fa1e-4b9c-b30b-d5c9f1668f20/c3d82cf3-d753-4609-910c-35a91a72577d", [HierarchicalNavigation=true]) in Source lineageTag: 67c45651-79f4-4e05-97d9-0430dcddb756 diff --git a/data/fabric/Patterns_Variables.VariableLibrary/settings.json b/data/fabric/Patterns_Variables.VariableLibrary/settings.json index 77a2163..ac5339f 100644 --- a/data/fabric/Patterns_Variables.VariableLibrary/settings.json +++ b/data/fabric/Patterns_Variables.VariableLibrary/settings.json @@ -2,6 +2,7 @@ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/variableLibrary/definition/settings/1.0.0/schema.json", "valueSetsOrder": [ "Test", - "Prod" + "Prod", + "swap-file-smoke-test" ] } diff --git a/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json b/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json new file mode 100644 index 0000000..88159bd --- /dev/null +++ b/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/variableLibrary/definition/valueSet/1.0.0/schema.json", + "name": "swap-file-smoke-test", + "variableOverrides": [ + { + "name": "target_workspace_id", + "value": "6aca848e-fa1e-4b9c-b30b-d5c9f1668f20" + }, + { + "name": "target_lakehouse_id", + "value": "c3d82cf3-d753-4609-910c-35a91a72577d" + } + ] +} From 30d38bb1c1fe8a6c7d66223962b16d56723c053d Mon Sep 17 00:00:00 2001 From: michaeldeongreen Date: Sat, 9 May 2026 14:10:18 -0500 Subject: [PATCH 2/2] Swap back to dev for PR readiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the swap-file-smoke-test branch to dev IDs ahead of opening the PR to dev. The check-pr-ready CI workflow enforces this — feature IDs in tracked Fabric files would block the merge. Reverted by scripts/workspace_swap.py --swap-to-dev: - Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl (Direct Lake URL: feature → dev) - Import_Patterns_Data.Notebook/notebook-content.py (META block: feature → dev) - Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json (deleted — per-branch value set no longer needed) - Patterns_Variables.VariableLibrary/settings.json (swap-file-smoke-test removed from valueSetsOrder) --- .../notebook-content.py | 6 +++--- .../definition/expressions.tmdl | 2 +- .../settings.json | 3 +-- .../valueSets/swap-file-smoke-test.json | 14 -------------- 4 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json diff --git a/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py b/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py index 9197ff1..c102bd8 100644 --- a/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py +++ b/data/fabric/Import_Patterns_Data.Notebook/notebook-content.py @@ -8,12 +8,12 @@ # META }, # META "dependencies": { # META "lakehouse": { -# META "default_lakehouse": "c3d82cf3-d753-4609-910c-35a91a72577d", +# META "default_lakehouse": "c185283c-9dd9-4e40-a17c-aa6303e3a2e9", # META "default_lakehouse_name": "PatternsLakehouse", -# META "default_lakehouse_workspace_id": "6aca848e-fa1e-4b9c-b30b-d5c9f1668f20", +# META "default_lakehouse_workspace_id": "d7270f11-feba-4990-baa6-d45e47f23737", # META "known_lakehouses": [ # META { -# META "id": "c3d82cf3-d753-4609-910c-35a91a72577d" +# META "id": "c185283c-9dd9-4e40-a17c-aa6303e3a2e9" # META } # META ] # META } diff --git a/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl b/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl index 8421a9a..6935a6a 100644 --- a/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl +++ b/data/fabric/Patterns_Semantic_Model.SemanticModel/definition/expressions.tmdl @@ -1,6 +1,6 @@ expression 'DirectLake - PatternsLakehouse' = let - Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/6aca848e-fa1e-4b9c-b30b-d5c9f1668f20/c3d82cf3-d753-4609-910c-35a91a72577d", [HierarchicalNavigation=true]) + Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/d7270f11-feba-4990-baa6-d45e47f23737/c185283c-9dd9-4e40-a17c-aa6303e3a2e9", [HierarchicalNavigation=true]) in Source lineageTag: 67c45651-79f4-4e05-97d9-0430dcddb756 diff --git a/data/fabric/Patterns_Variables.VariableLibrary/settings.json b/data/fabric/Patterns_Variables.VariableLibrary/settings.json index ac5339f..77a2163 100644 --- a/data/fabric/Patterns_Variables.VariableLibrary/settings.json +++ b/data/fabric/Patterns_Variables.VariableLibrary/settings.json @@ -2,7 +2,6 @@ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/variableLibrary/definition/settings/1.0.0/schema.json", "valueSetsOrder": [ "Test", - "Prod", - "swap-file-smoke-test" + "Prod" ] } diff --git a/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json b/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json deleted file mode 100644 index 88159bd..0000000 --- a/data/fabric/Patterns_Variables.VariableLibrary/valueSets/swap-file-smoke-test.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/variableLibrary/definition/valueSet/1.0.0/schema.json", - "name": "swap-file-smoke-test", - "variableOverrides": [ - { - "name": "target_workspace_id", - "value": "6aca848e-fa1e-4b9c-b30b-d5c9f1668f20" - }, - { - "name": "target_lakehouse_id", - "value": "c3d82cf3-d753-4609-910c-35a91a72577d" - } - ] -}