-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Copy link
Labels
User StoryUser Story ticketUser Story ticket
Description
Description
Implement backend functionality to support a global versionPattern configuration for system-wide version validation. This includes validation enforcement, precedence rules with package-level patterns, and error handling.
Requirements
Global Configuration
- Allow system administrators to configure a global
versionPatternvia API and UI. - This pattern applies system-wide to all version validations (draft, release, archived).
Validation Rules
- Apply the Global Version Pattern validation to Draft, Release, and Archived statuses.
- For versions with Release status, enforce both the global
versionPatternand package-levelreleaseVersionPatternif exists and if the Package-levelreleaseVersionPatternis empty, skip this validation. - The global regex defines the baseline constraints.
- Package-level regex can only restrict further and cannot loosen or override global constraints.
- If the global regex disallows certain characters or patterns, the package-level regex cannot re-enable them.
Default Pattern
- The
versionPatterncannot be empty. - By default, apply a regex allowing:
- Uppercase letters
A–Z, lowercase lettersa–z, digits0–9 - Underscore
_, period., tilde~, hyphen-, and space
- Uppercase letters
- Version names must not start or end with a space and must contain at least one non-space character.
Enforcement on Update
- New or updated
versionPatternapplies to all newly created version names only. - Existing versions remain unaffected.
Regex Validation
- Upon clicking Save, validate the syntax of the entered
versionPatternusing standard regex compilation (similar to the behavior of the Release Version Pattern field). - If the regex is invalid (i.e., fails to compile), reject the input and display the following error message:
"Version Pattern '<pattern>' has invalid pattern format."
Example:"Version Pattern '[a-Z]' has invalid pattern format."
API Design
- Need to implement new API to update the
versionPatternparameter. - Need to update existing API to include the
versionPatternparameter in its response for retrieving current configuration details. - Please refer to the associated PR-111 for implementation details and API specifications.
Metadata
Metadata
Assignees
Labels
User StoryUser Story ticketUser Story ticket
Type
Projects
Status
Ready for Dev