Skip to content

feat: add Forms management commands - #1626

Merged
ramya18101 merged 10 commits into
mainfrom
feat/forms-management
Sep 9, 2026
Merged

feat: add Forms management commands#1626
ramya18101 merged 10 commits into
mainfrom
feat/forms-management

Conversation

@developerkunal

@developerkunal developerkunal commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🔧 Changes

Add first-class Auth0 Forms management to the CLI:

  • Add forms list, show, create, update, delete, open, export, and import.
  • Support interactive prompts, JSON/CSV output, and non-interactive automation.
  • Provide JSON payloads through --data as inline JSON, a file (@form.json), or piped stdin. On create and update the payload is validated against the OpenAPI schema before it is sent, and it cannot be combined with the scalar flags (--name, --language-*). Bodies are sent as raw JSON so STEP/ROUTER node config is preserved instead of being dropped by the typed request models.
  • Make interactive creation lightweight:
    • auth0 forms create prompts for a name and creates a minimal scaffold.
    • auth0 forms create --edit opens the complete JSON body in an editor.
    • auth0 forms create --example prints an embedded example body suitable for --data.
    • auth0 forms create --schema and auth0 forms update --schema print the accepted request payload schema.
  • forms import accepts both a flat form graph and the Dashboard envelope (version, form, flows, connections), creating the bundled flows and mapping each #CONN-N# placeholder to a vault connection (interactively or with --connection).
  • Open Forms directly in the Auth0 Dashboard builder with forms open, reusing the shared builder-URL helpers that the Flows commands use.

Additional updates:

  • Require --force for Forms deletion in agent mode.
  • Add the required Forms Management API scopes.

🔬 Testing

  • Unit tests, go vet, and lint pass.
  • Command docs regenerated with make docs and verified in sync.
  • Integration test cases were updated to use --data. The integration suite runs against a live tenant, so those updated cases have not been re-run since the --data migration.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests.
  • I have added documentation for all new/changed functionality.

@developerkunal
developerkunal requested a review from a team as a code owner August 24, 2026 08:45
@developerkunal
developerkunal marked this pull request as draft September 2, 2026 12:38
# Conflicts:
#	README.md
#	docs/index.md
#	internal/auth/auth.go
#	internal/auth0/auth0.go
#	internal/cli/root.go
#	test/integration/scripts/test-cleanup.sh
Replace the forms-specific --file/-f flag with the common --data input layer
(inline JSON, @file.json, or piped stdin) that create and update validate
against the OpenAPI schema, mirroring how the other resource commands work.
Forms still send the body as raw JSON so STEP/ROUTER node config the v3 union
types would drop is preserved.

Also remove now-redundant code: forms now reuse the shared openBuilderURL and
formatBuilderPageURL helpers instead of their own copies, and formRawUpdate
strips server-managed fields through the shared stripFormServerManagedFields
helper. Update the integration test cases and regenerate the command docs.
@developerkunal
developerkunal marked this pull request as ready for review September 8, 2026 07:19
developerkunal and others added 4 commits September 8, 2026 14:39
The published OpenAPI schema cannot faithfully describe a real form graph:
its FormNodePointer oneOf is non-exclusive, so the reserved "$ending" pointer
that every real form uses matches two branches and fails validation. This is the
same lossiness that already makes Forms send raw JSON. Validating the node graph
against that schema rejected valid forms, including the shipped --example body.

Forms --data now checks only what is trustworthy locally (valid JSON object, and a
name on create) and sends the body verbatim; the API validates the graph. Updates
the integration assertions for the new messages.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.51439% with 339 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.31%. Comparing base (86b69ea) to head (824f19b).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
internal/cli/forms.go 67.22% 174 Missing and 62 partials ⚠️
internal/cli/forms_envelope.go 68.07% 66 Missing and 17 partials ⚠️
internal/display/forms.go 85.21% 15 Missing and 2 partials ⚠️
internal/cli/terraform_fetcher.go 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1626      +/-   ##
==========================================
+ Coverage   60.60%   61.31%   +0.70%     
==========================================
  Files         135      151      +16     
  Lines       26385    30252    +3867     
==========================================
+ Hits        15991    18548    +2557     
- Misses       9407    10468    +1061     
- Partials      987     1236     +249     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ramya18101
ramya18101 merged commit 42b391b into main Sep 9, 2026
6 checks passed
@ramya18101
ramya18101 deleted the feat/forms-management branch September 9, 2026 11:06
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.

4 participants