Skip to content

[Workspace] Allow custom ID to be specified on workspace creation - #11631

Open
nicklas-dohrn wants to merge 3 commits into
opensearch-project:mainfrom
nicklas-dohrn:feature/workspace-custom-id
Open

[Workspace] Allow custom ID to be specified on workspace creation#11631
nicklas-dohrn wants to merge 3 commits into
opensearch-project:mainfrom
nicklas-dohrn:feature/workspace-custom-id

Conversation

@nicklas-dohrn

@nicklas-dohrn nicklas-dohrn commented Mar 31, 2026

Copy link
Copy Markdown

Description

Adds an optional id field to the workspace creation flow — both via the API and the creation UI.

  • API: POST /api/workspaces now accepts attributes.id. When provided, it is used as the workspace ID instead of the auto-generated 6-char base64url value. Must be a UUID or 6–20 alphanumeric/_/- characters. Returns an error if the ID is already taken.
  • UI: A new optional "Workspace ID" field is shown on the creator form with a tooltip explaining the allowed formats. Validation mirrors the server-side rules.

Screenshot of the UI

Screenshot 2026-06-29 at 17 37 01

Related documentation:

Testing the changes

  • Creates workspace with valid custom ID via UI and API
  • Creates workspace without custom ID (falls back to auto-generated)
  • Returns error when workspace with provided ID already exists
  • Returns 400 for invalid ID (too short, too long, invalid chars)

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

Comment thread changelogs/fragments/11631.yml Outdated
@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from c5ddfd2 to dd0970c Compare June 29, 2026 15:17
nicklas-dohrn added a commit to nicklas-dohrn/OpenSearch-Dashboards that referenced this pull request Jun 29, 2026
- Allows callers to pass an `id` field in workspace creation attributes
- Validates the custom ID: must be a UUID or 6–20 alphanumeric/hyphen/underscore characters
- Returns HTTP 400 with a descriptive error when the format is invalid
- Checks for duplicate ID and returns HTTP 400 if a workspace with that ID already exists
- Adds changelog fragment for PR opensearch-project#11631

Signed-off-by: nicklas dohrn <nicklas.dohrn@sap.com>
Signed-off-by: Dohrn <nicklas.dohrn@sap.com>
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit dd0970c

@nicklas-dohrn
nicklas-dohrn marked this pull request as ready for review June 29, 2026 15:25
nicklas-dohrn added a commit to nicklas-dohrn/OpenSearch-Dashboards that referenced this pull request Jun 29, 2026
- Allows callers to pass an `id` field in workspace creation attributes
- Validates the custom ID: must be a UUID or 6–20 alphanumeric/hyphen/underscore characters
- Returns HTTP 400 with a descriptive error when the format is invalid
- Checks for duplicate ID and returns HTTP 400 if a workspace with that ID already exists
- Adds changelog fragment for PR opensearch-project#11631

Signed-off-by: nicklas dohrn <nicklas.dohrn@sap.com>
Signed-off-by: Dohrn <nicklas.dohrn@sap.com>
Signed-off-by: nicklas-dohrn <nicklas.dohrn@sap.com>
@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from dd0970c to 0bfff47 Compare June 29, 2026 15:33
nicklas-dohrn added a commit to nicklas-dohrn/OpenSearch-Dashboards that referenced this pull request Jun 29, 2026
- Allows callers to pass an `id` field in workspace creation attributes
- Validates the custom ID: must be a UUID or 6–20 alphanumeric/hyphen/underscore characters
- Returns HTTP 400 with a descriptive error when the format is invalid
- Checks for duplicate ID and returns HTTP 400 if a workspace with that ID already exists
- Adds changelog fragment for PR opensearch-project#11631

Signed-off-by: nicklas-dohrn <nicklas.dohrn@sap.com>
@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from 0bfff47 to ab7fe77 Compare June 29, 2026 15:34
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit ab7fe77

@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from ab7fe77 to 88fe22d Compare June 29, 2026 15:36
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit ab7fe77

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 88fe22d

@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from 88fe22d to 653e89d Compare June 29, 2026 15:39
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 653e89d

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit d16f160

@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from d16f160 to 1ec36a7 Compare July 13, 2026 08:41
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 1ec36a7

@nicklas-dohrn

Copy link
Copy Markdown
Author

@SuZhou-Joe and @Hailong-am,
I would really appreciate another look here, Added both docs and UI changes if wanted,
all is tested and working.
If we only want to have the api change, that would be fine for me, just thought this would be nice as full integration.

- Allows callers to pass an `id` field in workspace creation attributes
- Validates the custom ID: must be a UUID or 6–20 alphanumeric/hyphen/underscore characters
- Returns HTTP 400 with a descriptive error when the format is invalid
- Checks for duplicate ID and returns HTTP 400 if a workspace with that ID already exists

Signed-off-by: nicklas-dohrn <nicklas.dohrn@sap.com>
Exposes the custom workspace ID on the creation form so users
can set it from the UI without needing the API directly.

- Adds a `WorkspaceIdField` component with a tooltip listing
  the accepted formats (UUID or 6–20 alphanumeric/hyphen/underscore)
- Validates the ID client-side against the same rules as the server,
  blocking submission and showing an inline error for invalid values
- Clears the validation error on any keystroke so deleting the value
  re-enables auto-generation without a stale error
- Threads `customId` through `WorkspaceFormSubmitData`,
  `useWorkspaceForm`, and `WorkspaceCreator` to the API call
- Adds `InvalidWorkspaceId` error code and callout entry

Signed-off-by: nicklas-dohrn <nicklas.dohrn@sap.com>
Signed-off-by: nicklas-dohrn <nicklas.dohrn@sap.com>
@nicklas-dohrn
nicklas-dohrn force-pushed the feature/workspace-custom-id branch from 1ec36a7 to d23bb25 Compare July 13, 2026 14:42
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit d23bb25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants