Skip to content

Implement Atlantic.Net cloud adapter#733

Merged
ralyodio merged 4 commits into
profullstack:masterfrom
caydyan:codex/implement-atlantic-cloud-adapter
Jun 14, 2026
Merged

Implement Atlantic.Net cloud adapter#733
ralyodio merged 4 commits into
profullstack:masterfrom
caydyan:codex/implement-atlantic-cloud-adapter

Conversation

@caydyan

@caydyan caydyan commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the Atlantic.Net stub with a signed Cloud API client for quote/provision/list/status/destroy
  • enforce dry-run behavior, on-demand terms, one SSH key id, and maxHourlyPrice before billable run-instance calls
  • add focused tests for signing, plan selection, API error parsing, dry-run guards, and instance mapping

Validation

  • node --check packages/cloud/atlantic/src/index.ts
  • node --check packages/cloud/atlantic/src/index.test.ts
  • pnpm --filter @profullstack/sh1pt-core build
  • pnpm --filter @profullstack/sh1pt-cloud-atlantic typecheck
  • pnpm vitest run packages/cloud/atlantic/src/index.test.ts
  • git diff --check

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Replaces the Atlantic.Net stub with a fully functional signed Cloud API adapter covering quote, provision, list, status, and destroy operations, backed by a focused unit test suite.

  • HMAC-signed requests: every call to cloudapi.atlantic.net includes a Timestamp, Rndguid, and HMAC-SHA256 Signature, matching the Atlantic.Net API spec; the signing logic is verified directly in index.test.ts.
  • Safety rails: dry-run short-circuits before any API call, on-demand billing term is always enforced, a single SSH key constraint is validated before run-instance, and maxHourlyPrice is enforced through pickPlan filtering.
  • Resilient response parsing: itemsFromSet collects *item-keyed entries from the quirky Atlantic.Net envelope format; parseJson degrades gracefully on non-JSON error bodies; findApiError checks both top-level and nested error fields.

Confidence Score: 5/5

Safe to merge — no billable API calls occur without explicit opt-in, credentials are validated before any request, and dry-run paths are correctly isolated.

The core provisioning flow, signing logic, error handling, and plan selection are all correct and well-tested. The two flagged items are purely cosmetic: one is unreachable dead code in parseJson and the other is a suboptimal ordering of the SSH key count guard that can produce a less helpful error message in an edge case but never allows an incorrect operation to proceed.

No files require special attention for merge.

Important Files Changed

Filename Overview
packages/cloud/atlantic/src/index.ts Full Atlantic.Net adapter implementation with HMAC-signed API client, plan selection, image auto-detection, dry-run guards, and structured error handling; two minor style issues noted.
packages/cloud/atlantic/src/index.test.ts Replaces smoke test with focused unit tests and contract test; covers signing, plan selection, dry-run, image auto-detection, error parsing, and multi-key rejection.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant Adapter as Atlantic Adapter
    participant API as cloudapi.atlantic.net

    Note over Caller,API: quote()
    Caller->>Adapter: quote(ctx, spec, config)
    Adapter->>API: POST describe-plan (HMAC-signed)
    API-->>Adapter: plans[]
    Adapter->>Adapter: pickPlan(plans, spec)
    Adapter-->>Caller: "Quote { hourly, sku, ... }"

    Note over Caller,API: provision() — dry-run
    Caller->>Adapter: "provision(ctx{dryRun:true}, spec, config)"
    Adapter-->>Caller: stubInstance (no API calls)

    Note over Caller,API: provision() — live
    Caller->>Adapter: "provision(ctx{dryRun:false}, spec, config)"
    Adapter->>API: POST describe-plan (HMAC-signed)
    API-->>Adapter: plans[]
    Adapter->>Adapter: pickPlan + SSH key guard
    alt spec.image not set
        Adapter->>API: POST describe-image (HMAC-signed)
        API-->>Adapter: images[]
        Adapter->>Adapter: pickDefaultImage (newest Ubuntu)
    end
    Adapter->>API: POST run-instance (HMAC-signed)
    API-->>Adapter: "{ instanceid, ip_address }"
    Adapter-->>Caller: "Instance { id, status, publicIp, ... }"

    Note over Caller,API: list() / status() / destroy()
    Caller->>Adapter: list(ctx, config)
    Adapter->>API: POST list-instances (HMAC-signed)
    API-->>Adapter: instancesSet
    Adapter-->>Caller: Instance[]
Loading

Reviews (5): Last reviewed commit: "Address Atlantic review feedback" | Re-trigger Greptile

Comment thread packages/cloud/atlantic/src/index.ts
Comment thread packages/cloud/atlantic/src/index.ts Outdated
Comment thread packages/cloud/atlantic/src/index.ts
Comment thread packages/cloud/atlantic/src/index.ts
@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@caydyan caydyan force-pushed the codex/implement-atlantic-cloud-adapter branch from 21cee13 to a3276de Compare June 14, 2026 00:57
@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

6 similar comments
@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@github-actions

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@ralyodio ralyodio merged commit e10459c into profullstack:master Jun 14, 2026
5 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.

2 participants