- Mar 07, 2024
-
-
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.
-
- 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.
-
- Aug 12, 2023
-
-
Georges Racinet authored
This parallels Python's `heptapod.branch.gitlab_branch_ref`.
-
- Aug 06, 2023
-
-
Georges Racinet authored
Rust 1.65 is currently the version generally available in GitLab context (upstream usage appeared recently) and it is also able to build tokei 12.1.2, whereas 1.61 cannot. This leads up to fix the following Clippy error (not in 1.61): "you are deriving `PartialEq` and can implement `Eq`".
-
- Jul 29, 2023
-
-
Georges Racinet authored
This will be used once in a thread created by `spawn_blocking`, typically with the closure given to the likes of `repository::load_repo_and_stream`. It is a bit annoying to introduce the dependency to `futures::executor` for this, but we don't feel at ease using `tokio::runtime::Runtime.block_on`, as this is really meant as an entry point (looks like we'd need to create a new runtime and it's not clear whether it would interfere with the current running one or not).
-
- Jun 29, 2023
-
-
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 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).
-