Skip to content

Add Range42 stack previews and improve runtime reliability - #154

Merged
pparage merged 6 commits into
devfrom
feature/isolated-range42-platform-api-20260925
Sep 28, 2026
Merged

pparage merged 6 commits into
devfrom
feature/isolated-range42-platform-api-20260925

Conversation

@pparage

@pparage pparage commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

The backend can now generate a reviewable Range42 stack for the project canvas. The UI receives the planned machines, network and project files before the user adds the stack. Previewing a stack does not create or change Proxmox resources.

What changes:

  • Adds stack previews for the core and full profiles, using the platform generator installed by the operator. Invalid input and an unavailable generator return clear errors.
  • Exposes stack profiles and setup fields to the deployment form, and checks required values before execution. Native deployments keep publishing progress events when switching to their selected CLI context.
  • Enables additional VM interfaces, resource settings and disk growth only for a verified runtime that supports them. Preflight blocks templates with unreadable network settings or interfaces missing from the requested topology.
  • Prevents false snapshot configuration differences caused by Proxmox returning a masked cloud-init password in one response and its hash in another.
  • Reduces unnecessary work in idle event streams and releases watchers when a client disconnects.
  • Checks reviewed VM identities using bounded parallel reads before network or firewall changes, retaining the ownership checks while reducing sequential API calls.

Companion UI: range42/range42-deployer-ui#115

Deployment dependency: stack previews require the generator from the playbooks feature branch, installed on the backend and selected through RANGE42_PLATFORM_PLAYBOOKS_DIR. The container also includes the file-transfer tool needed by the native workflow.

Validation at revision a6d3b6b:

  • Focused native, platform, runtime and resource suite: 71 tests passed.
  • Deployed API passed authenticated readiness checks in the shared PVE test environment.
  • Live full-stack preview returned HTTP 200 with 11 VMs and 521 project files.
  • Live UI checks against this API covered stack creation, Git save and opening the native deployment form with a ready context. These checks did not provision a new child stack.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T08:10:03.291989Z a6d3b6b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pparage
pparage merged commit 8386ac9 into dev Sep 28, 2026
2 of 4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6d3b6be02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +45 to +46
profile, _ = runtime_snapshot()
if not native_contract(profile):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move runtime fingerprinting off the event loop

When requires_native_contract is enabled and a scenario requests an optional bootstrap feature, this synchronous call runs from the async preflight and deployment paths. runtime_snapshot() walks and hashes every declared runtime component, and native_contract() then hashes the bundle and controller trees again; with a large installed runtime this blocks the single Uvicorn worker, delaying unrelated API requests and SSE streams. Run this verification in a worker thread or reuse a safely cached verified snapshot.

Useful? React with 👍 / 👎.

Comment thread app/routes/v1/platform.py
Comment on lines +45 to +47
if result.returncode:
raise ValueError(value.get('error', 'Platform component could not be generated'))
if value.get('version') != 1 or not isinstance(value.get('files'), dict):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate generator JSON is an object before calling .get

If an incompatible or malfunctioning installed generator emits valid JSON that is a list, scalar, or null, either .get call raises AttributeError, which is not caught by this handler. The preview endpoint therefore returns an internal 500 instead of the intended PLATFORM_COMPONENT_INVALID 422; explicitly require a dictionary before inspecting its fields.

Useful? React with 👍 / 👎.

@pparage pparage changed the title Add Range42 stack previews and improve runtime reliability Deploy existing scenario components and improve runtime reliability Sep 28, 2026
@pparage pparage changed the title Deploy existing scenario components and improve runtime reliability Add Range42 stack previews and improve runtime reliability Sep 28, 2026
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