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: cannot delete a parent node when it inherits a component relationship from a generic #4780

Open
wvandeun opened this issue Oct 30, 2024 · 0 comments · May be fixed by #5538
Open

bug: cannot delete a parent node when it inherits a component relationship from a generic #4780

wvandeun opened this issue Oct 30, 2024 · 0 comments · May be fixed by #5538
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected
Milestone

Comments

@wvandeun
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.0.0.dev.0

Current Behavior

If you have a schemanode that inherits from a generic that defines a relationship of kind "Component". Then you will be unable to delete the parent node.
You are unable to delete the parent node because it seems that the cascading delete of related nodes doesn't seem to properly work in this case. Hence we violate the requirement of the parent relationship in the other direction.

Expected Behavior

You are able to delete nodes, that inherit component relationships from a generic

Steps to Reproduce

  • load instance of Infrahub
  • load this schema
---
version: "1.0"
generics:
  - name: InterfaceHolder
    namespace: Infra
    relationships:
      - name: interfaces
        kind: Component
        cardinality: many
        optional: true
        peer: InfraInterface
nodes:
  - name: Device
    namespace: Infra
    inherit_from:
      - InfraInterfaceHolder
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
  - name: Interface
    namespace: Infra
    attributes:
      - name: name
        kind: Text
        unique: true
        optional: false
    relationships:
      - name: device
        kind: Parent
        peer: InfraDevice
        optional: false
        cardinality: one
  • create a device node
  • create an interface node, set device to the previously created device node
  • try to remove the device node

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 30, 2024
@exalate-issue-sync exalate-issue-sync bot added priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release and removed priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release labels Oct 30, 2024
@exalate-issue-sync exalate-issue-sync bot added the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Oct 31, 2024
@opsmill opsmill deleted a comment from exalate-issue-sync bot Dec 10, 2024
gmazoyer added a commit that referenced this issue Jan 21, 2025
gmazoyer added a commit that referenced this issue Jan 21, 2025
gmazoyer added a commit that referenced this issue Jan 22, 2025
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) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants