Skip to content

fix: expose --name and --region-id flags on project create#476

Merged
margaretjgu merged 5 commits into
mainfrom
fix/cloud-project-create-name-region-flags
Jul 22, 2026
Merged

fix: expose --name and --region-id flags on project create#476
margaretjgu merged 5 commits into
mainfrom
fix/cloud-project-create-name-region-flags

Conversation

@margaretjgu

@margaretjgu margaretjgu commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Closes #328.

cloud serverless projects {search,observability,security} create only showed generic flags (--input-file, --wait, etc.). The required body fields name and region_id had no flag equivalents, forcing users to write a JSON file just to set two scalars.

Root cause: the codegen API definitions for the three create commands had no body schema, so buildCommandSchema produced an empty z.looseObject({}) with no derived flags.

Fix: add a body: z.object({ name, region_id }) to each create definition. The existing buildCommandSchema -> extractSchemaArgs -> defineCommand pipeline handles the rest automatically, registering --name and --region-id flags and routing them into the POST body.

Before:

elastic cloud serverless projects search create --input-file /tmp/body.json --wait

After:

elastic cloud serverless projects search create --name cli-demo --region-id aws-us-east-1 --wait

Applies to all three project types: search, observability, security.

Test plan

  • elastic cloud serverless projects search create --help shows --name and --region-id
  • elastic cloud serverless projects observability create --help shows --name and --region-id
  • elastic cloud serverless projects security create --help shows --name and --region-id
  • --input-file still works (flags merge on top of JSON input)
  • New unit test passes: exposes --name and --region-id flags on create project commands

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 0.98s
✅ REPOSITORY gitleaks yes no no 58.88s
✅ REPOSITORY git_diff yes no no 0.06s
✅ REPOSITORY secretlint yes no no 27.07s
✅ REPOSITORY trivy yes no no 18.33s
✅ TYPESCRIPT eslint 2 0 0 3.72s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@JoshMock JoshMock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. was the code generator updated to reflect the changes to the three APIs?

@margaretjgu
margaretjgu force-pushed the fix/cloud-project-create-name-region-flags branch from 1747b7f to b3cc40c Compare July 22, 2026 19:33
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@margaretjgu
margaretjgu merged commit f8a7869 into main Jul 22, 2026
28 checks passed
@margaretjgu
margaretjgu deleted the fix/cloud-project-create-name-region-flags branch July 22, 2026 20:26
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.

cloud serverless projects search create does not expose body fields (name, region_id) as flags

2 participants