- Feb 28, 2024
-
-
Georges Racinet authored
Nothing serious, no change to main code. All explanations in comments.
-
Georges Racinet authored
Sadly HGitaly will not see any boost except in bandwidth. Closes #165
-
Georges Racinet authored
-
- Jan 09, 2024
-
-
Georges Racinet authored
-
- Jan 05, 2024
-
-
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
-
- Jan 03, 2024
-
-
Georges Racinet authored
Structured errors in `GetTreeEntries` will be a larger effort, should be done this week, though.
-
- Sep 22, 2023
-
-
Georges Racinet authored
There were no Gitaly Comparison tests for this method. Also, some special cases (e.g., empty `path`) were only tested indirectly by the fact that the current version of `ListLastCommitsForTree` uses the same internal function. As expected, this uncovers some minor bugs, such as error on unresolvable revision, which we fix right away
-
- May 03, 2023
-
-
Georges Racinet authored
This introduces a new binary dependency on the [Tokei](https://crates.io/crates/tokei) code statistics tool. The path to the Tokei executable is configurable as `hgitaly.tokei-executable`, defaulting to `tokei`. Strict comparison with Gitaly is not fully possible, as Tokei does not produce the very same results as GitHub Linguist (or `go-enry` which is the library Gitaly is currently moving to). For instance `robots.txt` is detected as the `robots.txt` language by Linguist and as `Plain Text` by tokei. That being said, we can compare more frequent results, namely Python and Ruby. We vendor the `languages.json` file from GitHub Linguist to add the color information (not part of Tokei results), with the same defaulting logic as Gitaly (see the detailed docstrings), based on a hash of the language name. We were lucky to find a programming language (COBOL) to base our tests on. It is important to sort the results in decreasing order, because the Rails app considers only the 5 most frequent languages in the repository, and does so by truncating at the 5 first elements.
-
- Jul 17, 2023
-
-
Georges Racinet authored
The implementation itself is more general than `FindCommits`: we make it an option in `message.commit()`. For this, we need to read all state files. Because `FindCommits` may return lots of commits, we do it once and cache the reverse mapping on the repository object. Of course this is somewhat heavy if only one commit is being queried, especially if the pattern is about only one type of refs (e.g. branch refs, whose numbers are much less than all past special refs). An improvement would be to remember which type of file has been read already, and load the files on-demand. Another improvement would be to have an efficient format allowing to have all refs in one single db file. Since it is unlikely that keep-arounds would be asked in this way, we omit them for the time being. Most of the actual testing is done as a Gitaly Comparison test. We don't have a formal definition of the matching at the time being, so this is defined by the examples in the test (reading Git source code should provide better answers). Finally, RHGitaly should grow the `message.commit` equivalent, but it would not be useful right now. However, if `FindCommit` would turn out to also get this option, we'd have to do the Rust version. Closes #136
-
- Jul 08, 2023
-
-
Georges Racinet authored
Developments on stable branch were entirely driven by RHGitaly, leading to better matching of Gitaly in corner cases and errors. A change had to be made for Comparison tests to pass: the error message in `FindCommit` with no arguments at all is now the one about the `repository` argument missing instead of `revision`. This is so much a corner case that we don't bother matching and simply add `same_details=False`. The change may have happened anywhere between Gitaly v15.5 and v15.9.
-
- Jul 05, 2023
-
-
Georges Racinet authored
Closes #141
-
Georges Racinet authored
Someone got hasty…
-
Georges Racinet authored
Probably just a leftover, it passes.
-
- Jun 29, 2023
-
-
Georges Racinet authored
This is now a direct application of `gitlab_revision_node_prefix()`. Perhaps worth of notice is the fact thay we stay purely async until the revision is resolved as a `NodePrefix`, and only spawn a thread once it is really needed (access to repository `Changelog`).
-
Georges Racinet authored
As usual, the Rust reimplementation raises some questions, and we answer them. The case of empty (missing) revision was spotted because Gitaly returns the error about it even if the repo argument is missing.
-
- Jun 07, 2023
-
-
Georges Racinet authored
The case of the full node that does not exist goes through a quite different path in the sub-service layer implementation (will be moreso true with RHGitaly), it's worth its own test case.
-
Georges Racinet authored
-
- Jun 06, 2023
-
-
Georges Racinet authored
Previously, the test was passing because the Python reference implementation of HGitaly relies on `scmutil.revsingle` for revisions not found in GitLab state files, including tags given in simple form (e.g. `v1.2.3`). But RHGitaly will rely on the GitLab state files only, hence we need to ensure that the tags state file contains the one we introduce, which is shadowing in the short SHA case The added GitLab sync has the effect of removing directly set tags that have no Mercurial counterpart from the GitLab state file, that's why it has to occur before `write_ref()` in this test of collision/shadowing were Mercurial and Git tags must have different names.
-
Georges Racinet authored
As illustrated with the new assertions in `test_compare_find_commit`, it turns out that in Gitaly, tags have precedence over branches (unsurprisingly) and over shortened commit ids, but not on full commit ids.
-
- May 16, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
The previous way of invalidating the Mercurial to Git map was to delete the cached property, but it raises an error if it has not been used before. In theory the invalidation could be removed if not necessary any more. In practice, this forces to check that it is normal. Better to encapsulate. Also, for simplicity, we also invalidate Mercurial caches by reloading the repo.
-
- May 15, 2023
-
-
Georges Racinet authored
There was even an old TODO about that
-
Georges Racinet authored
This method of the `CommitService` had no Gitaly Comparison test, because it was implemented before these tests were even considered. Such a test will be the main testing of the upcoming RHGitaly implementation. It turns out that we found a missing case: tag in the fully qualified ref notation (chances are that clients woud rather use `RefService.FindTag` but one never knows.
-
- Apr 13, 2023
-
-
Georges Racinet authored
Closes #118
-
- Apr 12, 2023
-
-
Georges Racinet authored
That no response at all should be sent is confirmed by the added assertions in the Gitaly Comparison test
-
- Mar 24, 2023
-
-
Georges Racinet authored
Basic, yet will provide the baseline for RHGitaly development.
-
- Mar 22, 2023
-
-
Georges Racinet authored
Turns out Gitaly issues an `INTERNAL` error in that case. Probably not intended, but we're ready for further changes down the road.
-
- Mar 12, 2023
-
-
Georges Racinet authored
This finally leverages the new revset predicates in a straightforward manner. Closes #105
-
Georges Racinet authored
We had the usual minor discrepancy: returning an empty response instead of an empty stream (the new Comparision Tests assertion does see the difference)
-
- Nov 16, 2022
-
-
Georges Racinet authored
Closes #116
-
- Mar 13, 2022
-
-
Georges Racinet authored
The test case with obsolescence for `CommitsBetween` (does not exist any more) was transformed into one for `ListCommits`
-
- Feb 13, 2022
-
-
Georges Racinet authored
This is obviously very partial given the list of request options and the fact that this is handed straight to git-rev-list, hence to be complete, we should implement all possible meaning of revisions, including mixing the `..` and `...` notation with simple commit ids and refs whenever Git accepts it. Still, current usage in GitLab is limited to `Repository#between`, hence revisions is `[^FROM, TO]`. Of course, more advanced cases can appear any time, but at least we'll have the proper harness to implement them. The ordering options cannot match exactly Gitaly's, see the lengthy explanation in docstring about this. closes #72
-
- Mar 02, 2022
-
-
Georges Racinet authored
At least since fb705af664d0, we don't have a fallback when default GitLab branch is not set. The test was actually testing nothing, because of the missing call (found while preparing a refactoring that should be next). Added comparison with Gitaly cases with HEAD to check as much as possible that behaviour is right: - empty repo (notice the invalidation) - and normal case where the mirroring to Git has set the default GitLab branch.
-
Georges Racinet authored
-
- Nov 03, 2021
-
-
Georges Racinet authored
This was a long standing TODO, and it finally had bad consequences, such as heptapod#554, because the Rails app introduced an early return if body size is 0 in upstream 13.3.0 (see heptapod@b937e23d5321). In turn, to test this in comparison with Gitaly, we have to make the ironing of differences that should not matter a bit smarter. The trailing line ending thing should be settled at some point, though.
-
- Oct 24, 2021
-
-
Georges Racinet authored
Now it compares the entire streams of responses and not just lists of commit ids. That being said, it's easy to make a test irrelevant with a bug that would have both Mercurial and Git return empty responses. Had to shoehorn somewhat the switch to sorting mode and back, using a custom attribute on `rpc_helper`, but that still works. Additional remarks: - if a changeset user is `testuser`, then Git puts `none@none` for the email address. - some assertions are now self-explanatory, we need less comments
-
Georges Racinet authored
This one is very direct.
-
Georges Racinet authored
The `rpc_helper` argument should be often useful, the `vcs` can be in some cases.
-
Georges Racinet authored
It probably doesn't change much in execution time, but it's clearer anyway.
-
Georges Racinet authored
With `rpc_helper.assert_compare`, it is no longer useful and has become a distraction to the reader.
-