Skip to content

feat(installer): add resumable post-setup configuration - #271

Open
weastler wants to merge 4 commits into
weastler/stack-5-terminal-handofffrom
weastler/stack-6-post-setup
Open

weastler wants to merge 4 commits into
weastler/stack-5-terminal-handofffrom
weastler/stack-6-post-setup

Conversation

@weastler

Copy link
Copy Markdown
Contributor

Why

Several settings can be configured only after Hub is deployed. Configuring them by hand is error-prone, and an interruption can lose the operator's progress.

This is layer 6, the top of a six-layer stack on build/hub/new at 1f5b485e. It is based on layer 5, terminal handoff.

What changes

A new setup:post command finishes configuration after deployment. It saves progress so an operator can resume, keeps entered input after a recoverable error, and checkpoints to Key Vault. Revisions must be consecutive, and the cleanup signal is preserved when an update is interrupted. The prompt and progress validators use layer 4's shared origin parser, so post-setup accepts the same canonical origins as the installer. This layer also updates the related docs and package.json scripts.

The infrastructure typecheck and full suite pass (1,087 tests), and the Terraform checks match layer 4. setup:post has not been run against a live Hub, Key Vault or GitHub App.

@weastler
weastler requested review from a team and nshki as code owners November 17, 2026 01:15
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 01:15

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.

🟡 Changes recommended

Provider-revision errors can prevent Hub startup or fail to invalidate in-flight authentication after credential rotation, while stale trusted-proxy settings can weaken authentication rate limits.

11 open issues
What changed in this PR

Adds a resumable Azure installer workflow so operators can finish configuring an already deployed Hub without rebuilding its image or rerunning database setup.

Changes:

  • Adds post-setup actions for sign-in/setup access, GitHub App configuration, and restarting Hub.
  • Saves validated answers and secret references, with recovery journals, leases, and scoped Terraform checks.
  • Adds command routing, regression coverage, and operator documentation.

Live Hub, Key Vault, and GitHub App validation remains outstanding.

File Description
package.json Adds the root setup:post command.
infrastructure/​vitest.config.ts Includes post-setup tests.
infrastructure/​tsconfig.json Includes post-setup TypeScript source.
infrastructure/​README.md Documents configuration, restart, and recovery workflows.
infrastructure/​installer/​types.ts Defines supported post-setup actions.
infrastructure/​installer/​index.tsx Routes post-setup commands and handles cancellation.
infrastructure/​installer/​entry/​index.ts Adds the post-setup menu and installation selection.
infrastructure/​installer/​entry/​index.test.ts Covers selection, exit, and unfinished-operation guards.
infrastructure/​installer/​command/​describe/​index.ts Adds safe labels for new Azure operations.
infrastructure/​installer/​command/​default-signal/​index.ts Preserves caller-supplied cleanup signals.
infrastructure/​installer/​command/​default-signal/​index.test.ts Covers default and cleanup signal behavior.
infrastructure/​docs/​terminal-design.md Defines prompt persistence and recovery-feedback behavior.
infrastructure/​azure/​post/​verify/​index.ts Checks readiness, protected setup, and GitHub availability.
infrastructure/​azure/​post/​verify/​index.test.ts Covers setup-access and provider checks.
infrastructure/​azure/​post/​validate-plan/​index.ts Restricts Terraform changes to the approved scope.
infrastructure/​azure/​post/​validate-plan/​index.test.ts Covers allowed updates and blocked drift.
infrastructure/​azure/​post/​types.ts Defines deployment and desired-input contracts.
infrastructure/​azure/​post/​progress/​index.ts Persists validated answers and secret-write checkpoints.
infrastructure/​azure/​post/​progress/​index.test.ts Covers persistence, isolation, conflicts, and file safety.
infrastructure/​azure/​post/​index.ts Coordinates configuration, restart, locking, and recovery.
infrastructure/​azure/​post/​index.test.ts Covers orchestration, cancellation, and retry behavior.
infrastructure/​azure/​post/​errors.ts Adds a resumable post-setup exit exception.
infrastructure/​azure/​post/​deployment/​index.ts Validates deployment identity, revisions, traffic, and jobs.
infrastructure/​azure/​post/​deployment/​index.test.ts Covers deployment discovery and safety guards.
infrastructure/​azure/​post/​credential-file/​index.ts Reads private credential files and validates their format.
infrastructure/​azure/​post/​configure/​index.ts Collects answers and prepares authentication secret references.
infrastructure/​azure/​post/​configure/​index.test.ts Covers prompt recovery, secret reuse, and credential uploads.

Review effort: Max (adaptive)

Comment thread infrastructure/azure/post/index.ts Resolved
Comment thread infrastructure/azure/post/index.ts Resolved
Comment thread infrastructure/azure/post/index.ts Resolved
Comment thread infrastructure/azure/post/index.ts Resolved
@weastler
weastler added this pull request to stack #272 November 17, 2026 02:02
weastler and others added 4 commits November 16, 2026 23:02
Add the existing-installation menu for setup access, GitHub App settings, and active revision restart. Preserve validated progress and pinned Key Vault checkpoints, recover invalid input in place, and gate runtime-only changes with fresh plans and lease ownership checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Post-setup accepted any GitHub provider revision at or above the deployed
one when settings were unchanged, but Hub only starts with the deployed
revision or its immediate successor. Changed settings still require the
next revision.

The CLI command runner always replaced the caller's signal with the
session signal, so lease cleanup after cancellation aborted immediately
and left owned leases held. The runner now applies the session signal
only when the caller supplies none.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@weastler
weastler force-pushed the weastler/stack-6-post-setup branch from a2d8636 to 6f83912 Compare November 17, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants