Skip to content

Run pre-install bootstrap steps before engine selection in add-wizard#48301

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-with-copilot
Jul 27, 2026
Merged

Run pre-install bootstrap steps before engine selection in add-wizard#48301
pelikhan merged 3 commits into
mainfrom
copilot/fix-with-copilot

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

TestTuistoryAddWizardManifestBootstrapRunsBeforeEngineSelection was failing because the orchestrator ran all bootstrap config steps post-install, but repo-variable/repo-secret manifest steps should prompt the user before engine selection.

Changes

  • bootstrap_config.go: Add isPreInstallBootstrapType (repo-variable, repo-secret) and splitBootstrapProfile which partitions a resolved bootstrap profile into pre/post-install parts.
  • add_interactive_orchestrator.go: Replace the single-phase approach with a split — pre-install steps run in a new Step 5b (after permission checks, before engine selection); post-install steps (handoff, github-app, copilot-auth, etc.) remain in Step 9b after the PR is created.
  • bootstrap_profile_runner_test.go: Add TestSplitBootstrapProfile covering nil/empty/pre-only/post-only/mixed configurations; clarify TestPrintBootstrapConfigTODO_PreservesManifestOrder scope (that test guards the non-interactive add path, not add-wizard).

The flow now matches the declared manifest ordering within each phase: pre-install variable/secret collection happens up front, post-install side effects happen after installation.

Run repo-variable and repo-secret bootstrap steps before engine
selection so required configuration is collected up front, matching
what TestTuistoryAddWizardManifestBootstrapRunsBeforeEngineSelection expects.

- Add isPreInstallBootstrapType helper (repo-variable, repo-secret)
- Add splitBootstrapProfile to partition config into pre/post phases
- Execute pre-install steps (Step 5b) before selectAIEngineAndKey
- Add TestSplitBootstrapProfile unit tests

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues identified in Copilot session Run pre-install bootstrap steps before engine selection in add-wizard Jul 27, 2026
Copilot AI requested a review from pelikhan July 27, 2026 06:55
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot Fix test, current behavior is correct

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category bug
Risk 🟡 medium
Priority Score 48 / 100
Recommended Action ⚡ fast_track (pending undraft + CI)
CI Status 🟡 in-progress (copilot check only)
Note DRAFT

Score breakdown: Impact 24/50 · Urgency 12/30 · Quality 12/20

Rationale: Bootstrap steps (repo-variable/repo-secret manifest steps) run post-install instead of pre-engine-selection in add-wizard. Fix is small (169+/6−, 3 files). Currently a draft with only the Copilot review check running. Needs undraft + full CI before merge.

Run §30246015734

Generated by 🔧 PR Triage Agent · sonnet46 · 36.5 AIC · ⌖ 5.31 AIC · ⊞ 5.7K ·

The current behavior (all bootstrap steps post-install) is correct.
Rewrite the test to verify that the engine selection prompt appears
first, and the bootstrap variable prompt has not yet appeared at
that point.

- Rename TestTuistoryAddWizardManifestBootstrapRunsBeforeEngineSelection
  → TestTuistoryAddWizardManifestBootstrapRunsAfterEngineSelection
- Wait for engine selection prompt first; assert bootstrap prompt
  has not appeared yet
- Revert orchestrator and bootstrap_config.go to single-phase
  post-install behavior
- Revert TestSplitBootstrapProfile and related test changes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix test, current behavior is correct

Done. Reverted the orchestrator changes and fixed the test instead — it now waits for the engine selection prompt first, then asserts the bootstrap variable prompt has not appeared yet (since it runs post-install). Renamed to TestTuistoryAddWizardManifestBootstrapRunsAfterEngineSelection to reflect the correct behavior (commit e7c78c9).

@pelikhan
pelikhan marked this pull request as ready for review July 27, 2026 07:39
Copilot AI review requested due to automatic review settings July 27, 2026 07:39
@pelikhan
pelikhan merged commit fd94a39 into main Jul 27, 2026
@pelikhan
pelikhan deleted the copilot/fix-with-copilot branch July 27, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Intended to move variable/secret bootstrap prompts before engine selection, but the diff instead updates the integration test to accept the existing post-selection behavior.

Changes:

  • Renames the bootstrap-ordering integration test.
  • Reverses its assertions to require engine selection first.
  • Removes validation that handoff steps remain deferred.
Show a summary per file
File Description
pkg/cli/add_wizard_tuistory_integration_test.go Changes bootstrap prompt ordering expectations.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

assert.Less(t, earlyPromptIndex, enginePromptIndex, "Pre-install bootstrap prompt should appear before engine selection")
beforeInterruptOutput := session.readAll()
assert.Contains(t, beforeInterruptOutput, enginePrompt, "Expected engine selection prompt to be shown")
assert.NotContains(t, beforeInterruptOutput, bootstrapPrompt, "Bootstrap variable prompt should not appear before engine selection")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants