feat: Add CLI command groups for Hosting API - #248
Open
jhenderson1-godaddy wants to merge 5 commits into
Open
Conversation
jhenderson1-godaddy
marked this pull request as ready for review
September 4, 2026 21:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
hostingcommand group running off the GoDaddy Hosting API (/v1/hosting). This sits alongside the existinghosting nodejscommands, which target the/v1/hosting/nodejsAPI.New commands (48 files, ~3500 lines):
hosting app– list, get, create, update, delete, restart, statushosting deployment– publish, get, listhosting source– upload (ZIP), github (import from branch), statushosting subscription– list, get, attach apphosting domain– list, get, attach to app, detachhosting secrets– list, create, update, delete, synchosting log listhosting runtime gethosting operation gethosting github– status, repos, branchesAll commands include
with_output_schemaandwith_default_fieldsfor table rendering.Design decisions
Two hosting modules.
hosting/nodejs/continues to target/v1/hosting/nodejsbehind the feature flag. The newhosting/module targets the new and generic/v1/hostingAPI. 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 returnjson!(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:
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 serializationsource/upload.rs– ZIP upload multipart construction