-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
dev: fix schema not accepting valid timeout #5501
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this regexp works: ^(\d+[sm]?){1,2}$
The suggested regexp doesn't work because it matches My previous suggestion doesn't work too because it matches I think the right expression is |
Inside But this regexp is not a validation regexp because it accepts everything. https://regex101.com/r/odfWT9/1 In the context of
So the best compromise is |
The duration parsing is a bit surprising: https://go.dev/play/p/-NSON-ylfvm So, at the end the regexp can be I don't know if I want to follow the "official" duration format (without negative numbers and too small units) or keep my latest suggestion with something more "logical". 🤔 |
🤔 I think it's better to have something more strict and less human error prone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! that was quick |
…lved" This reverts commit bdb3316.
Tested with https://regex101.com/r/7h45UC/1
While doing sapcc/go-makefile-maker#248 we noticed that valid time.Durations are not accepted in the schema which got validated by the github action with verify=true (https://github.com/sapcc/go-makefile-maker/actions/runs/13635720861/job/38113890543?pr=248) but the command itself ran fine locally.
After this change everything works fine when running the following locally: