-
Notifications
You must be signed in to change notification settings - Fork 728
chore: improve api error messages (CM-855) #3713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
2 similar comments
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
| if (data.name || data.slug) { | ||
| await this.validateUpdateDuplicates(id, segment, data, segmentRepository) | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Update validation misses slug conflicts from isLF transformation
When updating a segment, validateUpdateDuplicates skips slug validation if data.slug === segment.slug (line 735). However, the slug is subsequently transformed by validateNonLfSlug when isLF changes to false (line 54). The transformed slug (with nonlf_ prefix) is never validated for conflicts. This allows creating duplicate slugs when a user updates a segment with the same slug value but changes isLF from true to false, potentially colliding with an existing segment that already has the nonlf_-prefixed version of that slug.
Changes
Repositories already mapped to other projects
Trying to update gitlab repo ${row.url} mapping with integrationId ${integrationId} but it is already mapped to integration ${row.integrationId}!Creating segments with names or slugs that already exist
Sub-project with slug "{0}" already exists in project {1}.,Project with slug "{0}" already exists in project group {1}.,Project Group with slug "{0}" already exists.,Sub-project {0} already exists in project {1}.,Project {0} already exists in project group {1}.,Project Group {0} already exists.Note
Adds checks to prevent mapping the same repo to multiple integrations and introduces centralized validation for duplicate segment names/slugs with specific error messages.
Error400('errors.integrations.repoAlreadyMapped', ...)if a repo is already linked to anotherintegrationId.errors.integrations.repoAlreadyMapped.name/slugacross levels (project group/project/sub-project), including LF vs non-LF slug variants; used on create and update.validateSegmentConflicts,throwSegmentConflictError,validateUpdateDuplicates,getSegmentType; repository methodfindByName.Written by Cursor Bugbot for commit 9ff86dd. This will update automatically on new commits. Configure here.