Skip to content

Add installable toolchains with persisted state - #51

Merged
BotCoder254 merged 2 commits into
mainfrom
feat/event-driven-orchestration
Jul 17, 2026
Merged

Add installable toolchains with persisted state#51
BotCoder254 merged 2 commits into
mainfrom
feat/event-driven-orchestration

Conversation

@BotCoder254

@BotCoder254 BotCoder254 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Introduces deployment-wide persistence for UI-installed toolchain images via a new installed_toolchain_images table and DB module, then wires it into toolchains APIs with install/uninstall endpoints, audit logging, and install lifecycle states (pending/installed/failed).

The runner provisioner now accepts a DB pool, unions installed toolchains with env prewarm images on reconnect, and adds on-demand pull/remove helpers used by the new handlers. Frontend updates add install/uninstall mutations, polling while installs are pending, richer error messaging, install-status-aware cards and summary metrics, and a new branded ToolchainLogo component. Toolchain response types were expanded to include installStatus, installError, and installSupported.

Summary by CodeRabbit

  • New Features

    • Added UI controls to install, uninstall, retry, and monitor toolchain images.
    • Added installation status indicators, failure details, confirmation dialogs, and branded toolchain icons.
    • Installed toolchains are persisted and automatically warmed when runners reconnect.
    • Added clear messaging when installation is unavailable.
  • Documentation

    • Updated toolchain guidance and configuration documentation to explain installation requirements and behavior.

Introduces deployment-wide persistence for UI-installed toolchain images via a new `installed_toolchain_images` table and DB module, then wires it into toolchains APIs with install/uninstall endpoints, audit logging, and install lifecycle states (`pending/installed/failed`).

The runner provisioner now accepts a DB pool, unions installed toolchains with env prewarm images on reconnect, and adds on-demand pull/remove helpers used by the new handlers. Frontend updates add install/uninstall mutations, polling while installs are pending, richer error messaging, install-status-aware cards and summary metrics, and a new branded `ToolchainLogo` component. Toolchain response types were expanded to include `installStatus`, `installError`, and `installSupported`.
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for overup-app ready!

Name Link
🔨 Latest commit 8e117b0
🔍 Latest deploy log https://app.netlify.com/projects/overup-app/deploys/6a5ab5277eff6d0007af73e9
😎 Deploy Preview https://deploy-preview-51--overup-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
overup Ready Ready Preview, Comment Jul 17, 2026 11:06pm

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34c134bf-fa81-4f96-a204-912279972a14

📥 Commits

Reviewing files that changed from the base of the PR and between 4a07eb2 and 8e117b0.

📒 Files selected for processing (17)
  • backend/.env.example
  • backend/migrations/20260718000001_installed_toolchain_images.sql
  • backend/migrations/20260718000002_installed_toolchain_images_status_index.sql
  • backend/src/db/mod.rs
  • backend/src/db/toolchain_images.rs
  • backend/src/handlers/toolchains.rs
  • backend/src/main.rs
  • backend/src/models/toolchain.rs
  • backend/src/routes/mod.rs
  • backend/src/services/runner_provisioner.rs
  • src/components/brand/toolchains/ToolchainLogo.tsx
  • src/features/toolchains/api/toolchainsApi.ts
  • src/features/toolchains/components/ToolchainCard.tsx
  • src/features/toolchains/components/ToolchainsSummaryStrip.tsx
  • src/features/toolchains/hooks/useToolchains.ts
  • src/features/toolchains/pages/ToolchainsPage.tsx
  • src/types/toolchain.ts

📝 Walkthrough

Walkthrough

Toolchain installation and uninstallation now persist image state, manage Docker images through runner provisioners, expose asynchronous API endpoints, and provide frontend controls with installation status, polling, failure messaging, and branded logos.

Changes

Toolchain installation lifecycle

Layer / File(s) Summary
Installation state persistence and response contracts
backend/migrations/*, backend/src/db/*, backend/src/models/toolchain.rs, src/types/toolchain.ts
Adds persisted toolchain image records, lifecycle status helpers, active-image indexing, and install metadata in toolchain responses.
Runner image management and reconnect warming
backend/src/services/runner_provisioner.rs, backend/src/main.rs, backend/.env.example
Passes database state into the runner provisioner, supports image pull/removal operations, and prewarms active installed images on reconnect.
Install and uninstall API flow
backend/src/handlers/toolchains.rs, backend/src/routes/mod.rs
Adds authenticated install/uninstall endpoints with catalog validation, persistence, audit logging, timeout handling, and asynchronous Docker operations.
Frontend installation controls and presentation
src/features/toolchains/*, src/types/toolchain.ts, src/components/brand/toolchains/*
Adds API mutations, pending polling, status-aware controls, installation metrics, explanatory text, and toolchain brand logos.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ToolchainCard
  participant ToolchainsAPI
  participant ToolchainsHandler
  participant RunnerProvisioner
  participant Database

  User->>ToolchainCard: Click Install
  ToolchainCard->>ToolchainsAPI: POST installToolchain
  ToolchainsAPI->>ToolchainsHandler: Install request
  ToolchainsHandler->>Database: upsert_pending
  ToolchainsHandler->>RunnerProvisioner: pull image
  RunnerProvisioner-->>ToolchainsHandler: Pull result
  ToolchainsHandler->>Database: mark_installed or mark_failed
  ToolchainCard->>ToolchainsAPI: Poll toolchain status
  ToolchainsAPI-->>ToolchainCard: Updated installation status
Loading

Possibly related PRs

  • BotCoder254/overup#50: Adds the toolchain catalog and page groundwork extended here with installation state and persistence.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/event-driven-orchestration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

This PR adds installable toolchain management with persistent state tracking. The implementation correctly uses asynchronous operations, proper error handling, and audit logging.

Critical Issue Found

Performance Regression: The migration is missing an index on the status column. The list_active_images query filters by status on every Docker reconnect (30-60s intervals during outages), which will cause full table scans that could block critical system operations as the table grows.

Implementation Notes

The async architecture properly handles long-running Docker pulls off the request path, and the spawned tasks correctly capture required state. Rate limiting is appropriately configured for the expensive install operations. The code correctly prevents removal of the default job image and uses global deployment state as documented.

Please address the indexing issue before merging to production.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines +8 to +16
CREATE TABLE installed_toolchain_images (
toolchain_key TEXT PRIMARY KEY,
image TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'installed', 'failed')),
error TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Performance Regression: Missing index on status column causes N+1 query on every reconnect.

The list_active_images function in db/toolchain_images.rs filters by status IN ('installed', 'pending') without an index. This query executes on every Docker daemon reconnect (every 30-60s during outages) and could block the reconnect loop on large datasets. Add index before the table goes to production.

Suggested change
CREATE TABLE installed_toolchain_images (
toolchain_key TEXT PRIMARY KEY,
image TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'installed', 'failed')),
error TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE installed_toolchain_images (
toolchain_key TEXT PRIMARY KEY,
image TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'installed', 'failed')),
error TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX idx_installed_toolchain_images_status ON installed_toolchain_images(status);

Add a new immutable SQL migration creating a partial index on `installed_toolchain_images(status)` for `installed` and `pending` rows. This aligns with `list_active_images` lookups used during hosted-runner Docker reconnect/prewarm cycles and keeps the query scalable as table size grows, while remaining a defensive optimization at current low cardinality.
@BotCoder254
BotCoder254 merged commit b828666 into main Jul 17, 2026
5 of 10 checks passed
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.

1 participant