Skip to content

bug: Identifier is not retrieved by queries when requested from number pools #8450

@exalate-issue-sync

Description

@exalate-issue-sync

There are two issues regarding this bug.
First, this one: identifier stored in the {{IS_RESERVED}} relationship is never retrieved from queries acting on {{NumberPools}} . This issue is resolving this bug.

The custom identifier management, which is not supported in {{NumberPools}} will be fixed in another issue.

h3. Component

API Server / GraphQL

h3. Infrahub version

v1.3.4

h3. Current Behavior

Currently on demo.infrahub.app If I have a number pool and want to assign
a number pool using an identifier so that new numbers are identifiable
when specifying the "Identifier" it is then blank in the UI and API.

h3. Expected Behavior

I would expect the identifier to be maintained as it is with IP Address
and Prefix pools so that the same number can be retrieved.

h3. Steps to Reproduce

Login to demo.infrahub.app

Create a number pool for InfraVlan and the vlan_id field

Create a new vlan using the pool

{noformat}mutation MyMutation {
InfraVLANCreate(
data: {name: {value: "test"}, vlan_id: {from_pool: {id:
"185b9728-1b76-dda7-d13d-106529b1bcd9", identifier: "test-identifier"}},
role: {value: "user"}, status: {value: "active"}}
) {
ok
object {
id
}
}
}{noformat}

Query resource pool

{noformat}query MyQuery($resource_id: String = "") {
InfrahubResourcePoolAllocated(
pool_id: "185b9728-1b76-dda7-d13d-106529b1bcd9"
resource_id: $resource_id
) {
count
edges {
node {
branch
display_label
id
identifier
kind
}
}
}
}{noformat}

Response has identifier blank

{noformat}{
"data": {
"InfrahubResourcePoolAllocated": {
"count": 1,
"edges": [
{
"node": {
"branch": "test",
"display_label": "100",
"id": "185b972f-4c29-7b92-d13d-1065bc2cab68",
"identifier": null,
"kind": "InfraVLAN"
}
}
]
}
}
}{noformat}

Additional Information

No response

⏺ Here's the formatted version for Jira:


h3. Component: API Server / GraphQL

Infrahub version: v1.3.4

h3. Current Behavior

On demo.infrahub.app, when assigning a number from a number pool using a
custom identifier, the identifier is blank in both the UI and API response.

h3. Expected Behavior

The identifier should be maintained, as it is with IP Address and Prefix
pools, so that the same number can be retrieved using the identifier.

h3. Steps to Reproduce

Login to demo.infrahub.app

Create a number pool for {{InfraVlan}} and the {{vlan_id}} field

Create a new VLAN using the pool with an identifier:

{noformat} mutation MyMutation {
InfraVLANCreate(
data: {name: {value: "test"}, vlan_id: {from_pool: {id:
"185b9728-1b76-dda7-d13d-106529b1bcd9", identifier: "test-identifier"}}, role:
{value: "user"}, status: {value: "active"}}
) {
ok
object {
id
}
}
}{noformat}

Query the resource pool allocations:

{noformat}query MyQuery($resource_id: String = "") {
InfrahubResourcePoolAllocated(
pool_id: "185b9728-1b76-dda7-d13d-106529b1bcd9"
resource_id: $resource_id
) {
count
edges {
node {
branch
display_label
id
identifier
kind
}
}
}
}{noformat}

The response shows {{identifier: null}} instead of the expected

{{"test-identifier"}}:

{code:json}{
"data": {
"InfrahubResourcePoolAllocated": {
"count": 1,
"edges": [
{
"node": {
"branch": "test",
"display_label": "100",
"id": "185b972f-4c29-7b92-d13d-1065bc2cab68",
"identifier": null,
"kind": "InfraVLAN"
}
}
]
}
}
}
{code}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions