Skip to content

Commit ca5b16e

Browse files
authored
Merge pull request #300 from azaslonov/fix/identity-prompt-one-value-per-question
fix: ask identity setup values one per question in Copilot prompts
2 parents a5cd31d + 2e4ce00 commit ca5b16e

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎src/templates/copilot/identity-setup-prompt-azure-devops.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ This flow is designed for Microsoft-hosted or self-hosted agents and uses worklo
3535

3636
**Copilot:** Ask the user for the following values before proceeding. Store each answer for use in later steps.
3737

38+
**Ask for one value per question:**
39+
- 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.
40+
- For each environment, first ask whether the user will provide Option A or Option B, then ask for each value of that option individually.
41+
- In each question, state what the value is for (for example, "Resource group of the **prod** APIM instance") and show the example value.
42+
- Accept the plain value as the answer (for example, `rg-apim-prod`, not `APIM_RG_PROD=rg-apim-prod`).
43+
- 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.
44+
3845
For each environment, provide either **Option A** (three separate values) or **Option B** (a single full APIM resource ID in the form `/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ApiManagement/service/<name>`). Copilot will parse Option B into the individual components automatically.
3946

4047
| Variable | Description | Example |

‎src/templates/copilot/identity-setup-prompt-github-actions.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ Once confirmed, proceed to Step 1.
8585
Copilot, please ask the user for the following values before proceeding. Store
8686
each answer for use in later steps.
8787

88+
**Ask for one value per question:**
89+
- 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.
90+
- In each question, state what the value is for (for example, "Resource group of the **prod** APIM instance") and show the example value.
91+
- Accept the plain value as the answer (for example, `rg-apim-prod`, not `APIM_RG_PROD=rg-apim-prod`).
92+
- 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.
93+
8894
| Variable | Description | Example |
8995
|----------|-------------|---------|
9096
{{ENV_SUBSCRIPTION_TABLE_ROWS}}

‎tests/unit/templates/copilot/identity-setup-prompt.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ describe('copilot/identity-setup-prompt', () => {
3535
expect(prompt).toContain('GITHUB_REPO');
3636
});
3737

38+
it('should instruct Copilot to ask for one value per question', () => {
39+
const prompt = generateIdentitySetupPrompt({ environments: ['dev'] });
40+
expect(prompt).toContain('Ask for one value per question');
41+
expect(prompt).toContain('Never combine two or more variables into a single question');
42+
});
43+
3844
it('should include Azure AD app creation commands', () => {
3945
const prompt = generateIdentitySetupPrompt({ environments: ['dev'] });
4046
expect(prompt).toContain('az ad app create');
@@ -247,6 +253,15 @@ describe('copilot/identity-setup-prompt', () => {
247253
expect(prompt).toContain('APIM_NAME_<ENV_UPPER>');
248254
});
249255

256+
it('should instruct Copilot to ask for one value per question in ADO prompt', () => {
257+
const prompt = generateIdentitySetupPrompt({
258+
environments: ['dev', 'prod'],
259+
ciProvider: 'azure-devops',
260+
});
261+
expect(prompt).toContain('Ask for one value per question');
262+
expect(prompt).toContain('Never combine two or more variables into a single question');
263+
});
264+
250265
it('should offer Option B resource ID shorthand per environment in ADO prompt', () => {
251266
const prompt = generateIdentitySetupPrompt({
252267
environments: ['dev', 'prod'],

0 commit comments

Comments
 (0)