visevol / GithubVisualisation

PFE028 Été 2024
MIT License
0 stars 1 forks source link

[Backend] Prevent creation of duplicated repositories on the same domain #28

Closed zergov closed 1 week ago

zergov commented 1 week ago

Closes: https://github.com/visevol/GihubVisualisation/issues/16

This PR adds a validation that prevents the creation of duplicated Repository on the same domain.

For example:

# not allowed ❌
Repository.create!(name: "duplicated_repo", domain: "github.com", path: "/example/duplicated_repository")
Repository.create!(name: "duplicated_repo", domain: "github.com", path: "/example/duplicated_repository")

# allowed ✅
Repository.create!(name: "duplicated_repo", domain: "github.com", path: "/example/duplicated_repository")
Repository.create!(name: "duplicated_repo", domain: "gitlab.com", path: "/example/duplicated_repository")