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: removing a relationship from a generic does not remove the relationship from the nodes inheriting from the generic #4301

Closed
wvandeun opened this issue Sep 9, 2024 · 1 comment
Assignees
Labels
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

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Sep 9, 2024

Component

API Server / GraphQL

Infrahub version

0.16.0.dev0

Current Behavior

When you delete a relationship from a generic in the schema, the relationship does not get removed from the nodes in the schema that inherit from the generic.

Expected Behavior

The relationship would be removed from the nodes inheriting from the generic

Steps to Reproduce

  • start Infrahub instance
  • load this schema
---
version: "1.0"
generics:
  - name: Generic
    namespace: Infra
    attributes:
      - name: description
        kind: Text
        optional: true
    relationships:
      - name: other_thing
        peer: InfraOtherThing
        kind: Attribute
        cardinality: one
        optional: true
nodes:
  - name: Thing
    namespace: Infra
    label: Thing
    inherit_from:
      - InfraGeneric
    attributes:
      - name: name
        label: Name
        kind: Text
        optional: false
        unique: true
  - name: OtherThing
    namespace: Infra
    label: OtherThing
    attributes:
      - name: name
        label: Name
        kind: Text
        optional: false
        unique: true
  • once the schema is loaded, load this schema which removed the relationship from the generic
---
version: "1.0"
generics:
  - name: Generic
    namespace: Infra
    attributes:
      - name: description
        kind: Text
        optional: true
    relationships:
      - name: other_thing
        peer: InfraOtherThing
        kind: Attribute
        state: absent
        cardinality: one
        optional: true
nodes:
  - name: Thing
    namespace: Infra
    label: Thing
    inherit_from:
      - InfraGeneric
    attributes:
      - name: name
        label: Name
        kind: Text
        optional: false
        unique: true
  - name: OtherThing
    namespace: Infra
    label: OtherThing
    attributes:
      - name: name
        label: Name
        kind: Text
        optional: false
        unique: true
  • check the schema of the generic, the relationship will have been removed
  • check the schema of the InfraThing node, the relationship will still exist

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 Sep 9, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 0.16.1 milestone Sep 9, 2024
@exalate-issue-sync exalate-issue-sync bot removed the group/backend Issue related to the backend (API Server, Git Agent) label Sep 24, 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 3, 2024
Copy link

[From petercrocker]

Tagged for 1.0.0 if possible, this is affecting a customer who has to work around cleaning up objects for now, and doesn’t want to have this part of his production deployments.

@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 21, 2024
@exalate-issue-sync exalate-issue-sync bot removed the state/planned This issue is planned to be worked on in an upcoming release. label Oct 24, 2024
@exalate-issue-sync exalate-issue-sync bot removed this from the Infrahub - 1.0 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

No branches or pull requests

2 participants