Disable commit validation in RebaseIfNecessary
When a commit is submitted by someone other than its author who
does not have "forge author" permission and the submit type is
"Rebase If Necessary", gerrit permits the change to be submitted
and then fails to merge it:
| Merge attempt for gwt,refs/heads/master failed
| com.google.gerrit.server.git.MergeException: Cannot rebase 9453549842ae10f24d6299a52897d423bd8e0b7d
| at com.google.gerrit.server.git.RebaseIfNecessary._run(RebaseIfNecessary.java:112)
| at com.google.gerrit.server.git.SubmitStrategy.run(SubmitStrategy.java:103)
| [...]
| Caused by: com.google.gerrit.server.project.InvalidChangeOperationException: invalid author
| at com.google.gerrit.server.change.PatchSetInserter.validate(PatchSetInserter.java:325)
| at com.google.gerrit.server.change.PatchSetInserter.insert(PatchSetInserter.java:189)
| at com.google.gerrit.server.changedetail.RebaseChange.rebase(RebaseChange.java:303)
| at com.google.gerrit.server.git.RebaseIfNecessary._run(RebaseIfNecessary.java:83)
| ... 19 more
Permissions are already checked at submit time. The extra commit
validation at merge time (for this submit type only) came about as an
unintended side effect when RebaseChange was tweaked to use
PatchSetInserter in fd23ab518fbd5a3a8c02badd8583ade36cb30edb. Rely on
the submit-time checks and disable the merge-time check.
Analysis-by: Dave Borowitz <dborowitz@google.com>
Change-Id: Ic7050679aad5e7822e2307f2491ea212db1e1e79
4 files changed