Skip to content

Conversation

alexander-akhmetov
Copy link

@alexander-akhmetov alexander-akhmetov commented Jun 11, 2025

Changed webhook timeout field from time.Duration to model.Duration to make JSON marshalling consistent with YAML.

time.Duration marshals to JSON as an integer (nanoseconds), while to YAML (with gopkg.in/yaml.v3) it's marshalled as a duration string.

time.Duration example: https://go.dev/play/p/Ml2Mb_VFNyu:

JSON: {"timeout":90000000000}
YAML: timeout: 1m30s

model.Duration also marshals to human-readable duration strings in both JSON and YAML, and is consistent with other duration fields in Alertmanager.

model.Duration example: https://go.dev/play/p/rqts9yDSEQL

JSON: {"timeout":"1m30s"}
YAML: timeout: 1m30s

@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/webhook-timeout-type branch from 1bf359d to 0545aa5 Compare June 11, 2025 10:03
@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/webhook-timeout-type branch from 0545aa5 to 1c49704 Compare June 11, 2025 10:09
@alexander-akhmetov alexander-akhmetov marked this pull request as ready for review June 11, 2025 10:17
@alexander-akhmetov alexander-akhmetov marked this pull request as draft June 11, 2025 17:31
@alexander-akhmetov alexander-akhmetov marked this pull request as ready for review June 11, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant