Skip to content

fix: refuse new stacks with shared endpoint hostnames, add deployments delete --forget - #875

Merged
alongubkin merged 3 commits into
mainfrom
alon/alien-1219-lifecycle
Oct 5, 2026
Merged

alongubkin merged 3 commits into
mainfrom
alon/alien-1219-lifecycle

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • Refuse new stacks whose public endpoints share a hostname. Generated hostnames are <hostLabel>.<deployment domain>, so two resources that both expose an endpoint named api collide in every deployment. alien build and alien release accepted such stacks. A new build-time check rejects them and names both resources.
    • The check is registered as build-time only (new PreflightRegistry::add_build_time_check). Deployment-time and template preflights do not run it, so stacks released before this check keep deploying and updating.
    • Two enabledWhen-gated resources may be alternatives chosen at deploy time, so they may still share a host label.
  • alien deployments delete <id> --forget. Sends action: forget, which removes only the deployment record. It is for deployments whose resources are already gone (for example, a deleted CloudFormation stack or Helm release) but that stay stuck. The server already supports this action and limits it to admins.

Testing

  • cargo test -p alien-preflights (392 + integration tests pass). New tests in compile_time/unique_endpoint_host_labels.rs:
    • the build-time pipeline refuses two resources with endpoint api and names both;
    • run_compile_time_checks (used by deployment-time preflights) and run_template_preflights still accept that same stack, which is what keeps existing releases updatable;
    • host-label overrides across containers and workers, apex labels, gated alternatives, TCP endpoints.
  • cargo test -p alien-cli --lib delete_forget: drives delete_deployment_task against a loopback manager and asserts the exact request bodies (forget, then cleanup).

🤖 Generated with Claude Code

alongubkin and others added 2 commits October 5, 2026 06:35
Generated hostnames are <hostLabel>.<deployment domain>, so two
resources exposing an endpoint named "api" collide in every
deployment, but alien build and alien release accepted such stacks.

A new build-time-only check rejects them and names both resources. It
does not run in deployment-time or template preflights: stacks released
before the check existed must keep deploying and updating. Two gated
resources may be alternatives chosen at deploy time, so they may still
share a host label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removes only the deployment record, for deployments whose resources are
already gone (a deleted CloudFormation stack or Helm release) but that
stay stuck. The API already supports the forget action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Adds validation that blocks new stack releases with conflicting endpoint hostnames.

The PR appears safe to merge; no outstanding finding or actionable new regression was established.

Summary

The PR adds build-time and manager-API checks for shared endpoint hostnames on supported platforms, plus alien deployments delete --forget to remove a deployment record without resource cleanup.

  • Previously released stacks remain outside the new deployment-time checks.
  • The CLI no longer suggests fetching a deployment after forgetting it.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Build new stack] --> B[Build-time hostname check]
  C[POST /v1/releases] --> D[Parse platform stacks]
  D --> E[Hostname check]
  E --> F[Store new release]
  G[Deploy existing release] --> H[Deployment-time checks without new hostname check]
Loading

Reviews (2) · Last reviewed commit: "fix: refuse shared endpoint hostnames in..."

Comment thread crates/alien-preflights/src/runner.rs
Comment thread crates/alien-cli/src/commands/deployments.rs
The manager's POST /v1/releases stores submitted stacks without the
build-time preflights, so it now refuses the same conflicts. The check
covers only platforms that always generate hostnames: Kubernetes does
so only with generated exposure, and local and test never do. After
--forget the CLI no longer suggests reading the removed record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review

@alongubkin
alongubkin merged commit a295ea6 into main Oct 5, 2026
22 checks passed
@alongubkin
alongubkin deleted the alon/alien-1219-lifecycle branch October 5, 2026 04:54
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