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: order_weight set in generic isn't updated in the nodes #5684

Open
BaptisteGi opened this issue Feb 6, 2025 · 0 comments
Open

bug: order_weight set in generic isn't updated in the nodes #5684

BaptisteGi opened this issue Feb 6, 2025 · 0 comments
Labels
type/bug Something isn't working as expected

Comments

@BaptisteGi
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.1.6

Current Behavior

I have the following schema that I load to infrahub:

# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: "1.0"

generics:
  - name: Generic
    namespace: Random
    description: Random stuff
    attributes:
      - name: first
        kind: Text
        unique: true
        order_weight: 1000
      - name: second
        kind: Text
        unique: true
        order_weight: 2000

nodes:
  - name: Stuff
    namespace: Random
    description: Random stuff
    inherit_from:
      - RandomGeneric

Everything works fine, I have the attribute called first that goes first.

Now I changed my mind and I want the attribute first to go second, I update and load the following schema:

# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: "1.0"

generics:
  - name: Generic
    namespace: Random
    description: Random stuff
    attributes:
      - name: first
        kind: Text
        unique: true
        order_weight: 3000
      - name: second
        kind: Text
        unique: true
        order_weight: 2000

nodes:
  - name: Stuff
    namespace: Random
    description: Random stuff
    inherit_from:
      - RandomGeneric

=> The order in the UI is still the same even tho I changed the order weight.

Expected Behavior

I expect the order_weight setting for an attribute to be updated when I update the generic.

Steps to Reproduce

  • Spin Infrahub
  • Load the first schema from the above section
  • Check the attribute order in the UI
  • Load the second schema from the above section
  • Attributes are still in the same order

Additional Information

Similar in a way with #2242

If I load the following schema it fixes my issue:

# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: "1.0"

generics:
  - name: Generic
    namespace: Random
    description: Random stuff
    attributes:
      - name: first
        kind: Text
        unique: true
        order_weight: 3000
      - name: second
        kind: Text
        unique: true
        order_weight: 2000

nodes:
  - name: Stuff
    namespace: Random
    description: Random stuff
    inherit_from:
      - RandomGeneric
    attributes:
      - name: first
        kind: Text
        unique: true
        order_weight: 3000
@BaptisteGi BaptisteGi added the type/bug Something isn't working as expected label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant