Skip to content

fix(api-portal): make API workflow description optional - #3106

Open
sanjulaonline wants to merge 2 commits into
wso2:mainfrom
sanjulaonline:fix/3082-optional-workflow-description
Open

fix(api-portal): make API workflow description optional#3106
sanjulaonline wants to merge 2 commits into
wso2:mainfrom
sanjulaonline:fix/3082-optional-workflow-description

Conversation

@sanjulaonline

@sanjulaonline sanjulaonline commented Aug 3, 2026

Copy link
Copy Markdown

Purpose

The API Workflow wizard treated Description as mandatory even though workflow
descriptions should be optional. It blocked users in two places:

  • Step-one validation prevented advancing through the wizard.
  • Final-save validation rejected an empty description.

The field was also displayed with a required indicator.

Fixes #3082

Goals

Allow an API Workflow to be created or updated without a description, consistent
with the existing optional API-description behavior.

Approach

  • Removed the required indicator and obsolete required-field feedback from the
    Description field.
  • Removed Description from both blocking wizard validation paths.
  • Kept Name, agent prompt, workflow content, and advisory description guidance
    unchanged.
  • Added a Cypress regression test that creates and lists a workflow with an empty
    description.
  • Updated the preview guidance and readiness state to depend on Name only, so an
    omitted optional Description is no longer presented as incomplete.

The client continues sending description: "". The existing OpenAPI request
schema accepts it because the property has no minLength, and the existing
NOT NULL database column stores an empty string. No API contract, service, or
schema change is required.

User stories

As a portal administrator, I can create an API Workflow without providing a
description.

Documentation

N/A — this corrects form validation and does not change a documented API or
configuration surface.

Automation tests

  • Unit tests

    No new unit test was added because this behavior is exercised through the
    browser workflow.

  • Integration tests

    Added 003-api-workflows.cy.js, covering creation with an empty description.
    The test fails before the fix because the wizard cannot leave step one and
    passes afterward. The test also verifies the readiness state and reopens the
    saved workflow to confirm the empty description persisted.

Verification performed:

  • New Cypress spec: fails before the fix and passes after it.
  • Full settings Cypress suite: 4/4 tests passed.
  • Scoped ESLint: passed with no findings.
  • API Portal and Platform API Docker builds: passed.
  • Existing Node tests: 83 passed and 6 pre-existing failures, identical to the
    unchanged baseline.

The REST API suite was not run because this change does not modify the workflow
API contract or service.

Security checks

Samples

N/A

Related PRs

N/A. Commit cc8d6b584 made API descriptions optional; this change applies the
same behavior to API Workflows.

Test environment

  • Node.js v24.9.0
  • npm 11.6.0
  • Docker 28.4.0 / Compose 2.39.2
  • Cypress 13.17.0, headless Electron, SQLite integration fixture

Remove Description from both blocking wizard validations and drop its
required indicator. The client continues sending an empty string, which
is accepted by the existing API contract and database schema.

Add Cypress coverage that creates an API Workflow without a description.

Fixes wso2#3082
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

API workflow descriptions are now optional in the form and validation logic. A Cypress test creates a workflow without a description, verifies it, and removes it through the API.

Changes

API workflow description validation

Layer / File(s) Summary
Optional description validation
portals/api-portal/src/pages/settings/partials/create-api-workflow.hbs, portals/api-portal/src/scripts/manage-api-workflows.js
The form removes required-description indicators and feedback. Save and wizard validation no longer require a description.
Empty-description workflow coverage
portals/api-portal/it/ui/cypress/e2e/settings/003-api-workflows.cy.js
The Cypress test creates and verifies a workflow without a description, then deletes it through the API.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Cypress
  participant WorkflowWizard
  participant WorkflowAPI
  Cypress->>WorkflowWizard: Enter workflow data without a description
  WorkflowWizard->>WorkflowAPI: Save API workflow
  WorkflowAPI-->>Cypress: Return saved workflow
  Cypress->>WorkflowAPI: Delete test workflow
Loading

Possibly related PRs

  • wso2/api-platform#3062: Both changes update API workflow description validation and add coverage for optional descriptions.
  • wso2/api-platform#2900: Both changes add Cypress end-to-end test coverage in the API platform.

Suggested reviewers: lasanthas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #3082 by making API workflow descriptions optional in the Developer Portal UI and adding regression coverage.
Out of Scope Changes check ✅ Passed The changes are limited to UI validation updates and a related Cypress regression test for optional API workflow descriptions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely states the main change: making the API workflow description optional.
Description check ✅ Passed The description covers the required sections, explains the change, documents testing, and identifies security, documentation, and environment details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@portals/api-portal/it/ui/cypress/e2e/settings/003-api-workflows.cy.js`:
- Around line 85-88: Extend the successful-save assertions around the
api-workflow edit flow to reopen the saved workflow using the existing
WORKFLOW_HANDLE selector, then verify that `#apiWorkflowDescription` has an empty
value. Keep the current listing assertions and ensure the check validates the
persisted value after loading the edit form.

In `@portals/api-portal/src/pages/settings/partials/create-api-workflow.hbs`:
- Line 75: Update the preview and readiness messaging associated with the
Description field so they no longer state that a description is required. Keep
the workflow validation behavior unchanged and ensure empty Description values
are presented as valid rather than requiring additional input.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: adc6a540-ea7b-4927-9822-4023dcdd1f21

📥 Commits

Reviewing files that changed from the base of the PR and between e498dd0 and 4814854.

📒 Files selected for processing (3)
  • portals/api-portal/it/ui/cypress/e2e/settings/003-api-workflows.cy.js
  • portals/api-portal/src/pages/settings/partials/create-api-workflow.hbs
  • portals/api-portal/src/scripts/manage-api-workflows.js
💤 Files with no reviewable changes (1)
  • portals/api-portal/src/scripts/manage-api-workflows.js

Update the preview guidance and readiness state to depend on the workflow
name only. Extend the Cypress test to verify readiness and confirm that an
empty description persists when the workflow is reopened.

Related to wso2#3082
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.

[Improvement]: Description is Mandated in API Workflows

1 participant