Sync methods with upstream gerritlib