flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

[RFC] Dedicated API for commit status updates

Open somtochiama opened this issue 2 years ago • 7 comments

Proposal for adding a new API kind CommitStatus to the notification-controller.

Signed-off-by: Somtochi Onyekwere [email protected]

somtochiama avatar Apr 13 '22 18:04 somtochiama

@SomtochiAma I would suggest looking at this discussion. I kind of dropped the ball on implementing this last summer...

https://github.com/fluxcd/flux2/discussions/1529#discussioncomment-880161

phillebaba avatar Apr 13 '22 20:04 phillebaba

@phillebaba I have! It was a very good starting point. I plan on writing another proposal on adding templating (with you as co-author since you have already written a bulk of it in the discussion) and keeping this proposal on just adding the new CommitStatus kind. Is the proposal too sparse?

somtochiama avatar Apr 14 '22 03:04 somtochiama

@phillebaba @SomtochiAma does it make sense to add templating to CommitStatus if the actual message is limited to a couple of characters ? Maybe adding prefix is enough to solve the multi-cluster issue, it's not like the cluster name is something people can template, there is no such metadata in the payload.

stefanprodan avatar Apr 14 '22 08:04 stefanprodan

It would be good to take into account that cdevents is shaping.

hiddeco avatar Apr 21 '22 14:04 hiddeco

@SomtochiAma we need to take into account things like https://github.com/fluxcd/notification-controller/pull/369 it's not a commit status but it's not an alert either...

stefanprodan avatar Apr 26 '22 10:04 stefanprodan

So I have looked this over now and for the most part this looks pretty straight forward. My opinion is that this should only cover CommitStatus as it seems to be a well defined term within most Git providers today. Everything else like Github Workflow dispatch should be covered in another RFC, as it would be to much work dealing with that too.

I would like to push for adding some sort of templating feature to the commit status. Just because there would be so many different needs in the future that we cant really consider. The reasoning for why to have it in the first place is that we want to differ a commit status coming from different environments, but we could consider for example a environment with multiple regions. Does just having a prefix solve this? I am not sure but maybe. One use case which my comment covered was the option to add templating parameters from a configmap which would enable the same commit status to be deployed into multiple clsuters but result in different prefixes. The question is mostly how much of an hassle that work is worth.

phillebaba avatar May 03 '22 20:05 phillebaba

My opinion is that this should only cover CommitStatus as it seems to be a well defined term within most Git providers today.

Agreed, I've merged the GitHub dispatch integration for the Alert API.

stefanprodan avatar May 11 '22 15:05 stefanprodan