Skip to content

feat: list machines for every deployment - #670

Merged
alongubkin merged 2 commits into
mainfrom
alon/alien-889-universal-machine-inventory-cli
Sep 18, 2026
Merged

alongubkin merged 2 commits into
mainfrom
alon/alien-889-universal-machine-inventory-cli

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Background

alien deployments machines is the developer-facing inventory command, but it called a Platform endpoint restricted to platform=machines. That made the command fail for ordinary AWS/GCP/Azure deployments even though their ComputeClusters are managed by Horizon and have machine inventory.

Depends on alienplatform/platform#722.

Root cause

The CLI consumed the old provisioning-specific SDK operation (list_machines_inventory). The API contract now models inventory as a deployment observation and aggregates every Horizon-backed ComputeCluster.

Change

  • Regenerate the checked-in Platform OpenAPI contract from platform#722.
  • Call GET /v1/deployments/{id}/machines through the generated Rust SDK.
  • Show the stack Cluster resource ID in human output, making multi-ComputeCluster deployments unambiguous.
  • Sort by network divergence, then cluster resource ID, then machine ID.
  • Preserve full clusterResourceId data in --json output.

No new top-level CLI or Horizon/horizond endpoint is introduced. The user command remains:

alien deployments machines <deployment>

Reproduction

Before platform#722 and this PR:

alien deployments machines production/api

against an AWS deployment returns MACHINES_DEPLOYMENT_UNAVAILABLE because the old API checks that the deployment platform is machines.

After both PRs, the same command returns all machines across the deployment's ComputeClusters.

Verification

  • cargo build -p alien-platform-api generates DeploymentMachine and list_deployment_machines from the committed OpenAPI.
  • cargo check -p alien-cli
  • cargo test -p alien-cli machines_inventory_tests --lib

@alongubkin
alongubkin force-pushed the alon/alien-889-universal-machine-inventory-cli branch from 712c90d to 592526c Compare September 18, 2026 05:11
@alongubkin
alongubkin force-pushed the alon/alien-889-universal-machine-inventory-cli branch from 592526c to 9a8c4ad Compare September 18, 2026 05:16
@greptile-apps

greptile-apps Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previous Rust SDK generation failure is fixed and no new actionable defects were identified.

Fix All in CodexFindings

  1. P1 Filtered SDK generation fails ▶
Fix with agent prompt
### Issue 1
crates/alien-cli/src/commands/deployments.rs:undefined-669
The CLI now calls `list_deployment_machines()`, but its filtered Platform SDK configuration still requires the removed `listMachinesInventory` operation. Because `alien-cli` disables the SDK's default features, the build script uses that filter and fails before generating the client, leaving the CLI unable to compile. Update the allowlist to require `listDeploymentMachines`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR moves machine inventory from the Machines-specific API to a deployment-wide Platform operation and updates the generated clients accordingly.

  • Calls GET /v1/deployments/{id}/machines from the CLI and generated SDKs.
  • Includes the ComputeCluster resource ID in human and JSON output.
  • Sorts divergent machines first, followed by cluster resource ID and machine ID.
  • Regenerates the TypeScript client to expose deployments.listMachines and remove the obsolete inventory operation.
  • Updates the filtered Rust SDK operation allowlist so the CLI can generate and compile successfully.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    User[alien deployments machines] --> CLI[Alien CLI]
    CLI --> SDK[Filtered Platform Rust SDK]
    SDK --> API[GET /v1/deployments/id/machines]
    API --> Inventory[Deployment-wide machine inventory]
    Inventory --> Sort[Sort by network divergence, cluster, machine]
    Sort --> Human[Human table with Cluster column]
    Sort --> JSON[JSON preserving clusterResourceId]
Loading

Reviews (2) · Last reviewed commit: "fix(sdk): regenerate platform client for..."

Comment thread crates/alien-cli/src/commands/deployments.rs
@greptile-apps

This comment has been minimized.

@alongubkin
alongubkin enabled auto-merge (squash) September 18, 2026 05:30
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai re-comment

@alongubkin
alongubkin force-pushed the alon/alien-889-universal-machine-inventory-cli branch from 991c6a6 to e19b20e Compare September 18, 2026 05:43
@alongubkin
alongubkin merged commit 63ba435 into main Sep 18, 2026
20 of 21 checks passed
@alongubkin
alongubkin deleted the alon/alien-889-universal-machine-inventory-cli branch September 18, 2026 05:52
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