-
-
Notifications
You must be signed in to change notification settings - Fork 46
changes.go: fix json key #187
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
At least the key in ChangeInfo is called `wip`, not `work_in_progress`: ```json {"uploader":{"name":"Florian Klink","email":"flokli@flokli.de","username":"flokli"},"patchSet":{"number":1,"revision":"ede307a009aa0b1eb62e9f18b7bf1f26e9fc98a9","parents":["9f8fb55318f2bafb37e4587fa4b6c793b2b540c0"],"ref":"refs/changes/25/30525/1","uploader":{"name":"Florian Klink","email":"flokli@flokli.de","username":"flokli"},"createdOn":1747335735,"author":{"name":"Florian Klink","email":"flokli@flokli.de","username":"flokli"},"kind":"REWORK","sizeInsertions":11,"sizeDeletions":1545},"change":{"project":"snix","branch":"canon","id":"If8faecdd018b45dd087b7332fe3d3a8280947358","number":30525,"subject":"fix(ops): drop clbot","owner":{"name":"Florian Klink","email":"flokli@flokli.de","username":"flokli"},"url":"https://cl.snix.dev/c/snix/+/30525","commitMessage":"fix(ops): drop clbot\n\nThis removes the old clbot, which kept an SSH connection to gerrit open.\n\nChange-Id: If8faecdd018b45dd087b7332fe3d3a8280947358\n","createdOn":1747335735,"status":"NEW","wip":true},"project":"snix","refName":"refs/heads/canon","changeKey":{"id":"If8faecdd018b45dd087b7332fe3d3a8280947358"},"type":"patchset-created","eventCreatedOn":1747335735} ```
@flokli Which version of Gerrit you are using? |
It's I'm not sure the REST API looks exactly the same as what |
See https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html#events and https://gerrit-review.googlesource.com/Documentation/json.html#change It looks like these events follow a different structure than the REST API. I am happy to receive a PR towards this. |
Ugh, this being separate (but similarly named) types is unfortunate. How would you propose to handle this? Just add additional structs, named like in the documentation? Putting it in a separate (sub) package to avoid clashes? |
I don't know exactly, as i do not have experience with This package can start with the data structures itself and later on, developed towards a proper client to use. What do you think? |
This contains definitions for all message types present in "JSON stream" messages, produced by the `gerrit stream-events` command, or the webhook plugin. As per the discussion in andygrunwald#187 (comment), this is put in a separate package to avoid clashes with other types. Closes andygrunwald#187.
Closing in favor of #189 |
At least the key in ChangeInfo is called
wip
, notwork_in_progress
:(This is an example of what I received via
gerrit stream-events
)