Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/templates/copilot/identity-setup-prompt-azure-devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<sub>/resourceGroups/<rg>/providers/Microsoft.ApiManagement/service/<name>`). Copilot will parse Option B into the individual components automatically.

| Variable | Description | Example |
Expand Down
6 changes: 6 additions & 0 deletions src/templates/copilot/identity-setup-prompt-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/templates/copilot/identity-setup-prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -247,6 +253,15 @@ describe('copilot/identity-setup-prompt', () => {
expect(prompt).toContain('APIM_NAME_<ENV_UPPER>');
});

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'],
Expand Down
Loading