Skip to content

fix: reject duplicate skill sources#7295

Draft
calvinmclean wants to merge 1 commit into
obot-platform:mainfrom
calvinmclean:fix/7272-unique-skills
Draft

fix: reject duplicate skill sources#7295
calvinmclean wants to merge 1 commit into
obot-platform:mainfrom
calvinmclean:fix/7272-unique-skills

Conversation

@calvinmclean

Copy link
Copy Markdown
Contributor

Addresses #7272

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #7272 by enforcing uniqueness for Skill Sources (Skill Repositories) on both the backend API and UI, preventing duplicate display names and duplicate repository URLs and surfacing clearer validation errors in the admin Skills page.

Changes:

  • Add server-side validation to reject creating/updating a Skill Source when another source already uses the same displayName or normalized repoURL (409 Conflict).
  • Improve admin UI error display by parsing API error payloads/messages into a user-facing message.
  • Add handler tests covering duplicate-name and duplicate-URL rejection, and ensuring updates can keep their own name/URL.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ui/user/src/routes/admin/skills/+page.svelte Uses parseErrorContent() so validation/conflict errors are shown as clean user-facing messages.
pkg/api/handlers/skills_test.go Adds coverage for duplicate Skill Source name/URL rejection on create/update, and allows self-update.
pkg/api/handlers/skillrepositories.go Adds validateUniqueSkillRepository and wires it into create/update flows to enforce uniqueness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants