Skip to content

feat: Add CLI command groups for Hosting API - #248

Open
jhenderson1-godaddy wants to merge 5 commits into
mainfrom
feat/HPX-2484
Open

feat: Add CLI command groups for Hosting API#248
jhenderson1-godaddy wants to merge 5 commits into
mainfrom
feat/HPX-2484

Conversation

@jhenderson1-godaddy

@jhenderson1-godaddy jhenderson1-godaddy commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a new hosting command group running off the GoDaddy Hosting API (/v1/hosting). This sits alongside the existing hosting nodejs commands, which target the /v1/hosting/nodejs API.

New commands (48 files, ~3500 lines):

  • hosting app – list, get, create, update, delete, restart, status
  • hosting deployment – publish, get, list
  • hosting source – upload (ZIP), github (import from branch), status
  • hosting subscription – list, get, attach app
  • hosting domain – list, get, attach to app, detach
  • hosting secrets – list, create, update, delete, sync
  • hosting log list
  • hosting runtime get
  • hosting operation get
  • hosting github – status, repos, branches

All commands include with_output_schema and with_default_fields for table rendering.

Design decisions

Two hosting modules. hosting/nodejs/ continues to target /v1/hosting/nodejs behind the feature flag. The new hosting/ module targets the new and generic /v1/hosting API. They share OAuth scopes but have separate clients and response shapes – notably the nodejs API uses "apps" as its list key while the generic API uses "items".

Bare arrays from list commands. List commands collect all pages into a Vec<Value> and return json!(all_items) directly. Wrapping in { "items": [...] } causes cli-engine to treat the response as a single row rather than iterating it as a table.

Testing and Validation

Manual E2E testing covered the full lifecycle against the production environment:

  1. Create Node.js app
  2. Upload ZIP source and poll for completion
  3. Import from GitHub branch on a git-connected app
  4. Publish app and poll until complete
  5. List hosting subscriptions and attach an app to one
  6. Fetch preview and publish logs
  7. Attach a custom domain
  8. Create, sync, list, and delete secrets
  9. Check runtime status

All tests passed on prod (GDDY_MIN_STAGE=beta). Further follow-up tests were run, with the following commands verified: hosting app list, hosting domain list, hosting log list, hosting github repos, hosting github branches.

Automated testing covers the following:

Client tests (client_tests.rs) – 28 tests
One test per HTTP method in the client, using a mock HTTP server. They verify path, query params, request body shape, auth header, and that 204s return null. Every endpoint in client.rs has a corresponding test.

Unit tests scattered in command files – 11 tests

  • common.rs – parse_app_type validation (accepts known types case-insensitively, rejects unknown)
  • app/update.rs – patch serialization
  • source/upload.rs – ZIP upload multipart construction

@jhenderson1-godaddy jhenderson1-godaddy changed the title feat: HPX-2484 – Add CLI command groups for Hosting API feat: Add CLI command groups for Hosting API Sep 4, 2026
@jhenderson1-godaddy
jhenderson1-godaddy marked this pull request as ready for review September 4, 2026 21: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