Skip to content
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

bug: data conflict between branches is not being detected #4595

Open
wvandeun opened this issue Oct 10, 2024 · 1 comment · May be fixed by #4667
Open

bug: data conflict between branches is not being detected #4595

wvandeun opened this issue Oct 10, 2024 · 1 comment · May be fixed by #4667
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) state/planned This issue is planned to be worked on in an upcoming release. type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.0.0.dev.0

Current Behavior

Data conflicts between branches don't always seem to be properly detected. This leads to situations where we can rebase branch with a data conflict or even that we can merge them when we should not be able to.

Expected Behavior

Data conflicts are properly reported and the user is given an option to resolve them. As long as there is a conflict, we should not be able to merge or rebase a branch

Steps to Reproduce

  • load an instance of Infrahub
  • create a branch
  • in the branch create a BuiltinTag node with name orange
  • switch to the main branch
  • in the branch create a BuiltinTag node with name orange
  • open a proposed change for the earlier created branch
  • generate the data diff, no conflict will be detected, there should be a conflict because we create an object with the same name, breaking the uniqueness constraint on a "BuiltinTag"
  • The data integrity check will report a data conflict
  • Rebase the branch (this should not be possible because of the conflict)
  • Merge the proposed change (this should not be possible)

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Oct 10, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 0.16.3 milestone Oct 10, 2024
@exalate-issue-sync exalate-issue-sync bot removed the group/backend Issue related to the backend (API Server, Git Agent) label Oct 10, 2024
@dgarros dgarros added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 11, 2024
@exalate-issue-sync exalate-issue-sync bot added the state/planned This issue is planned to be worked on in an upcoming release. label Oct 16, 2024
Copy link

[From ajtmccarty]

after investigating this some more I found that we do correctly identify uniqueness constraint violations within the proposed change pipeline as part of the schema integrity checks. we don’t know why these checks failed to run for Wim during his testing

however, there are still outstanding problems documented in this issue. we allow rebasing and merging a branch that has uniqueness violations or data conflicts, which will cause the database to contain unexpected data. before rebasing or merging a branch, we need to check for uniqueness constraint violations and data conflicts and raise an error if either exists

@ajtmccarty ajtmccarty linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) state/planned This issue is planned to be worked on in an upcoming release. type/bug Something isn't working as expected
Projects
None yet
3 participants