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 define an HFID which is equal to the uniqueness_constraint #4181

Closed
wvandeun opened this issue Aug 26, 2024 · 1 comment
Closed
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

wvandeun commented Aug 26, 2024

Component

API Server / GraphQL

Infrahub version

0.16.0.dev0

Current Behavior

When you try to load the following schema into Infrahub, you get an error message

Unable to load the schema:
  At least one attribute must be unique in the human_friendly_id for TestingTest.
---
version: "1.0"
nodes:
  - name: Test
    namespace: Testing
    human_friendly_id:
      - aaa__value
    uniqueness_constraints:
      - ["aaa__value"]
    attributes:
      - name: aaa
        kind: Text
      - name: bbb
        kind: Text

This is wrong, we defined a uniqueness_constraint that defines that the value of the aaa attribute must be unique, therefor we should be able to use if for the HFID.

Expected Behavior

I would expect that we can use attributes, defined as unique within the uniqueness_constraint option to construct the HFID.

Steps to Reproduce

  • start an instance of Infrahub
  • load the following schema using infrahubctl
---
version: "1.0"
nodes:
  - name: Test
    namespace: Testing
    human_friendly_id:
      - aaa__value
    uniqueness_constraints:
      - ["aaa__value"]
    attributes:
      - name: aaa
        kind: Text
      - name: bbb
        kind: Text

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 Aug 26, 2024
@exalate-issue-sync exalate-issue-sync bot added the state/planned This issue is planned to be worked on in an upcoming release. label Sep 9, 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 Sep 13, 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

4 participants
@dgarros @wvandeun @ajtmccarty and others