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: unable to set a value for an attribute on a node that existed before the attribute was deleted from the schema and then was added back to the schema #4727

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

Comments

@wvandeun
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

0.16.4

Current Behavior

When you delete an attribute of a schemanode and later on recreate it, you are unable to set a value for that attribute on nodes that existed prior to deletion of the attribute from the schemanode.

You can set a value for the attribute for nodes that were created after the deletion of the attribute from the schemanode.

Expected Behavior

You should be able to set an attribute value for a node that existed prior to the deletion of the attribute from the schemanode.

Steps to Reproduce

  • spin up instance of Infrahub
  • load the following schema
---
version: "1.0"
nodes:
  - name: Node
    namespace: Some
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
      - name: node_type
        kind: Dropdown
        choices:
          - name: type_one
          - name: type_two
        optional: true
  • create an instance of SomeNode
  • load the following schema to delete the node_type attribute
---
version: "1.0"
nodes:
  - name: Node
    namespace: Some
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
      - name: node_type
        kind: Dropdown
        state: "absent"
        choices:
          - name: type_one
          - name: type_two
        optional: true
  • load the following schema, which recreates the node_type attribute
---
version: "1.0"
nodes:
  - name: Node
    namespace: Some
    attributes:
      - name: name
        kind: Text
        optional: false
        unique: true
      - name: node_type
        kind: Dropdown
        choices:
          - name: type_one
          - name: type_two
        optional: true
  • set a value for the node_type attribute on the node you created before, the attribute value will not show in the UI or when you query the node using GraphQL
  • create a new SomeNode node, the attribute value will be properly saved for the new 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 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 group/backend Issue related to the backend (API Server, Git Agent) labels Oct 24, 2024
@exalate-issue-sync exalate-issue-sync bot modified the milestone: Infrahub - 1.0 Oct 24, 2024
@exalate-issue-sync exalate-issue-sync bot added group/backend Issue related to the backend (API Server, Git Agent) and removed priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release labels Oct 24, 2024
@dgarros dgarros added this to the Infrahub - 1.0.1 milestone Oct 25, 2024
@dgarros dgarros self-assigned this Oct 25, 2024
@dgarros dgarros closed this as completed Oct 28, 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) type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants