-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
fix services.exec_timeout schema definition #1982
fix services.exec_timeout schema definition #1982
Conversation
WalkthroughThe recent changes enhance the documentation and validation for time duration values in configuration files. Notably, the regex patterns for duration formats have been refined to accommodate more flexible and precise specifications, allowing for complex combinations of time units. Additionally, documentation updates clarify these changes, ensuring users have better guidance when configuring time-related parameters. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1982 +/- ##
==========================================
- Coverage 37.29% 35.55% -1.74%
==========================================
Files 16 17 +1
Lines 866 779 -87
==========================================
- Hits 323 277 -46
+ Misses 517 471 -46
- Partials 26 31 +5 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- schemas/config/2.0.schema.json (1 hunks)
- schemas/config/3.0.schema.json (1 hunks)
Additional comments not posted (4)
schemas/config/2.0.schema.json (2)
2235-2235
: Improved regex pattern for duration validation.The updated regex pattern
^[0-9]+(h|m|s|ms)$
is more precise and ensures that only valid duration formats are accepted. This change improves validation accuracy.
2237-2237
: Added example for duration format.The addition of the example "9999h" provides clarity on valid duration formats and helps users understand the expected input.
schemas/config/3.0.schema.json (2)
2362-2362
: LGTM! The updated pattern improves validation accuracy.The new pattern
^[0-9]+(h|m|s|ms)$
ensures stricter validation for theDuration
field.
2364-2364
: LGTM! The added example enhances clarity.Including
"9999h"
in the examples helps users understand the expected format for theDuration
field.
supported formats package main
import (
"fmt"
"time"
)
func main() {
var d time.Duration
d, _ = time.ParseDuration("1h") //1h0m0s
fmt.Println(d)
d, _ = time.ParseDuration("2.5h") //2h30m0s
fmt.Println(d)
d, _ = time.ParseDuration("2m") //2m0s
fmt.Println(d)
d, _ = time.ParseDuration(".2m") //12s
fmt.Println(d)
d, _ = time.ParseDuration("30s") //30s
fmt.Println(d)
d, _ = time.ParseDuration("30.03s") //30.03s
fmt.Println(d)
d, _ = time.ParseDuration("300ms") //300ms
fmt.Println(d)
d, _ = time.ParseDuration("1h3m40s500ms") //1h3m40.5s
fmt.Println(d)
} |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .rr.yaml (5 hunks)
- schemas/config/2.0.schema.json (1 hunks)
- schemas/config/3.0.schema.json (1 hunks)
- schemas/readme.md (1 hunks)
Files skipped from review due to trivial changes (2)
- .rr.yaml
- schemas/readme.md
Files skipped from review as they are similar to previous changes (2)
- schemas/config/2.0.schema.json
- schemas/config/3.0.schema.json
LGTM, thanks @gam6itko 👍 |
Reason for This PR
I've found problem in json schema description of services.exec_timeout
IDE phpStorm recognize 10h as invalid value. But this value present in example.
Discord thread
https://discord.com/channels/538114875570913290/538114876497723392/1265365423965081631
Summary by CodeRabbit
New Features
Documentation