Skip to content

ISSUE-715: Validate pipeline name length in UI (max 124 characters)#763

Open
cordeirops wants to merge 1 commit intokubeflow:mainfrom
cordeirops:issue715
Open

ISSUE-715: Validate pipeline name length in UI (max 124 characters)#763
cordeirops wants to merge 1 commit intokubeflow:mainfrom
cordeirops:issue715

Conversation

@cordeirops
Copy link
Copy Markdown
Contributor

@cordeirops cordeirops commented Apr 15, 2026

Summary

Fixes #715.

Pipeline names longer than 124 characters cause a runtime error in KFP. Previously there was no UI-level validation, so users only discovered the limit after a failed pipeline run with a cryptic error.

Changes

labextension/src/components/Input.tsx

  • Added optional maxLength?: number and maxLengthErrorMsg?: string props to IInputProps
  • When value.length > maxLength, the field enters error state: label, input text, and helper text all render in red
  • getErrorMessage() surfaces the length error with priority over regex errors, since it is the more actionable fix
  • Soft-validation approach (show error, do not hard-block input) is intentional — consistent with existing regex validation and allows paste-then-edit workflows

labextension/src/widgets/LeftPanel.tsx

  • Pass maxLength={124} and maxLengthErrorMsg to the Pipeline Name field
  • Extended pipelineNameValid to include length <= 124 so the compile/run button is disabled for over-limit values — this also covers names pre-populated from existing notebook metadata that were saved before this validation existed

Behaviour

Scenario Before After
Typing a name > 124 chars No feedback Error state on field, button disabled
Pasting a name > 124 chars No feedback Error state on field, button disabled
Opening notebook with saved name > 124 chars No feedback until runtime error Error state on field, button disabled
Submitting pipeline with valid name Works Unchanged
Screenshot 2026-04-15 at 10 16 43

Test plan

  • Type a pipeline name longer than 124 characters — field shows red label, red text, red error message, compile button disabled
  • Reduce the name to ≤ 124 characters — error clears, button re-enables
  • Paste a 200-character string — same error behaviour as typing
  • Open a notebook whose metadata contains a pipeline_name longer than 124 characters — error shown on load
  • Existing regex validation (invalid characters) still works as before

@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ederign for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown
Collaborator

@ada333 ada333 left a comment

Choose a reason for hiding this comment

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

I tried it out and works good, thanks!
I have only one suggestion otherwise LGTM

Comment thread labextension/src/widgets/LeftPanel.tsx Outdated
const pipelineNameValid =
/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/.test(
this.state.metadata.pipeline_name,
) && this.state.metadata.pipeline_name.length <= 124;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would make the 124 as a constant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can you take another look at this? I just implemented it in the last commit

Copy link
Copy Markdown
Collaborator

@jesuino jesuino left a comment

Choose a reason for hiding this comment

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

LGTM!

Tested locally and works as expected.

THanks again for your contribution, @cordeirops

Pipeline names longer than 124 characters cause a runtime error when
submitting to KFP. Previously there was no UI-level length check, so
users only discovered the limit after a failed pipeline run.

Changes:
- Input component: add optional `maxLength` and `maxLengthErrorMsg` props.
  When `value.length > maxLength` the field enters error state, renders
  the label, input text, and helper text in red, and shows the error
  message. Priority is given to the length error over regex errors so the
  most actionable message is always surfaced first.
- LeftPanel: pass `maxLength={124}` and a human-readable error message to
  the Pipeline Name field. Also extend `pipelineNameValid` to include the
  length check so the compile/run button is disabled for over-limit values
  (covers names pre-populated from existing notebook metadata).

The soft-validation approach (show error, do not hard-block input) is
intentional: it is consistent with how the existing regex validation
works and gives the user feedback while allowing paste-then-edit workflows.

Closes kubeflow#715

Signed-off-by: Pedro Sbaraini Cordeiro <pedro.sbarainicordeiro@gmail.com>
@cordeirops
Copy link
Copy Markdown
Contributor Author

Thanks @ada333 and @jesuino!

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.

[feature] Add character length to pipeline name validation

3 participants