Skip to content

bug: Regex on attribute kind List fails during merge #7654

@minitriga

Description

@minitriga

Component

No response

Infrahub version

1.5.1

Current Behavior

Currently if there is an attribute of kind List that has a regex applied the we evaluate the regex at the input level per item in the list however during a merge/rebase/schema update the regex is applied against the whole list as a string instead of per item in the list. Preventing the data from being merged.

schema:

- name: ports
  kind: List
  label: Ports
  optional: true
  description: "List of ports or port ranges (e.g., 'tcp:80', 'tcp:21-22', 'tcp:53', 'udp:53')"
  regex: "^(tcp|udp):[\\d-]+$"
Image

Expected Behavior

To evaluate the regex against all the items in the list individually.

Steps to Reproduce

Add the above attribute to a device node in the dev dataset https://github.com/opsmill/infrahub/blob/stable/models/base/dcim.yml

Add some data to the node: tcp:443 tcp:8080 in a new branch

Try to merge the branch

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions