- Jan 06, 2024
-
-
Georges Racinet authored
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.
-
Georges Racinet authored
and separated the phases config fragment generation, as it will be useful for upcoming tests with successive pushes on peers with different capabilities.
-
- Jan 05, 2024
-
-
Georges Racinet authored
-
Georges Racinet authored
-
Georges Racinet authored
-
Georges Racinet authored
-
Georges Racinet authored
Actually, LastCommitForPath (LCFP) was behaving as if always called with the literal pathspecs option, so we had to implement the non-literal case, which is still not general enough, but handles cases with wildcards. The matching method is rather ugly, and done by trial and error, but Git reference code is not simple either, and the documentation is only partially true (does not mention implicit prefix behaviours, pretends that Git uses fnmatch(3), which is not true in my checkout of v2.40.0) Closes #165
-
- Dec 23, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
This matches the version used in Heptapod 0.40 and the future 0.41. HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: Georges Racinet <georges.racinet@octobus.net> HG: topic 'bump-proto' HG: branch 'stable' HG: changed rust/Cargo.lock HG: changed rust/mercurial.rev
-
Georges Racinet authored
As often, it doesn't change in patch versions.
-
Georges Racinet authored
In Gitaly protocol 16.3, the `ignore_whitespace_changes` boolean disappears, being replaced with a 3-valued enum, corresponding to two levels of whitespace ignoring in Git. The disparition means that the attribute was long deprecated, and no upstream client had been using it for a while, so it was about time we implement the "new" `WhitespaceChanges` enum. Closes #137
-
- Dec 20, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
-
- Dec 19, 2023
-
-
Georges Racinet authored
The immediate goal is to stop subrepositories breaking the Project home page, see heptapod#1287. More generally, the `workdir` module now provide high-level exceptions that are easy to catch in services and will not be confused with other errors arising in Mercurial.
-
- Dec 17, 2023
-
-
Georges Racinet authored
Closes #164 In the course of implementation, we introduce the new `changeset_by_commit_id` helpers which are useful in cases where the input is expected to be a full Node ID (instead of any Git revspec) and that is to be validated (because Gitaly does). Would need their separated testing to commit them separately, too lazy today for that.
-
- Dec 19, 2023
-
-
Georges Racinet authored
All these metadata reach our code as `str` instances, this one (previously not tried from the clients) was wrongly implemented as if the incoming data were `bytes`.
-
- Dec 17, 2023
-
-
Georges Racinet authored
Will spare us and readers some repetitions.
-
Georges Racinet authored
This allows us to remove much pollution in `test_compare_squash`.
-
- Dec 14, 2023
-
-
Georges Racinet authored
The breakthrough is that HGitaly is able to control internal Git mirroring and this can be tested from HGitaly (ordinary) integration tests. The presence of the `commit_author` and `timestamp` attributes raise some questions more explicitely than it was the case in the Rails app, where the feature has been implemented long ago by spawning a Mercurial subprocess. We decided to behave identically, and in particular to postpone the question of representing the difference between committer and author to another time, as such a distinction does not exist currently in Mercurial (could be an extension around providing that, though). The `UserSquash` method in itself was only chosen because it does not have many options and is at its core very simple to implement. Closes #163
-
Georges Racinet authored
The `HGitalyServicer` base class now provides a `for_mutation_by` optional argument that triggers the setting of all needed repository config items and environment variables as already in use when spawning Mercurial subprocesses from the Rails application: repository mode (nativity, with Git mirroring or not), link to MR to allow distinguishing between merge permissions and direct pushes, etc. The acting user is part of the request message in all examples we have considered so far, hence passed down by the caller (concrete service subclass). Other metadata are expected as invocation metadata (hence HTTP/2 headers, which matches what also happens between Workhorse and the Rails aplication). We had to add invocation metadata handling to the `FakeContext` to maintain coverage. The import path from `grpc` is probably instable, but we'll live with it. WIP implement UserSquash, with Git mirroring or not Needs lint to be ok, coverage to be 100%, a decision about itering on invocation metadata so much. The breakthrough is that HGitaly is able to control internal Git mirroring and this can be tested from HGitaly (ordinary) integration tests. At this point this does not implement passing of user information to internal API (can only be tested from functional tests, as it requires a fully working Heptapod instance). The `UserSquash` method in itself was only chosen because it does not have many options and is at its core very simple to implement. WIP to fold: refactoring putting mutation metadata in repo config/environ WIP first version working in functional tests WIP some linting (grpc import in tests will be used later) WIP added tests with Gitaly Almost complete (for_mr_iid missing) except coverage when skipping Gitaly Comparison accept_mr_iid Full coverage for UserSquash
-
Georges Racinet authored
Very similar to what, e.g., mercurial-testhelpers and many similar tools do. This is as close to the CLI as possible, and suitable for methods that can be implemented in a single mutating command, as the command will typically enclose the actual mutation in its own transaction. Methods to be implemented as a succession of mutation commands should better manage a single transaction themselves, probably at the price of a greate duplication from Mercurial core.
-
- Nov 30, 2023
-
-
Georges Racinet authored
We take `UserSquash` as an example as it will be the first implemented method (see #163) because of its calling simplicity.
-
- Dec 12, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
-
- Nov 24, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
There is a compatibility problem lower level than HGitaly with the current stable Mercurial (6.6). It looks at first sight to lie in Evolve, but it could be in mercurial-testhelpers. It should not prevent us going forward with HGitaly, at least on Mercurial 6.5
-
Georges Racinet authored
With 0.42 released as part of the stable branch (Heptapod 0.40), we will need to open up 0.43 for the default branch.
-
- Nov 22, 2023
-
-
Georges Racinet authored
-
- Nov 21, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
-
Georges Racinet authored
-
- Nov 20, 2023
-
-
Georges Racinet authored
In case a project id is reused (Heptapod application context, since the repo path is derived from the project id) or a repository path is reused (e.g. in RSpec tests), it is possible that a previous failed cleanup (crash or brutal stop before the final trashed repo `rmtree) would get in the way of the removal. Unlikely, but easy to prevent by making the name in trash unique (time-based, random would also have been good).
-
Georges Racinet authored
It was a mistake to depend on `load_repo`, as it will fail if, e.g., the `.hg` sub directory does not exist (seen in Rails RSpec tests) and various corrupted cases that a *removal* should clean up. The price to pay is the transactionality of the roster, but we cannot lock it properly without a repo. In theory in should be possible to instantiate the `Vfs` separately, but it does not seem to matter so much. With this change, if removing the working directories fails, it will not prevent removing the trashed repository (but of course we risk a later collision in workdirs). Backs out in particular changeset 1c735d40cfe7
-
- Nov 18, 2023
-
-
Georges Racinet authored
-
- Nov 15, 2023
-
-
Georges Racinet authored
The error message is ``` *** failed to import extension "hgitaly": unicode '[OPTIONS]...' found in cmdtable.hgitaly-serve ``` It is completely obscure why this has not been a problem before. Got this with Mercurial 6.4.5, then 6.4 on Python 3.9 (usually running with Python 3.10 if that makes any difference).
-
- Nov 13, 2023
-
-
Georges Racinet authored
-