gerrit/gerrit-extension-api
Dave Borowitz a828fedfba ConsistencyChecker: Add a field to check expected merged SHA-1
When closing a change by push, the ref update to advance the branch
(ReceiveCommits.java:574) happens before closing the changes
(ReceiveCommits.java:614). This means in the event of some kinds of
database failures, a change might be merged into the destination
branch but never marked merged, *and* the actual commit SHA-1 that was
pushed might differ from any existing patch set.

Without doing a full walk of history, we have no easy way of
recovering from this situation only by inspecting the repo on the
server. The only way to detect a commit matching the change that
should have been inserted as a new patch set would be to inspect the
Change-Id footers, but we wouldn't know how far back in history to
walk. (This is additionally complicated by the fact that a commit with
the same Change-Id may have been merged in from a different branch.)

Fortunately, in the case we're talking about here, the end user should
have some record of the SHA-1 they're looking for, since they
previously ran "git push" on that SHA-1. So, this change provides a
new field in FixInput, expectMergedAs, to provide that SHA-1 and check
that it was actually the SHA-1 the change was merged as. In the event
that there is no patch set for the change at that SHA-1, one is
created.

Since the check would be potentially too expensive to do without
providing this SHA-1, it is only activated when this fix field is
provided.

Change-Id: Ie96633aae39d22694b2e6add072ce9ee82f1e30b
2015-06-12 11:22:30 -04:00
..
src/main/java/com/google/gerrit/extensions ConsistencyChecker: Add a field to check expected merged SHA-1 2015-06-12 11:22:30 -04:00
BUCK Extensions GWT API: Align rule with package boundaries 2015-01-26 09:26:57 +00:00
pom.xml Update version to 2.10.2 2015-03-26 16:38:04 +01:00