bug: Attribute uniqueness constraints are not caught by constraint validators #4025
Labels
group/backend
Issue related to the backend (API Server, Git Agent)
type/bug
Something isn't working as expected
Milestone
Component
API Server / GraphQL, Git Integration
Infrahub version
0.15.2
Current Behavior
Uniqueness constraints for node attributes aren't properly handled within the CI for a proposed change, as a result it's possible to merge a proposed change where the change would introduce a violation within the
main
branch.Expected Behavior
When you have a model with an attribute uniqueness constraint such as
.name
on BuiltinTag it should not be possible to merge a proposed change if you have created a new branch and then created the same tag both in that branch and in the main branch. However this is currently possible.Steps to Reproduce
Additional Information
The query that finds these nodes look like this:
The problem seems to be that
$time0
contains the timestamp from whenbranch1
was created as such we will never see any entries within the main branch that were created after the branch was created.The text was updated successfully, but these errors were encountered: