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

Allow custom validation plugin for custom fields #876

Closed
jakubkrysl opened this issue Sep 1, 2021 · 3 comments · Fixed by #1038
Closed

Allow custom validation plugin for custom fields #876

jakubkrysl opened this issue Sep 1, 2021 · 3 comments · Fixed by #1038
Assignees
Labels
type: feature Introduction of new or enhanced functionality to the application
Milestone

Comments

@jakubkrysl
Copy link

Environment

  • Python version: 3.6.8
  • Nautobot version: v1.1.1

Proposed Functionality

Allow to define custom validation via validation plugin for all custom fields.

This might me as easy as adding @extras_features("custom_validators") to CustomField and CustomFieldChoice models.

Use Case

We'd like to enforce format of values for some custom fields, namely cf.asw_owner. We need it to be like team_name <team@email> (manager@email) to make sure changing the value won't break associated integration scripts from other projects. It already did happen, that's why we'd like to implement a check. But it is not possible yet.

Database Changes

None

External Dependencies

None

@jvanderaa
Copy link
Contributor

This specifically needs to take the validation into the Custom Field Choices, above and beyond the validation regex that is available today.

@jvanderaa
Copy link
Contributor

Can assign to myself and Josh S

@glennmatthews glennmatthews added the type: feature Introduction of new or enhanced functionality to the application label Sep 10, 2021
@jedelman8
Copy link
Contributor

@jvanderaa what's your timing on this? If it is in the next 2-3 weeks, it'll make 1.2, otherwise, 1.3. Can you let us know? :)

@jedelman8 jedelman8 added this to the v1.3.0 milestone Sep 24, 2021
josh-silvas added a commit to josh-silvas/nautobot that referenced this issue Sep 24, 2021
josh-silvas added a commit to josh-silvas/nautobot that referenced this issue Oct 29, 2021
glennmatthews pushed a commit that referenced this issue Dec 8, 2021
* Issue #876 extends existing regex validation to choices fields.

* Adds API test case for custom select regex.

* Adjust valid response assertion for custom-select field.

* Remove validation regex at initialization.

* Removes additional custom field choice.

* Update notes on custom selection fields regexp.
glennmatthews added a commit that referenced this issue Dec 8, 2021
glennmatthews added a commit that referenced this issue Feb 2, 2022
* Issue #876 adds regex validation to choices fields.

* Add basic functionality for pagination elements "first" and "offset".

* Adds documentation and testing for the skip/offest elements.

* Adds image reference.

* Updates from requested changes in PR.

* Update nautobot/docs/user-guides/graphql.md

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update nautobot/docs/user-guides/graphql.md

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update GQL query image.

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
timizuoebideri1 pushed a commit that referenced this issue Feb 9, 2022
* Issue #876 adds regex validation to choices fields.

* Add basic functionality for pagination elements "first" and "offset".

* Adds documentation and testing for the skip/offest elements.

* Adds image reference.

* Updates from requested changes in PR.

* Update nautobot/docs/user-guides/graphql.md

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update nautobot/docs/user-guides/graphql.md

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update GQL query image.

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new or enhanced functionality to the application
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants