fix(ops/gerrit-webhook-to-irccat): fix json parsing
patchset and change numbers are numbers in the JSON, trying to deserialize them into a string fails: Jul 28 20:34:03 gerrit01 gerrit-webhook-to-irccat[2430441]: time=2025-07-28T20:34:03.675Z level=WARN msg="failed to parse body" error="json: cannot unmarshal number into Go struct field PatchSet.patchSet.number of type string" Update our library dependency to a version containing the fixed types. Also add tests for the three messages we care about. Change-Id: Iac44e6ad01a8590b4cafa4d301c9f45000f335d0 Reviewed-on: https://cl.snix.dev/c/snix/+/30624 Tested-by: besadii Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz> Reviewed-by: Jade Lovelace <jade@lix.systems> Autosubmit: Florian Klink <flokli@flokli.de> Reviewed-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
parent
a1aa231b3f
commit
723ef9146b
5 changed files with 54 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ import (
|
|||
|
||||
var logger *slog.Logger
|
||||
var tmplStr = `{{- if eq .Type "patchset-created" -}}
|
||||
{{- if (and (eq .PatchSet.Number "1") (eq .Change.Wip false) ) -}}
|
||||
{{- if (and (eq .PatchSet.Number 1) (eq .Change.Wip false) ) -}}
|
||||
#snix CL/{{.Change.Number}} proposed by {{.Change.Owner.Username}} - {{.Change.Subject}} - {{.Change.URL}}
|
||||
{{- end -}}
|
||||
{{- else if eq .Type "change-merged" -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue