- Jul 29, 2023
-
-
Georges Racinet authored
This builds on the previously introduced repository file extraction and conversion to `GetBlobResponse`. It is important to emit at least one response, even if the resulting data is empty (usually because of `limit=0`).
-
Georges Racinet authored
As noted in the comment, this is an important use case.
-
Georges Racinet authored
This handles the fact that `GetBlobResponse` and `GetBlobsResponse` have some similar logic (including metadata only on the first message for a given blob) and some differences (more metadata in the latter). We enclose the common logic in the new `message::BlobResponseChunk` trait, and implement it for both response types. The intermixing with data is not very natural in the Rust ownership context, we try and make it not too painful. There is possibly room for improvement in reducing cloning/allocations, perhaps using the `Bytes`-oriented variant of `prost`.
-
Georges Racinet authored
This provides the base logic to access file data, and a common representation for metadata that will be enough to implement the `GetBlob` and `GetBlobs` gRPC request, and that we hope to be reusable for the likes of `TreeEntry` and `GetTreeEntries`. The `rhgitaly::message` module will provide the necessary conversions to actual Gitaly response types.
-
Georges Racinet authored
Same as in `hgitaly.streaming`, and ultimately as in Gitaly, this is used as a constant that can be overridden by environment variable.
-
- Jul 28, 2023
-
-
Georges Racinet authored
Up to now, we didn't have the proper responses for the usual bogus cases (unknown commit, path, missing repo in requests, etc).
-
- Jul 29, 2023
-
-
Georges Racinet authored
-
- Jul 28, 2023
-
-
Georges Racinet authored
Same purpose as Python `hgitaly.oid`, of course more strongly typed.
-
- Jul 25, 2023
-
-
Georges Racinet authored
This is the removal of previously unneeded blocks kept for indentation.
-
Georges Racinet authored
Reduced duplication, and simpler error treatment.
-
Georges Racinet authored
Again keeping an unneeded block to get a readable diff.
-
Georges Racinet authored
This function provides the path to the store vfs, taking care of performing all checks, in particular that the repository exists. One advantage is the collapsing of the various problems (missing repo specfication, repo not found...) into a single `RepoSpecError`, so that callers can simply use `map_err()` and we don't need to take an error treatment argument. The check for `None` spares us a conditional block in the service implementation (kept an artificial block to have a readable diff by avoiding reindent). This is a new, simpler pattern, we'll see to generalize it.
-
- Jul 29, 2023
-
-
Georges Racinet authored
This is more convenient than using grpcurl to check the version. Also, one day it will be displayed in Heptapod UI, but that is not done yet.
-
- Jul 27, 2023
-
-
Georges Racinet authored
In the stable branches it's probably not so important to run triggered HGitaly pipelines, as usually py-heptapod does not change at all, but in any case this prevents the triggering job in py-heptapod to appear failed.
-
- Jul 26, 2023
-
-
Georges Racinet authored
-
- Jul 05, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
Closes #141
-
Georges Racinet authored
Someone got hasty…
-
Georges Racinet authored
Probably just a leftover, it passes.
-
- Jun 30, 2023
-
-
Georges Racinet authored
-
Georges Racinet authored
-
- 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.
-
Georges Racinet authored
This method is fairly simple, but it has the tremendous advantage to flatten three possible `RevlogError` into one, considerably simplifying error treatment for the caller.
-
Georges Racinet authored
This is in particular useful because it makes the return type of the `spawn_blocking` call explicit, a hint that the compiler would request even for so simple a method as `FindCommit`. Like `load_repo_and_stream()` it takes care of converting some errors into the proper `Status`, still letting the caller define what happens with `RepoSpecError`, which may have to differ from one request to the other.
-
Georges Racinet authored
-
- Jun 16, 2023
-
-
Georges Racinet authored
The `gitlab_revision_node_prefix()` function will be used in all gRPC methods that accept arguments that are single GitLab revisions. Even those that take ranges would use it, just less directly. `CommitService.FindCommit` would be the most straightforward case, but there are many more. Closes #126
-
Georges Racinet authored
As noted in comment, this should really be in the `store` subdirectory, but that is a fight (data migration) for another day.
-
Georges Racinet authored
`gitlab::state::lookup_typed_ref_as_node` is the specialization of `map_lookup_typed_ref` to return `Node`s, hence it is working on a single stream of typed refs, whereas the higher level `gitlab::revision::full_ref_node` is the specialization of `map_full_ref` that works for any ref given by its full path.
-
- Jun 15, 2023
-
-
Georges Racinet authored
Perhaps the simplest useful application of `map_full_ref`. Testing provided by Comparison tests. We have to introduce another wrapper for propper logging of the `revision` field (otherwise it is almost impossible to follow, even if one knows one's ASCII). This will be needed by many other methods. Closes #128
-
Georges Racinet authored
These were uncovered by doing the Rust implementation.
-
- Jun 04, 2023
-
-
Georges Racinet authored
As usual, we're copying over the proto file, removing the `rpc` blocks that we don't intend to implement, yet keeping all message definitions.
-
- Jun 14, 2023
-
-
Georges Racinet authored
Of course it will grow the equivalenbt of Python's `gitlab_revision_changeset`, which is one of the most common helper functions in HGitaly, making the `FindCommit` gRPC method almost trivial.
-
Georges Racinet authored
This time, because there is no arbitrary name to consider, hence no bytes string, Tokio's `LinesStream` is perfectly suitable for our needs.
-
Georges Racinet authored
This follows the file format and conventions defined in the server side `heptapod` Python package. Since everything is async, we actually provide Streams of TypedRef objects, and the `map_lookup_typed_ref` for the numerous use cases when one is looking for a specific ref. The file format is very primitive, so all we can do at this point is to perform a full scan, but it has room (version preamble) for more advanced formats in the future (e.g, append-only persistent hash map or similar). A preliminary version of this was using Tokio's `LineStream`, but this has several drawbacks: - it is unicode-centric, yielding `String`s - we had to implement our own `Stream`, keeping the `LineStream` as a field. Hence because `poll_next()` takes `&mut Pin<Self>` we had to write a pinning accessor, which is unsafe (see the doc for `std::pin` for more details).
-
Georges Racinet authored
When a file contains a list of values, it is a common pattern that the absence of the file is equivalent to the list being empty. This `io_error_not_found_as_none` will help keeping duplication low (even if fairly trivial).
-
- Jun 27, 2023
-
-
Georges Racinet authored
These are not frequent, hence systematic collecting is acceptable. On large repositories, it can prevent going over the RSS limit. Closes #132
-
- 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.
-