Skip to content

EDM-3544 align config name validations#588

Open
celdrake wants to merge 2 commits intoflightctl:mainfrom
celdrake:EDM-3544-align-config-name-validations
Open

EDM-3544 align config name validations#588
celdrake wants to merge 2 commits intoflightctl:mainfrom
celdrake:EDM-3544-align-config-name-validations

Conversation

@celdrake
Copy link
Copy Markdown
Collaborator

@celdrake celdrake commented Mar 24, 2026

Some validations where incorrect or incomplete.

  • Application names and volumes names: length was not being checked (should be 253)
  • Configuration names: should use genericName which doesn't accept dots. Max length: 63
  • Unified the labelling of the "dash/hyphen" character as "hyphen"

Summary by CodeRabbit

  • Documentation

    • Updated validation messages to use consistent terminology ("hyphens" instead of "dashes") for clarity.
  • Improvements

    • Standardized naming validation rules across the application for consistency.
    • Simplified validation constraints for configuration template source names.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Walkthrough

This pull request standardizes validation terminology and consolidates validation schemas. It replaces "dashes (-)" with "hyphens (-)" across localization strings and validation messages, introduces new generic name validation constants and functions, and refactors existing validators to use a unified GENERIC_NAME_REGEXP pattern with configurable length limits. One component's validation is simplified by removing DNS subdomain validation.

Changes

Cohort / File(s) Summary
Localization & Error Messages
libs/i18n/locales/en/translation.json, libs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.ts
Updated validation error terminology from "dashes" to "hyphens" across translation strings and error messages; adjusted template variable from {{ max }} to {{ maxLength }}; added new "Name is required" translation key.
Validation Schema Consolidation
libs/ui-components/src/components/form/validations.ts
Introduced new length constants (GENERIC_NAME_MAX_LENGTH, EXTENDED_MAX_LENGTH, MAX_TARGET_REVISION_LENGTH); renamed APPLICATION_NAME_REGEXP to GENERIC_NAME_REGEXP; added new validGenericName(t) and genericNameSchema(t) validators; refactored validApplicationAndVolumeName(), validHelmNamespace(), validConfigTemplatesSchema(), and related validators to use the unified generic-name pattern with explicit length constraints.
Component Validation Simplification
libs/ui-components/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx
Replaced RichValidationTextField with TextField for the configuration template name field, removing DNS subdomain validation while preserving disabled state and required indicator.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly reflects the main objective to align and correct configuration name validations across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
libs/i18n/locales/en/translation.json (1)

1012-1022: Reminder: Regenerate translations instead of manual edits.

These translation updates align correctly with the source code changes in validations.ts. However, as per coding guidelines, translation.json should be regenerated using npm run i18n rather than edited manually. Please ensure these changes were made by running the i18n script, or run it now to verify consistency.

As per coding guidelines: "Do not manually edit translation.json in libs/i18n/locales/en/; regenerate with npm run i18n by adding or fixing keys in source code."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/i18n/locales/en/translation.json` around lines 1012 - 1022, The
translation.json changes should not be edited by hand; run the i18n generation
instead: update any keys/messages in the source validation code (look for
validations.ts where these messages originate), then execute the project i18n
script (npm run i18n) to regenerate libs/i18n/locales/en/translation.json so the
file is consistent with validations.ts and CI linting rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@libs/i18n/locales/en/translation.json`:
- Around line 1012-1022: The translation.json changes should not be edited by
hand; run the i18n generation instead: update any keys/messages in the source
validation code (look for validations.ts where these messages originate), then
execute the project i18n script (npm run i18n) to regenerate
libs/i18n/locales/en/translation.json so the file is consistent with
validations.ts and CI linting rules.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c391be60-121d-4b38-9a39-a1ee02fcc126

📥 Commits

Reviewing files that changed from the base of the PR and between ce99b51 and 597b0e6.

📒 Files selected for processing (4)
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.ts
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx
  • libs/ui-components/src/components/form/validations.ts

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.

1 participant