Skip to content
Snippets Groups Projects
  1. Aug 07, 2023
    • Georges Racinet's avatar
      rhgitaly::oid: methods for tree handling · eb6763d7
      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).
      eb6763d7
    • Georges Racinet's avatar
      rhgitaly::mercurial::ls_path: listing a subset of manifest · 721ac5a4
      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.
      721ac5a4
    • Georges Racinet's avatar
      RHGitaly: allowing to stream TreeEntryResponse from BlobResponseChunk · 87b6970c
      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.
      87b6970c
  2. Jul 31, 2023
    • Georges Racinet's avatar
      rhgitaly::mercurial: preparation for CommitService.TreeEntry · 562c5d46
      Georges Racinet authored
      We split `lookup_blob()` in two functions, so that
      parts can be reused without reopening changelogs, manifests etc.
      Notably, the implementation of `TreeEntry` will use `read_blob`
      in case it is serving a blob and not a tree: in this case
      the manifest entry has already been found, no need to reopen and
      rescan anything.
      562c5d46
  3. Aug 05, 2023
    • Georges Racinet's avatar
      CI/CD: using a bigger flavor for tests-rust · 71576e6b
      Georges Racinet authored
      This job is way longer than the Python tests in the same
      stage and is needed for Comparison Tests.
      
      Most of the time being spent in Rust compilation, it should be
      worthwile to launch a worker with more CPUs.
      71576e6b
    • Georges Racinet's avatar
      Comparison tests: using a prebuilt RHGitaly, especially in CI · 677f804b
      Georges Racinet authored
      In CI, the artifact size is becoming huge (~1.6G), and it's not so useful
      to rebuild in the `comparison` job, as this is not caching.
      
      We introduce the option to take a path to a prebuilt RHGitaly from
      environment variables, and use it in CI, which allows us to
      restrict the artifact to the (much smaller) final executable, provided
      we actually run `cargo build`.
      677f804b
  4. Aug 01, 2023
  5. Jul 31, 2023
    • Georges Racinet's avatar
      RHGitaly implement HasLocalBranches · e0fbe488
      Georges Racinet authored
      This method is mostly used to check if the repository is emtpy (and
      that is in the case of Mercurial logically equivalent),
      but it's better to implement it using the GitLab branches file as it
      avoids actually opening the repository, spawning a thread for
      blocking iteration etc.
      e0fbe488
  6. Jul 30, 2023
  7. Jul 29, 2023
    • Georges Racinet's avatar
      RHGitaly: implementing BlobService.GetBlobs · fd8aaff5
      Georges Racinet authored
      This finally puts together all the common logic already used in
      `GetBlob`, and we can switch on the Comparison tests (one single
      test function for both gRPC methods).
      
      Using `blocking_gitlab_revision_node_prefix` is not very elegant,
      we could probably resolve all the revisions before entering the blocking
      thread (and perhaps also avoid scanning the state files many times),
      but this is deemed not so important for the time being, compared to
      the huge efficiency boost provided to Heptapod by
      implementing this method in Rust.
      
      As is now customary, the tracing part has us create a wrapper struct
      and implement `Debug` because of the bytes in `RevisionPath`. At
      some point we'll have to come up with something more generic for this.
      fd8aaff5
    • Georges Racinet's avatar
      RHGitaly: blocking variant of revision resolution · 81cb41f4
      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).
      81cb41f4
    • Georges Racinet's avatar
      RHGitaly: BlobService.GetBlob · 03355820
      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`).
      03355820
    • Georges Racinet's avatar
      Blob Gitaly comparison tests: testing with limit=0 · 7e37f156
      Georges Racinet authored
      As noted in the comment, this is an important use case.
      7e37f156
    • Georges Racinet's avatar
      RHGitaly: Blob gRPC messages definitions and adapters · d274bd92
      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`.
      d274bd92
    • Georges Racinet's avatar
      RHGitaly: repository files extraction with metadata · 76f69a84
      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.
      76f69a84
    • Georges Racinet's avatar
      RHGitaly WRITE_BUFFER_SIZE lazy static · 93c0c47c
      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.
      93c0c47c
  8. Jul 28, 2023
  9. Jul 29, 2023
  10. Jul 28, 2023
  11. Jul 25, 2023
  12. Jul 29, 2023
  13. Jul 27, 2023
    • Georges Racinet's avatar
      CI/CD: unblock triggered pipelines · bf041abb
      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.
      bf041abb
  14. Jul 26, 2023
  15. Jul 05, 2023
  16. Jun 30, 2023
  17. Jun 29, 2023
    • Georges Racinet's avatar
      RHGitaly: CommitService.FindCommit implementation · 6e654158
      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`).
      6e654158
    • Georges Racinet's avatar
      CommitService.FindCommit: errors for corner cases · 5c477c33
      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.
      5c477c33
    • Georges Racinet's avatar
      RHGitaly: message::commit_for_node_prefix · 6b54aa74
      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.
      6b54aa74
    • Georges Racinet's avatar
      RHGitaly: repository loading helper for unary RPC methods · 8b6fdf35
      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.
      8b6fdf35
    • Georges Racinet's avatar
      RHGitaly: comment typo · 12caab4c
      Georges Racinet authored
      12caab4c
Loading