Skip to content

feat: harden BYOC deployment workflows - #418

Closed
alongubkin wants to merge 1 commit into
mainfrom
fix/deployment-cleanup-idempotency
Closed

feat: harden BYOC deployment workflows#418
alongubkin wants to merge 1 commit into
mainfrom
fix/deployment-cleanup-idempotency

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • Make deployment cleanup idempotent when late manager operations return not found.
  • Add package list, inspect, and verified download commands to the vendor CLI.
  • Apply embedded branding consistently across generated deployment CLIs and improve effective compute and config-path feedback.
  • Expose compute-pool failure-domain spread and select nested-virtualization-capable machines across AWS, GCP, and Azure.

Validation

  • Vendor CLI library suite: 173 passed.
  • Deployment CLI library suite: 116 passed.
  • Compute selection, package download, branding, config-path, and manager transport tests pass.
  • TypeScript core SDK: 83 tests and full typecheck pass.

@alongubkin alongubkin closed this Aug 15, 2026
@alongubkin
alongubkin deleted the fix/deployment-cleanup-idempotency branch August 15, 2026 14:56
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown

Greptile Summary

The PR hardens BYOC cleanup and deployment feedback, adds platform package inspection/download commands, expands embedded CLI branding, and exposes failure-domain and nested-virtualization configuration.

  • Adds package list, inspect, artifact selection, download, and checksum handling to the platform CLI.
  • Treats manager-side not-found responses as successful late deployment cleanup.
  • Extends nested-virtualization machine selection to GCP and Azure and adds the GCP request model field.
  • Adds per-pool failure-domain spread support to the TypeScript stack builder.
  • Applies embedded branding and clearer effective-config output across deployment CLI commands.

Confidence Score: 2/5

The PR should not merge until package downloads require integrity verification and GCP nested-virtualization requests are propagated through capacity-group provisioning.

The package command can successfully persist unverified bytes, while the newly reachable GCP nested-virtualization path selects a capable machine but drops the opt-in needed to provide the requested capability.

Files Needing Attention: crates/alien-cli/src/commands/packages.rs; crates/alien-core/src/instance_catalog.rs; crates/alien-preflights/src/mutations/compute_cluster.rs

Security Review

The new package downloader can accept plaintext artifact URLs and permits missing checksum metadata, allowing artifact bytes to be written without integrity verification.

Important Files Changed

Filename Overview
crates/alien-cli/src/commands/packages.rs Adds the package command suite, but download integrity becomes optional when metadata lacks a checksum and plaintext URLs are accepted.
crates/alien-core/src/instance_catalog.rs Expands nested-virtualization selection to GCP and Azure, exposing a GCP path where the selected capability is not propagated to provisioning.
crates/alien-gcp-clients/src/gcp/compute.rs Adds the correct serialized GCP advanced-machine-features model, but no in-repository production path sets it.
crates/alien-deployment/src/manager_api_transport.rs Makes final deletion reconciliation and lock release idempotent for structured HTTP 404 responses.
crates/alien-deploy-cli/src/lib.rs Applies embedded command and display branding recursively through clap help.
packages/core/src/compute-cluster.ts Validates and serializes per-capacity-group failure-domain spread using the expected nested map shape.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["alien packages download"] --> API["Platform package API"]
  API --> Metadata["Artifact URL + optional checksum"]
  Metadata --> Select["Select requested/native artifact"]
  Select --> Fetch["Fetch artifact without API bearer token"]
  Fetch --> Verify{"Checksum present?"}
  Verify -- Yes --> Hash["Verify SHA-256"]
  Verify -- No --> Write["Write unverified bytes"]
  Hash -- Match --> Write
  Hash -- Mismatch --> Reject["Reject download"]
Loading

Fix all with Greploop

Fix All in Codex

Prompt To Fix All With AI
### Issue 1
crates/alien-cli/src/commands/packages.rs:243-253
**Unverified artifact downloads succeed**

When package metadata omits `sha256` or `shasum`, the downloader skips integrity verification and writes the response bytes successfully; because artifact discovery also accepts plaintext HTTP URLs, transit-modified content can be saved and reported as downloaded. Require integrity metadata for every artifact or reject downloads that cannot otherwise guarantee authenticity.

**How this was verified:** The download path conditionally hashes only when a checksum is present, while accepted HTTP response bytes are otherwise written directly.

### Issue 2
crates/alien-core/src/instance_catalog.rs:181
**GCP nested-virt flag is dropped**

When a GCP workload requests nested virtualization, this branch selects an `n2-standard-*` machine, but compute-cluster materialization copies only that machine and leaves `nested_virtualization` unset. GCP requires an explicit instance-template opt-in, so the resulting VM cannot provide the requested nested virtualization capability.

---

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

Reviews (1): Last reviewed commit: "feat: harden BYOC deployment workflows" | Re-trigger Greptile

Comment on lines +243 to +253
if let Some(expected) = &artifact.checksum {
let actual = hex::encode(Sha256::digest(&bytes));
if !actual.eq_ignore_ascii_case(expected) {
return Err(AlienError::new(ErrorData::ConfigurationError {
message: format!(
"Checksum mismatch for '{}': expected {}, received {}.",
artifact.path, expected, actual
),
}));
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Unverified artifact downloads succeed

When package metadata omits sha256 or shasum, the downloader skips integrity verification and writes the response bytes successfully; because artifact discovery also accepts plaintext HTTP URLs, transit-modified content can be saved and reported as downloaded. Require integrity metadata for every artifact or reject downloads that cannot otherwise guarantee authenticity.

How this was verified: The download path conditionally hashes only when a checksum is present, while accepted HTTP response bytes are otherwise written directly.

Knowledge Base Used: Developer CLI and Deploy CLI

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/alien-cli/src/commands/packages.rs
Line: 243-253

Comment:
**Unverified artifact downloads succeed**

When package metadata omits `sha256` or `shasum`, the downloader skips integrity verification and writes the response bytes successfully; because artifact discovery also accepts plaintext HTTP URLs, transit-modified content can be saved and reported as downloaded. Require integrity metadata for every artifact or reject downloads that cannot otherwise guarantee authenticity.

**How this was verified:** The download path conditionally hashes only when a checksum is present, while accepted HTTP response bytes are otherwise written directly.

**Knowledge Base Used:** [Developer CLI and Deploy CLI](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/developer-cli.md)

---

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

Fix in Codex

|| name.starts_with("c8i-flex.")
|| name.starts_with("r8i-flex.")
}
Platform::Gcp => self.name.starts_with("n2-standard-"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 GCP nested-virt flag is dropped

When a GCP workload requests nested virtualization, this branch selects an n2-standard-* machine, but compute-cluster materialization copies only that machine and leaves nested_virtualization unset. GCP requires an explicit instance-template opt-in, so the resulting VM cannot provide the requested nested virtualization capability.

Knowledge Base Used: Cloud API Clients

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/alien-core/src/instance_catalog.rs
Line: 181

Comment:
**GCP nested-virt flag is dropped**

When a GCP workload requests nested virtualization, this branch selects an `n2-standard-*` machine, but compute-cluster materialization copies only that machine and leaves `nested_virtualization` unset. GCP requires an explicit instance-template opt-in, so the resulting VM cannot provide the requested nested virtualization capability.

**Knowledge Base Used:** [Cloud API Clients](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/cloud-clients.md)

---

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

Fix in Codex

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