- Mar 09, 2024
-
-
Georges Racinet authored
All error cases in this function were actually `StateFileError`. It is true it can be transparently converted to `RefError` but the latter will be inappropriate in the upcoming `ListRefs` inner implementation, where `StateFileError` is the only considered one.
-
Georges Racinet authored
…and a performance note.
-
Georges Racinet authored
They can be useful besides for concatenation purposes.
-
Georges Racinet authored
Up to know, all the streaming gRPC methods we implemented have been using the `spawn_blocking` pattern, but some `RefService` methods will not need to actually open repositories, changelogs etc, hence will be implemented with async tasks (`tokio::spawn`). This defines types shortcuts and reexposes `send()` with the only possible error treatment in case the channel is broken: logging it.
-
- Mar 08, 2024
-
-
Georges Racinet authored
Some motivation for making a macro or something.
-
- Mar 07, 2024
-
-
Georges Racinet authored
This reduces duplication in error treatment for Node prefixes that do not resolve, an area in which we hope `hg-core` will change.
-
Georges Racinet authored
This helps reduce the duplication in service code a bit, as the error treatment always turns out to be the same. It seems unlikely anything other than `Internal` could be useful if the changelog cannot be opened. It also uncovers that methods returning several blob or trees were reopening the changelog for each returned value and reduces that partially (not true in case of `get_blobs`). This is probably not much anyway for anything making use of the manifest, given how inefficient it is, but it may help in the future.
-
Georges Racinet authored
This is essentially trivial, since we are returning a constant. The Comparison test looks silly, but it is still useful, as it is the only thing proving that it actually works, and it forced us to return the same errors as Gitaly, which is obviously a good thing. We might want a direct HGitay vs RHGitaly comparison at some point, though. Closes #187
-
Georges Racinet authored
Because we need to release ASAP as part of Heptapod 1.1.2 (also has an upstream security release), we won't deduplicate the fetching of the target commit, but it should be done shortly after the release. Closes #186
-
Georges Racinet authored
It is hard imagining converting this Heptapod-specific error into something else than `Internal`. Anyway, such shortcuts do not preclude performing manual error treatment.
-
Georges Racinet authored
Expected to be used more than once across the code base, like its older sibling for branches.
-
- Mar 03, 2024
-
-
Georges Racinet authored
Closes #156. This is the first concrete use of the new facilities provided by `rhgitaly::errors`. These latter do not spare so much typing, but they help main service methods such as in this case `inner_get_tree_entries` not to lose too much focus.
-
Georges Racinet authored
Made a submodule in order to be able to explain the conventions, see the doc-comment about that.
-
Georges Racinet authored
This is heavily inspired by (and partially duplicated from) `tonic_types`, which cares only about the standard set of errors defined by Google's "richer errors".
-
- Mar 02, 2024
-
-
Georges Racinet authored
This is the Python part of #156, and it also serves to prepare the Comparison test that will validate the Rust side. In ordinary integration tests, we do not assert the exact value of the structured error: the Comparison tests will be much better to make sure they are correct, so we content ourselves with maintaining coverage in them.
-
- Feb 14, 2024
-
-
Georges Racinet authored
This is nicer when running `rhgitaly --help`
-
Georges Racinet authored
Turns out this is a clap builtin. Closes #180
-
- Jan 09, 2024
-
-
Georges Racinet authored
-
- Jan 07, 2024
-
-
Georges Racinet authored
- using the node id rather than the tag in `mercurial.rev`, to dodge the usual problems with tags - had to pin down the new `toml` dependency and the `serde_spanned` it brings because MSRV of serde_spanned 0.6.5 is 1.67.0 - a few into() were needed due to the introduction of `UncheckedRevision`. Mostly because we get `Revision` from nodemap calls. Perhaps this can be simplified later on. This is expected to be 0-cost anyway.
-
- Jan 03, 2024
-
-
Georges Racinet authored
Structured errors in `GetTreeEntries` will be a larger effort, should be done this week, though.
-
- Nov 10, 2023
-
-
Georges Racinet authored
In the case of unknown storage, we find it useful to repeat the requested name, hence we simply stop comparing exactly the details. In the case of the missing repository field, the new upstream message is clearly better, so we adopt it.
-
- Sep 24, 2023
-
-
Georges Racinet authored
It turns out that Gitaly returns an empty response on an empty repository, whatever the value stored as default branch might be. In case the default branch points to a branch that does not exist, it returns the first branch it can find. This latter case cannot happen with the state maintainer provided by py-heptapod. This can be important for various mechanisms to actually set the default branch. We're simply returning an empty response if the default branch is set but its target does not exist. This amounts to the same in all current scenarios. Later on we could return the first GitLab branch if that becomes useful.
-
- Sep 20, 2023
-
-
Georges Racinet authored
Of course this requires an update of the base image, to get a Gitaly past the point when `root_oid` is removed from protocol. We could run locally the Comparison tests with 16.0.0, which is simpler to reference than an exact commit, so we'll try this. The length of the first response in `test_compare_get_tree_entries_pagination` by Gitaly changes, perhaps because each `TreeEntry` is a bit smaller (we've long suspected the streaming logic was based on actual size hints), but we did not check that. Closes #151
-
- Aug 31, 2023
-
-
Georges Racinet authored
Testing the case of `limit=0` and revision unknown uncovered a small difference between HGitaly and Gitaly (RHGitaly was already compliant): HGitaly was returning a response, with an empty list of entries. Decided to change `chunked()` to avoid yielding an empty chunk, but it turned out that `RepositoryService.SearchFilesByName` was actually expected to yield responses with empty lists, hence we hade to make it optional. The check in `CommitService` to avoid empty chunks having become default, we had to remove it to kepp coverage.
-
- Aug 30, 2023
-
-
Georges Racinet authored
This builds on the previously introduced elements: iterators for the three cases, helpers to stream in paginated chunks and activates the Gitaly Comparison tests for this method. The actual call to the iterators look to be identical, but they are not, as monomorphisation will give us three different `stream_get_tree_entries_from_iterator`.
-
Georges Racinet authored
This is the engine behind the non-recursive case of `CommitService.GetTreeEntries`, if `skip_flat_paths` is `false`. Like the Python reference HGitaly implementation, we are interpreting the "flat path" to be the greatest common path of all entries equal or inside the given entry (see `hgitaly.manifest` Python module for details about this)
-
Georges Racinet authored
This is the core engine for one of the three modes of `CommitService.GetTreeEntries`.
-
- Aug 31, 2023
-
-
Georges Racinet authored
This iterator will be the core engine of `CommitService.GetTreeEntries` in the simplest case: non-recursive without flat paths computation. The flat paths computation is not as expensive in the Mercurial case as it is in the Git case, because we are iterating over the entire manifest anyway (a later version might use a binary search to find the starting point of the requested directory, but all files within the directory will have to be scanned), but not doing it enables this simple implementation: namely we can yield top-level directories immediately, and hence to have at most one `TreeEntry` to yield per run of the loop.
-
- Aug 30, 2023
-
-
Georges Racinet authored
This utility method finds the greatest common denominator of two paths, and helps using the remainder in one of them. It takes care of the various edge cases (strict equality, trailing slashes) and will be used several times in the `GetTreeEntries` implementation.
-
Georges Racinet authored
This will be useful to implement the various cases of `GetTreeEntries`. It could also be extended to be used in `ls_path`, but that would require treating the special case where the given path is actually a file. Consider sending this UPSTREAM.
-
Georges Racinet authored
This generic helper in `rhgitaly::streaming` is for the case of streamed responses with `repeated` items, the whole stream being the current page. In all cases known to us, GitLab derives some information from the last item of the last chunk to be the `next_cursor`, hence we introduce a trait for the item to represent that, and use it in the implementation. The first use-case will be the implementation of `CommitService.GetTreeEntries`, but this also makes the likes of `RefService.FindLocalBranches` essentially trivial.
-
Georges Racinet authored
This Rust version of Python `hgitaly.util.chunked` should be useful for many gRPC methods. It provide the means to distinguish the first response, but does not implement the pagination protocol.
-
- Aug 18, 2023
-
-
Georges Racinet authored
Probably more complicated than it should, but it works and can be swapped later to something more straightforward.
-
- Aug 12, 2023
-
-
Georges Racinet authored
Closes #135
-
Georges Racinet authored
This parallels Python's `heptapod.branch.gitlab_branch_ref`.
-
- Aug 07, 2023
-
-
Georges Racinet authored
Adaptation to match changes of Gitaly error details in `CommitService.TreeEntry`
-
- Jul 31, 2023
-
-
Georges Racinet authored
We put the previously introduced building blocks together and validate with the Gitaly Comparison test, with some improvement needed in its expensive fixture left for follow-ups.
-
- Aug 07, 2023
-
-
Georges Racinet authored
There are for now completely identical to methods for blobs, but they could well become different (e.g, different disk caches or whatever).
-
Georges Racinet authored
This will be useful to implement `CommitService.TreeEntry`. There is plenty of room for performance improvement, notably: - the position of the first relevant entry could be found by binary search instead of a linear scan - we could try and clone less But it is possible that this would not be really needed, given the performance and scalability boost given by RHGitaly over HGitaly, before Mercurial manifests start using a more efficient layout, making this code obsolete.
-
Georges Racinet authored
We will soon implement `CommitService.TreeEntry`, which has to behave like `GetBlobs` on one `RevisionPath` in case it turns out the path is a blob.
-