From 2e4ce000d2ea7622dfa2b12117197b4e0ec1a365 Mon Sep 17 00:00:00 2001 From: Alexander Zaslonov Date: Fri, 25 Sep 2026 09:10:56 -0700 Subject: [PATCH] fix: ask identity setup values one per question in Copilot prompts The GitHub Actions and Azure DevOps identity setup prompt files now tell Copilot to ask for each variable in its own question instead of bundling several values into one NAME= template, which was unclear to users. --- .../copilot/identity-setup-prompt-azure-devops.md | 7 +++++++ .../identity-setup-prompt-github-actions.md | 6 ++++++ .../copilot/identity-setup-prompt.test.ts | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/templates/copilot/identity-setup-prompt-azure-devops.md b/src/templates/copilot/identity-setup-prompt-azure-devops.md index 82b053db..2c2bad90 100644 --- a/src/templates/copilot/identity-setup-prompt-azure-devops.md +++ b/src/templates/copilot/identity-setup-prompt-azure-devops.md @@ -35,6 +35,13 @@ This flow is designed for Microsoft-hosted or self-hosted agents and uses worklo **Copilot:** Ask the user for the following values before proceeding. Store each answer for use in later steps. +**Ask for one value per question:** +- Ask for each variable in its own separate question. Never combine two or more variables into a single question, and never ask the user to fill in a `NAME=` template. +- For each environment, first ask whether the user will provide Option A or Option B, then ask for each value of that option individually. +- In each question, state what the value is for (for example, "Resource group of the **prod** APIM instance") and show the example value. +- Accept the plain value as the answer (for example, `rg-apim-prod`, not `APIM_RG_PROD=rg-apim-prod`). +- If you can detect a likely value (for example, from `az account show`), offer it as the suggested answer to that single question so the user can accept or change it. + For each environment, provide either **Option A** (three separate values) or **Option B** (a single full APIM resource ID in the form `/subscriptions//resourceGroups//providers/Microsoft.ApiManagement/service/`). Copilot will parse Option B into the individual components automatically. | Variable | Description | Example | diff --git a/src/templates/copilot/identity-setup-prompt-github-actions.md b/src/templates/copilot/identity-setup-prompt-github-actions.md index ba8c363d..01b21ce1 100644 --- a/src/templates/copilot/identity-setup-prompt-github-actions.md +++ b/src/templates/copilot/identity-setup-prompt-github-actions.md @@ -85,6 +85,12 @@ Once confirmed, proceed to Step 1. Copilot, please ask the user for the following values before proceeding. Store each answer for use in later steps. +**Ask for one value per question:** +- Ask for each variable in its own separate question. Never combine two or more variables into a single question, and never ask the user to fill in a `NAME=` template. +- In each question, state what the value is for (for example, "Resource group of the **prod** APIM instance") and show the example value. +- Accept the plain value as the answer (for example, `rg-apim-prod`, not `APIM_RG_PROD=rg-apim-prod`). +- If you can detect a likely value (for example, from `az account show` or `gh repo view`), offer it as the suggested answer to that single question so the user can accept or change it. + | Variable | Description | Example | |----------|-------------|---------| {{ENV_SUBSCRIPTION_TABLE_ROWS}} diff --git a/tests/unit/templates/copilot/identity-setup-prompt.test.ts b/tests/unit/templates/copilot/identity-setup-prompt.test.ts index b778705d..cba516fd 100644 --- a/tests/unit/templates/copilot/identity-setup-prompt.test.ts +++ b/tests/unit/templates/copilot/identity-setup-prompt.test.ts @@ -35,6 +35,12 @@ describe('copilot/identity-setup-prompt', () => { expect(prompt).toContain('GITHUB_REPO'); }); + it('should instruct Copilot to ask for one value per question', () => { + const prompt = generateIdentitySetupPrompt({ environments: ['dev'] }); + expect(prompt).toContain('Ask for one value per question'); + expect(prompt).toContain('Never combine two or more variables into a single question'); + }); + it('should include Azure AD app creation commands', () => { const prompt = generateIdentitySetupPrompt({ environments: ['dev'] }); expect(prompt).toContain('az ad app create'); @@ -247,6 +253,15 @@ describe('copilot/identity-setup-prompt', () => { expect(prompt).toContain('APIM_NAME_'); }); + it('should instruct Copilot to ask for one value per question in ADO prompt', () => { + const prompt = generateIdentitySetupPrompt({ + environments: ['dev', 'prod'], + ciProvider: 'azure-devops', + }); + expect(prompt).toContain('Ask for one value per question'); + expect(prompt).toContain('Never combine two or more variables into a single question'); + }); + it('should offer Option B resource ID shorthand per environment in ADO prompt', () => { const prompt = generateIdentitySetupPrompt({ environments: ['dev', 'prod'],