dimagi / commcare-hq

CommCareHQ is the server backend for CommCare, the world's largest platform for designing, managing, and deploying robust, offline-first, mobile applications to frontline workers worldwide
https://www.dimagi.com/open-source/
BSD 3-Clause "New" or "Revised" License
498 stars 217 forks source link

[CEP] Deploy History Report #27839

Open esoergel opened 4 years ago

esoergel commented 4 years ago

Abstract 3rd party environments do not currently have access to commit information in deploy history. This CEP proposes to make this information available on all environments. Additionally, it proposes moving the deploy history report to a standalone page.

Motivation To better keep track of when changes are deployed on third party environments.

Specification

For reference, here's what the deploy report currently looks like: image This is at the bottom of the system info page, which is mostly broken and has a lot of other stuff going on.

HQ only stores the diff URL, and then not for third-party repos, this actually looks very easy to address:

However, it would be preferable to also correct this to store the commit directly, rather than parsing it from the URL:

commcare-cloud will need the following:

And finally, that deploy history table should be moved to a standalone, paginated report. This should fall under the existing "System Health" header.

Impact on users None

Impact on hosting Should make useful information more visible.

Backwards compatibility

Release Timeline

Open questions and issues

millerdev commented 4 years ago

+1

Would it make sense to stop writing a git tag on each deploy? It seems unnecessary if we have a record of deploy commits in the deploy history report. That would reduce the tag clutter in github.

esoergel commented 4 years ago

Would it make sense to stop writing a git tag on each deploy? It seems unnecessary if we have a record of deploy commits in the deploy history report. That would reduce the tag clutter in github.

When I saw that message in my email, I thought for a sec you were quoting me, because I wrote that almost verbatim in the "open questions" section above, but later deleted it. I somewhat agree, especially for the setup_release tags. However, we still lack a cross-environment view of what code has been deployed and where. Tagging excludes 3rd party envs, to be sure, but I think there's value in seeing easily in github whether a commit is on prod or other envs.

Since as a rule, we don't force-push to master, perhaps a better state would be a single current-<env> tag that always points to the currently deployed commit for each environment. Then each environment could hold their diffs and deploy history, but we could still easily see on github where a given commit is live.

As an aside, I'm also mulling over the idea of adding a search field to the deploy history page that accepts a git ref and shows the first deploy to contain that ref.

millerdev commented 4 years ago

perhaps a better state would be a single current-<env> tag that always points to the currently deployed commit for each environment

I like this idea. The only tag we care about 99% of the time is the most recent one (for each env). I've also noticed that the performance of some git tools is negatively affected by the presence of many tags.

As an aside, I'm also mulling over the idea of adding a search field to the deploy history page that accepts a git ref and shows the first deploy to contain that ref.

That sounds useful.

snopoke commented 4 years ago

perhaps a better state would be a single current- tag that always points to the currently deployed commit for each environment

+1