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: when inserting a schema node into an existing hierarchy the wrong peer gets defined on the parent relationship on the inserted node #4838

Closed
wvandeun opened this issue Nov 3, 2024 · 0 comments
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) group/schema Issue related to some schemas type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Nov 3, 2024

Component

API Server / GraphQL

Infrahub version

1.0.1

Current Behavior

When you insert a schema node into an existing hierarchy, the parent relationship on the inserted schema node seems to be set to the generic implementing the hierarchy rather than the specific peer.

Expected Behavior

The peer of the parent relationship of the inserted node in the hierarchy, gets set to the proper kind of the parent node.

Steps to Reproduce

  • load an instance of Infrahub
  • load the following schema
---
version: "1.0"
generics:
  - name: Generic
    namespace: Location
    hierarchical: true
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
nodes:
  - namespace: Location
    name: Country
    inherit_from:
      - LocationGeneric
    parent: ""
    children: "LocationSite"
  - namespace: Location
    name: Site
    inherit_from:
      - LocationGeneric
    parent: "LocationCountry"
    children: ""
  • next load the following schema
---
version: "1.0"
generics:
  - name: Generic
    namespace: Location
    hierarchical: true
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
nodes:
  - namespace: Location
    name: Country
    inherit_from:
      - LocationGeneric
    parent: ""
    children: "LocationMetro"
  - namespace: Location
    name: Metro
    inherit_from:
      - LocationGeneric
    parent: "LocationCountry"
    children: "LocationSite"
  - namespace: Location
    name: Site
    inherit_from:
      - LocationGeneric
    parent: "LocationMetro"
    children: ""
  • navigate to the schema page in the UI
  • open the LocatioMetro schema node
  • open the relationships tab
  • expand the parent relationship
  • the peer will be set to LocationGeneric instead of LocationCountry

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 Nov 3, 2024
@wvandeun wvandeun changed the title bug: when inserting a schema node into a hierarchy the wrong peer gets defined on the parent relationship on the inserted node bug: when inserting a schema node into an existing hierarchy the wrong peer gets defined on the parent relationship on the inserted node Nov 3, 2024
@dgarros dgarros added the group/schema Issue related to some schemas label Nov 4, 2024
@dgarros dgarros added this to the Infrahub - 1.0.x milestone Nov 4, 2024
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) group/schema Issue related to some schemas type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants