Skip to content

Add Linode cloud adapter#750

Merged
ralyodio merged 3 commits into
profullstack:masterfrom
caydyan:codex/revive-linode-cloud-adapter
Jun 14, 2026
Merged

Add Linode cloud adapter#750
ralyodio merged 3 commits into
profullstack:masterfrom
caydyan:codex/revive-linode-cloud-adapter

Conversation

@caydyan

@caydyan caydyan commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the closed/stale Linode adapter PR with a clean branch on current origin/master.

This adds a real cloud-linode provider package for Linode / Akamai Cloud and registers it in the CLI/docs so the README-advertised Linode cloud surface has an implementation.

What changed

  • Add @profullstack/sh1pt-cloud-linode.
  • Implement Linode API v4 support for:
    • account/token connection
    • instance type quoting with region/hardware/max-price filtering
    • CPU VPS, GPU, dedicated CPU, and block-storage provisioning
    • paginated instance and volume listing
    • instance/volume status
    • dry-run-safe destroy and provisioning behavior
  • Register linode in the cloud adapter registry, scale pricing fallback, docs category list, and lockfile importer.
  • Add focused regression coverage for:
    • direct API response shapes
    • no silent free quote fallback when pricing fetches fail
    • no fallback to billable default types when constraints exclude all candidates
    • paginated listing
    • dry-run destroy
    • status/destroy 404 fallback to volumes only
    • block-storage price budget enforcement
    • unique Linode-safe volume labels
    • surfacing volume-list failures instead of returning partial inventory

Validation

  • corepack pnpm --filter @profullstack/sh1pt-core build
  • corepack pnpm --filter @profullstack/sh1pt-cloud-linode typecheck
  • corepack pnpm --filter @profullstack/sh1pt-cloud-linode build
  • corepack pnpm vitest run packages/cloud/linode/src/index.test.ts (24 tests)
  • git diff --check origin/master...HEAD
  • git diff --check

Bounty / listing context

This is intended for the uGig sh1pt platform-adapter listing (134f0007-139c-4cb8-98eb-652b5846f9ab), which local tracking records as offering 2,000-2,500 LN sats per accepted platform PR.

If accepted for payout, route sats/BTC to:

bc1qev5ant33v5y89qqjvcf4mh9hlax5svqf5xd7gc

@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds the @profullstack/sh1pt-cloud-linode adapter, implementing Linode API v4 support for VPS, GPU, dedicated CPU, and block-storage provisioning, and registers it across the CLI registry, scale pricing fallback, and docs.

  • Core adapter (packages/cloud/linode/src/index.ts): Implements connect, quote, provision, list, destroy, and status against the Linode v4 API. Previously flagged issues — the dry-run price-guard ordering for block storage and the missing hourlyRate override in provision — are both addressed in this revision.
  • Test suite (src/index.test.ts): 24 focused tests cover API response shapes, no-silent-free-quote guard, pagination, dry-run safety, 404 fallback routing, label uniqueness, and volume listing failure propagation.
  • Registry / docs plumbing: One-line additions to adapter-registry.ts, scale.ts (default pricing at $0.0075/hr), pnpm-lock.yaml, and the docs page complete the integration.

Confidence Score: 5/5

Safe to merge — the adapter introduces no breaking changes to existing providers and all new code is isolated to the linode package.

Both previously flagged defects (block-storage dry-run bypassing the price guard, and provision returning a zero hourly rate) are now corrected and covered by dedicated tests. No new correctness issues were found in this pass.

No files require special attention — the only open item is a minor sequential-vs-concurrent fetch in list, which does not affect correctness.

Important Files Changed

Filename Overview
packages/cloud/linode/src/index.ts Core Linode adapter — well-structured with correct price-guard ordering, hourlyRate override in provision, and typed error classification. Sequential list fetches are a minor inefficiency.
packages/cloud/linode/src/index.test.ts 24 focused regression tests covering API shape, pagination, dry-run price enforcement, 404 fallback, and label uniqueness — good coverage for a new adapter.
packages/cli/src/adapter-registry.ts Adds linode to the cloud adapters list in alphabetical order — trivial, correct change.
packages/cli/src/commands/scale.ts Adds cloud-linode fallback pricing entry at $0.0075/hr — consistent with the Nanode 1 GB price used in tests.
packages/cloud/linode/package.json Standard monorepo package manifest with workspace core dependency and publishConfig for dist output — matches the pattern of sibling cloud packages.
sites/sh1pt.com/app/docs/page.tsx Adds linode to the docs cloud-category display string — one-line, safe change.

Sequence Diagram

sequenceDiagram
    participant CLI
    participant LinodeAdapter
    participant LinodeAPI as Linode API v4

    CLI->>LinodeAdapter: connect(ctx)
    LinodeAdapter->>LinodeAPI: GET /account
    LinodeAPI-->>LinodeAdapter: "{ euuid, email }"
    LinodeAdapter-->>CLI: "{ accountId }"

    CLI->>LinodeAdapter: quote(ctx, spec)
    alt block-storage
        LinodeAdapter-->>CLI: computed hourly/monthly (no API call)
    else cpu-vps / gpu / bare-metal
        LinodeAdapter->>LinodeAPI: "GET /linode/types?page_size=500"
        LinodeAPI-->>LinodeAdapter: "{ data: LinodeType[] }"
        LinodeAdapter-->>CLI: "{ sku, hourly, monthly }"
    end

    CLI->>LinodeAdapter: provision(ctx, spec)
    alt block-storage
        Note over LinodeAdapter: maxHourlyPrice check BEFORE dryRun
        LinodeAdapter->>LinodeAPI: POST /volumes
        LinodeAPI-->>LinodeAdapter: LinodeVolume
        LinodeAdapter-->>CLI: "Instance (kind=block-storage)"
    else cpu-vps / gpu / bare-metal
        LinodeAdapter->>LinodeAPI: "GET /linode/types?page_size=500"
        LinodeAPI-->>LinodeAdapter: "{ data: LinodeType[] }"
        LinodeAdapter->>LinodeAPI: POST /linode/instances
        LinodeAPI-->>LinodeAdapter: LinodeInstance
        LinodeAdapter-->>CLI: Instance (hourlyRate from matched type)
    end

    CLI->>LinodeAdapter: list(ctx)
    LinodeAdapter->>LinodeAPI: "GET /linode/instances?page=N&page_size=500 (paginated)"
    LinodeAdapter->>LinodeAPI: "GET /volumes?page=N&page_size=500 (paginated)"
    LinodeAPI-->>LinodeAdapter: instances + volumes
    LinodeAdapter-->>CLI: Instance[]

    CLI->>LinodeAdapter: destroy(ctx, id)
    LinodeAdapter->>LinodeAPI: "DELETE /linode/instances/{id}"
    alt 404 (not a Linode instance)
        LinodeAdapter->>LinodeAPI: "DELETE /volumes/{id}"
    end
    LinodeAdapter-->>CLI: void
Loading

Reviews (3): Last reviewed commit: "Keep Linode CPU VPS kind stable" | Re-trigger Greptile

Comment thread packages/cloud/linode/src/index.ts Outdated
Comment thread packages/cloud/linode/src/index.ts Outdated
Comment thread packages/cloud/linode/src/index.ts
@ralyodio ralyodio merged commit c3c7a3d into profullstack:master Jun 14, 2026
5 checks passed
@caydyan

caydyan commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging. For uGig payout tracking, I will include #750 as the Linode platform-adapter PR alongside the merged #726, #733, #747, and #748 under listing 134f0007-139c-4cb8-98eb-652b5846f9ab. If you prefer a different invoice scope or payout route than uGig, please let me know.

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