ChangeNotesParser parses the commits in a change meta ref starting from
the most recent commit. While doing so it keeps track of patch set
creations. If during the parsing we observe meta data for a patch set in
a meta commit that was created before the patch set got created we fail
with a ConfigInvalidException. This works well, unless a patch set got
deleted and then recreated. In this case both patch sets have the same
patch set ID and when we hit the meta data for the deleted patch set we
find that it was created before the patch got created the second time,
and hence the exception is thrown. This means we currently cannot load
any change for which a patch set got deleted and then recreated. This
can affect all kind of operations that need to load such a change. To
fix this we are now skipping the parsing of meta data for deleted patch
sets completely, since it's anyway of no relevance.
Patch set deletions are no longer possible via the REST API, but they
were possible when we supported draft patch sets. Hence this bug affects
mostly old changes. Still even nowadays it can happen that a patch set
is marked as deleted. This happens if the ConsistencyChecker is run to
fix change inconsistencies. If the ConsistencyChecker finds a patch set
for which the commit is not found, the patch set is marked as deleted.
At Google we observed more than 200 exceptions that are caused by this,
just in the last month.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I4cd9f9a1787f41469a6515890b1c919017b24e01
(cherry picked from commit 4b9f792153)