Backport #27284 by @lunny Fix #27268 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix commit status index problem * remove unused functions * Add fixture and test for migration * Fix lint * Fix fixture * Fix lint * Fix test * Fix bug * Fix bug