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: Relationship issue with kind Component and cardinality: many across branches #4598

Closed
BeArchiTek opened this issue Oct 10, 2024 · 0 comments
Labels
group/frontend Issue related to the frontend (React) type/bug Something isn't working as expected

Comments

@BeArchiTek
Copy link
Contributor

Component

Frontend UI

Infrahub version

0.16.2

Current Behavior

There is an issue with handling relationships of kind: Component and cardinality: many when working across different branches. The problem occurs when creating or editing nodes with such relationships in a branch, resulting in node not found errors or updates being applied to the wrong branch.

Expected Behavior

Nodes with relationships of kind: Component and cardinality: many should be correctly linked to their components in the branch context.
Modifications to nodes in a branch should remain within that branch and not affect the main branch.

Steps to Reproduce

Using this schema :

version: '1.0'
nodes:
  - name: Test
    namespace: Random
    attributes:
      - name: name
        kind: Text
    relationships:
      - name: tags
        peer: BuiltinTag
        cardinality: many
        kind: Component
  1. On the main branch, create a "Test" node (e.g., "test1") with a relationship of kind: Component and cardinality: many (for example, tags or other components).
  2. Add a related component (e.g., a "red" tag).
  3. Switch to a new branch (e.g., "branch1").
  4. Create a new "Test" node (e.g., "test2") and add a new related component (e.g., a "blue" tag) using the second-level form.
  5. Issue: The new component (tag) is created, but when trying to associate it with "test2," the error "could not find node in database" appears.
  6. On branch1, attempt to edit "test1" (from main) by adding another related component (e.g., "tag2" or another type of component from main).
  7. Issue: The update is accepted, but instead of being applied to "branch1," it is incorrectly applied to the main branch.

Additional Information

The issue doesn't seem present with kind: Component and cardinality: one
The issue doesn't seem present with kind: Attribute and cardinality: one or cardinality: many

@BeArchiTek BeArchiTek added type/bug Something isn't working as expected group/frontend Issue related to the frontend (React) labels Oct 10, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 0.16.3 milestone Oct 11, 2024
@pa-lem pa-lem closed this as completed Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/frontend Issue related to the frontend (React) type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants