Use correct changeset state for diff property
Created by: eseliger
After reopening a PR, it had no diff anymore (here)[https://k8s.sgdev.org/campaigns/Q2FtcGFpZ246MTY=]
A changesets diff
is meant to be null
in the API, whenever a changeset is NOT open. We previously checked only the metadata of the changeset, not the events also, which lead to inconsistent null
behavior, when a webhook changed the state. I also added a docstring so such bugs are less likely to happen again.