In #9562, we introduced a bug where the pending conditional migrations check was run without the repo being started. Wrapping it with `with_repo` fixes that.