Skip to content

feat: integrate nexus API commands as first-class noun-verb subcommands#2019

Draft
feluelle wants to merge 1 commit intomainfrom
feat/nexus-integration
Draft

feat: integrate nexus API commands as first-class noun-verb subcommands#2019
feluelle wants to merge 1 commit intomainfrom
feat/nexus-integration

Conversation

@feluelle
Copy link
Copy Markdown
Member

@feluelle feluelle commented Feb 24, 2026

Description

Auto-generate CLI commands from the Astronomer API spec via the nexus shared library and register them directly on the root in noun-verb format (e.g. astro deployment create). Nexus commands take priority; remaining cloud commands fill gaps via automatic merge. This removes ~70 hand-written cloud commands now covered by the API spec.

Key changes

  • ConfigAdapter: Bridges astro-cli's viper-based config to the nexus ConfigProvider interface, mapping domains to API profiles and contexts to org/workspace/deployment defaults
  • Noun-verb registration: Nexus restish commands (e.g. create-deployment) are parsed and registered as astro <noun> <verb> (e.g. astro deployment create)
  • Cloud command merge: Remaining cloud commands are merged underneath nexus nouns with nexus-first priority — cloud fills gaps for commands not covered by the API (e.g. astro deploy, astro deployment connection, astro deployment airflow-variable)
  • Removed ~70 cloud commands: Deployment/workspace/organization CRUD, user/team/token management, inspect, hibernate, wake-up — all replaced by nexus-generated equivalents
  • Interactive prompts: Missing required body fields are prompted interactively in terminals (enum fields show numbered selection; oneOf/discriminator fields prompt first)
  • Delete confirmation: All delete commands prompt for confirmation; --force/-f skips the prompt
  • Pretty-printed output: JSON output is pretty-printed with 2-space indentation in terminals; raw compact JSON when piped for scripting compatibility
  • Error formatting: API errors displayed as Error (<status>): <message> instead of raw JSON
  • Breaking changes doc: BREAKING_CHANGES.md documents all removed commands, removed features, and behavioral changes

🧪 Functional Testing

  1. astro deployment list — should return pretty-printed JSON in terminal
  2. astro deployment create — should prompt for required fields (type, name, etc.)
  3. astro deployment delete <id> — should prompt for confirmation; --force skips it
  4. astro deployment list | jq '.' — should return raw compact JSON when piped
  5. astro deploy — should still work as before (project deployment)
  6. astro workspace list / astro organization list — nexus-generated commands work
  7. Verify commands not covered by nexus still work (e.g. astro deployment connection list)

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@feluelle feluelle force-pushed the feat/nexus-integration branch from f585042 to c320e7a Compare February 24, 2026 18:27
@feluelle feluelle force-pushed the feat/nexus-integration branch 4 times, most recently from b747ec2 to 6343984 Compare March 5, 2026 13:41
@coveralls-official
Copy link
Copy Markdown

coveralls-official bot commented Mar 5, 2026

Pull Request Test Coverage Report for Build 10fb78cd-b00c-4a9f-a1a6-a6ab27017b4d

Details

  • 27 of 845 (3.2%) changed or added relevant lines in 7 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-2.3%) to 33.612%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/root_hooks.go 10 16 62.5%
cmd/root.go 16 40 40.0%
internal/nexus/output.go 0 32 0.0%
internal/nexus/config_adapter.go 0 81 0.0%
internal/nexus/commands.go 0 153 0.0%
internal/nexus/exec.go 0 522 0.0%
Files with Coverage Reduction New Missed Lines %
cmd/cloud/workspace.go 2 88.64%
Totals Coverage Status
Change from base Build f71991c9-5d72-45db-93b8-f9c82e50ab2c: -2.3%
Covered Lines: 22310
Relevant Lines: 66375

💛 - Coveralls

@feluelle feluelle force-pushed the feat/nexus-integration branch 3 times, most recently from b4ada07 to 24a3561 Compare March 6, 2026 17:30
Auto-generate CLI commands from the Astronomer API spec via nexus and
register them directly on the root in noun-verb format (e.g.
`astro deployment create`). Nexus commands take priority; remaining
cloud commands fill gaps via automatic merge. This removes ~70
hand-written cloud commands now covered by the API spec.

Key changes:
- Add ConfigAdapter bridging astro-cli's viper config to nexus
- Register nexus commands in noun-verb format on root command
- Merge cloud commands underneath nexus nouns (nexus-first priority)
- Preserve `astro deploy` action semantics alongside nexus deploy noun
- Remove superseded deployment/workspace/organization cloud commands
  (CRUD, user/team/token management, inspect, hibernate, wake-up)
- Add interactive prompts for required body fields (with retry loops)
- Add delete confirmation prompts with --force bypass
- Pretty-print JSON output in terminals; raw JSON when piped
- Format API errors as "Error (<status>): <message>"
- Add BREAKING_CHANGES.md documenting all removals and changes
@feluelle feluelle force-pushed the feat/nexus-integration branch from db46713 to 42d4bbd Compare March 6, 2026 17:35
@feluelle feluelle changed the title Add nexus API integration as astro nexus subcommands Integrate nexus API commands as first-class noun-verb subcommands Mar 6, 2026
@feluelle feluelle changed the title Integrate nexus API commands as first-class noun-verb subcommands feat: integrate nexus API commands as first-class noun-verb subcommands Mar 6, 2026
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