Cache diffstat for external changesets
Created by: eseliger
Previously, we introduced caching on the diffstats of patches. That was relatively simple, as we know when the diff changes.
For ExternalChangesets however, we need to have a more complex logic, hence it hasn't been implemented yet. @mrnugget and I just brainstormed in the watercooler and came up with the following ideas:
- We store the diffstat on the changeset, like we do with patch
- We need to recalculate it when either baseOID (base branch change) or headOID (someone pushed to the branch) change
- We (soon #11000) rely on
base
andhead
in theDiff
resolver on ExternalChangeset - For GitHub, the head only get's updated once we sync events, so we need to check whether the headOID changed when syncing and then recalculate
- For Bitbucket, we currently cannot detect the headOID changed from events we receive. Hence, we should store the OID of the commit we generate with gitserver when running the changesetjob, and on every received event use
git resolve-rev
to find out if the head refsHEAD
changed. Recalculate if so.
- We (soon #11000) rely on