hg-evolve 11.1: working around half-patched wirepeer
This fixes the only problem with hg-evolve 11.1 and Mercurial 6.6. Tests for the push-mirror feature were failing, and even tests about the sshd testing server because the `sshpeer` module gets imported by pytest before the parent class of `sshv1peer` is patched by `hgext3rd.topic.server`. Ironically the sequence of imports is: `hgitaly.gitlab_ref` > `heptapod.branch` > `hgext3rd.topic` (for fqbn methods). > `mercurial.hg` Upon push, the local mercurial sees the `exo-ext-tns-heads` capability and therefore expects a `tns_heads` method on the peer object, but it turns out that the `sshv1peer` (which itself inherits `wireprotov1.wirepeer`) has already been defined. Since that latter definition is static, we need to reload the enclosing module in order for the patched version to be executed. Fortunately, it turns out that reloading `sshpeer` from the tests is enough, which comes as a surprise in the case of service tests (usually monkey patches of the service code does not work from them). The sad part is that it is not possible to write functional tests for the push remote mirrors (the main consumer of these methods), because GitLab API does not expose setters for SSH details and pushing to localhost is more strictly prohibited in the Rails app (as of GitLab 16.3) than, e.g., in the case of Project imports.
Loading
Please register or sign in to comment