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

Add support for int/intslice flag validation #1261

Closed
wants to merge 1 commit into from

Conversation

dearchap
Copy link
Contributor

@dearchap dearchap commented Apr 2, 2021

What type of PR is this?

  • feature

What this PR does / why we need it:

This PR adds basic support for flag validation.

Which issue(s) this PR fixes:

Fixes #786

Special notes for your reviewer:

Added support ONLY for int and intslice flags. This is for proof of concept. If this design is acceptable I can add support for other types in a similar fashion.

Testing

New tests have been added

  • TestValidateFlags
  • TestIntValidatorFunc
  • TestIntSliceValidatorFunc

Following tests have been updated to include flag validators

  • TestFlagsFromEnv

Release Notes


@dearchap dearchap requested a review from a team as a code owner April 2, 2021 00:06
@dearchap dearchap requested review from saschagrunert and asahasrabuddhe and removed request for a team April 2, 2021 00:06
@dearchap dearchap changed the title feat(flag-validation). Add support for flag validation feat(flag-validation). Add support for int/intslice flag validation Apr 2, 2021
@instabledesign
Copy link

Yeah i like this feature, if the design is approve i can help implementing other validator (string, time date/duration, net.IP)

@stale
Copy link

stale bot commented Jul 28, 2021

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale stale due to the age of it's last update label Jul 28, 2021
@stale
Copy link

stale bot commented Aug 28, 2021

Closing this as it has become stale.

@stale stale bot closed this Aug 28, 2021
@dearchap
Copy link
Contributor Author

dearchap commented Aug 28, 2021 via email

@rliebz rliebz reopened this Aug 30, 2021
@stale
Copy link

stale bot commented Aug 30, 2021

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

@stale stale bot removed the status/stale stale due to the age of it's last update label Aug 30, 2021
@meatballhat meatballhat added kind/feature describes a code enhancement / feature request area/v2 relates to / is being considered for v2 labels Apr 21, 2022
@meatballhat meatballhat added this to the Release 2.5.0 milestone Apr 21, 2022
@meatballhat meatballhat changed the title feat(flag-validation). Add support for int/intslice flag validation Add support for int/intslice flag validation Apr 21, 2022
@meatballhat meatballhat changed the base branch from master to main April 21, 2022 22:01
@meatballhat meatballhat added the status/conflicts contains merge conflicts label May 8, 2022
@meatballhat
Copy link
Member

@dearchap (paraphrasing from discussion) This and #1234 are similar ideas, and given that you're actively working on this one and #1234 has been seemingly abandoned, I favor moving forward with this PR. However, I'm concerned about the additional API surface area introduced here, so what do you think about targeting the v3 series and using generics instead?

@dearchap
Copy link
Contributor Author

dearchap commented Oct 3, 2022

@meatballhat Yes that would be fine. However it might be worthwhile to add a light interface with implementation left to users for extending. And most common use cases can be provided with v3

@meatballhat
Copy link
Member

@meatballhat Yes that would be fine. However it might be worthwhile to add a light interface with implementation left to users for extending. And most common use cases can be provided with v3

This sounds good to me 🎉

@dearchap
Copy link
Contributor Author

Will open a new PR with a small validation API

@dearchap dearchap closed this Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/feature describes a code enhancement / feature request status/conflicts contains merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Flag Validators
4 participants