Skip to content

Conversation

@zubron
Copy link
Contributor

@zubron zubron commented Nov 6, 2025

Closes #5251

Change Description

Background

The UI for adding metadata fields allowed empty key-value pairs to be added. This is different from the CLI behaviour which filters them. While we plan to add server-side validation to forbid empty metadata keys in a future update, for now, we want to provide client-side validation to give immediate user feedback and avoid unnecessary API calls that would fail validation.

Bug Fix

Add client-side validation to prevent form submission (commit, merge, import) when metadata keys are empty or whitespace-only.

Fields are marked as invalid when:

  • User blurs an empty key input
  • Form is submitted with empty keys

Invalid fields display "Key is required" error message.

Screenshot 2025-11-18 at 2 23 02 PM Screenshot 2025-11-18 at 2 23 39 PM

Testing Details

Added component tests using React Testing Library to verify validation behaviour.
Also performed manual testing to verify behaviour when interacting with many fields.

@zubron zubron force-pushed the fix/empty-metadata-keys-are-allowed-5251 branch 2 times, most recently from 8047280 to 5acff90 Compare November 17, 2025 21:19
@zubron zubron added area/UI Improvements or additions to UI include-changelog PR description should be included in next release changelog labels Nov 17, 2025
@zubron zubron changed the title Filter empty key-value metadata pairs in UI Prevent submission of empty metadata keys Nov 17, 2025
@zubron zubron force-pushed the fix/empty-metadata-keys-are-allowed-5251 branch 4 times, most recently from 33df7ec to 19508be Compare November 18, 2025 19:20
@zubron zubron changed the title Prevent submission of empty metadata keys Enforce non-empty metadata keys in forms Nov 18, 2025
@zubron zubron marked this pull request as ready for review November 18, 2025 19:31
Add client-side validation to prevent form submission (commit, merge,
import) when metadata keys are empty or whitespace-only.

Fields are marked invalid when:
- User blurs an empty key input
- Form is submitted with empty keys

Invalid fields display "Key is required" error message.

Added component tests using React Testing Library to verify validation
behavior.

Closes #5251
@zubron zubron force-pushed the fix/empty-metadata-keys-are-allowed-5251 branch from 19508be to 47c9992 Compare November 18, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/UI Improvements or additions to UI include-changelog PR description should be included in next release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: On commit - empty metadata keys are allowed

1 participant