monocle icon indicating copy to clipboard operation
monocle copied to clipboard

Correlate code statistics to deployment events

Open achedeuzot opened this issue 4 years ago • 2 comments

Hi and thanks for this very cool project !

I'd like to suggest a feature that would allow monocle to have stats related to deployments. That way, in addition to the "median time to merge", it would be possible to have a "median time to deployment" (depending on environments).

One approach could be to have a webhook endpoint that would receive deployment events. This would make monocle have a very good overview of the development to deployment lifecycle.

Cheers,

achedeuzot avatar Dec 29 '20 14:12 achedeuzot

Hi,

Thanks for the feedback. Yes that could be a good idea. I'd like to keep the database schema generic and not tied to Github only (Monocle also support Gerrit reviews and I'd like to support GitLab MR too). But I see that GitLab also provides that deployment API so it seems this metrics could be considered like "a standard".

I guess a deployment should be caracterized by: an id, a duration, a start time, a status, a change id ? I see this event object : https://docs.github.com/en/free-pro-team@latest/graphql/reference/objects#deployedevent that could be leveraged ?

So I'll flag that issue as RFE. I don't plan to implement this soon but I'll be happy to help if you'd like to implement it ...

Cheers, Fabien

morucci avatar Dec 30 '20 16:12 morucci

Hi Fabien,

It depends how much information is needed. In its simplest form, it needs: a commit hash and a timestamp of when the deployment ended and succeeded. That way, we can know when a given commit/pull-request has been deployed. It would be quite useful to have some kind of environment information (deployment to staging / preprod / prod) too.

I hadn't seen the DeployedEvent available in the GitHub graphql which would make things easier indeed ! (instead of having a generic webhook on monocle to receive such events).

Thanks for your feedback !

achedeuzot avatar Dec 30 '20 18:12 achedeuzot