Skip to content
Snippets Groups Projects
  1. Mar 07, 2024
  2. Mar 03, 2024
  3. Mar 02, 2024
    • Georges Racinet's avatar
      GetTreeEntries: structured errors, Python only · fa53ea518751
      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.
      fa53ea518751
  4. Feb 14, 2024
  5. Feb 13, 2024
    • Georges Racinet's avatar
      RHGitaly: bumped hg-core to Mercurial 6.6.3 · 9d85d59c7442
      Georges Racinet authored
      It contains an important fix for `ChangelogRevisionData.files`. We
      don't seem to use that method yet, but are prone to, as it would be
      the main backing data access for the likes of `LastCommitForPath`
      9d85d59c7442
  6. Feb 10, 2024
  7. Jan 13, 2024
  8. Jan 09, 2024
  9. Jan 07, 2024
    • Georges Racinet's avatar
      RHGitaly packaging: fix hg-core by including configitems.toml · 1b5b0f072cee
      Georges Racinet authored
      This is now needed to build hg-core, but lies outside of it.
      
      In truth what happens is that taking a tarball of hg-core or even
      the entire rust workspace of Mercurial is not self-contained and
      cannot be fixed unless there is at least one intermediate directory
      (as is the case here).
      
      Should talk upstream about it.
      0.43.1
      1b5b0f072cee
    • Georges Racinet's avatar
      RHGitaly: updating hg-core to version 6.6.1 · ff013182a019
      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.
      ff013182a019
  10. Jan 03, 2024
  11. Jan 02, 2024
    • Georges Racinet's avatar
      rhgitaly: upgrade tonic to 0.10 · a341ff42d5bf
      Georges Racinet authored
      Done initially as an attempt to fix the `RST_STREAM` code 1 error
      (actually triggered by clients based on gRPC core 1.58 sending the
      wrong `authority` for Unix Domain Sockets), but it is an interesting
      update in itself, apparently bringing in rich errors capabilities that
      could well be the same one we will be needing in `GetTreeEntries` etc.
      a341ff42d5bf
  12. Dec 23, 2023
    • Georges Racinet's avatar
      RHGitaly: bump hg-core dependency to 6.5.3 · de615355a258
      Georges Racinet authored
      This matches the version used in Heptapod 0.40 and the future 0.41.
      
      HG: Enter commit message.  Lines beginning with 'HG:' are removed.
      HG: Leave message empty to abort commit.
      HG: --
      HG: user: Georges Racinet <georges.racinet@octobus.net>
      HG: topic 'bump-proto'
      HG: branch 'stable'
      HG: changed rust/Cargo.lock
      HG: changed rust/mercurial.rev
      de615355a258
    • Georges Racinet's avatar
      Bump Gitaly protocol to v16.3 · 9ae42b08c114
      Georges Racinet authored
      As often, it doesn't change in patch versions.
      9ae42b08c114
  13. Nov 10, 2023
  14. Sep 24, 2023
    • Georges Racinet's avatar
      RefService.FindDefaultBranchName: filter out non existing target · 41582380b224
      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.
      41582380b224
  15. Sep 21, 2023
    • Georges Racinet's avatar
      RHGitaly: resynced protocol with general Gitaly protocol · 14ed25522afe
      Georges Racinet authored
      Parent changeset removed two messages, and previous bump of Gitaly
      protocol had some other changes that don't affect RHGitaly (or introduce new
      options that are not implemented yet), but should be applied for clarity:
      RHGitaly protocol definitions should have all messages and a subset
      of the methods.
      14ed25522afe
  16. Sep 20, 2023
    • Georges Racinet's avatar
      CommitService.GetTreeEntries: remove root_oid · eef65d4bfe42
      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
      eef65d4bfe42
  17. Aug 31, 2023
    • Georges Racinet's avatar
      GetTreeEntries: testing and fixing some corner cases · 45749dd37964
      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.
      45749dd37964
  18. Aug 30, 2023
    • Georges Racinet's avatar
      RHGitaly: implement CommitService.GetTreeEntries · 63daae2a133c
      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`.
      63daae2a133c
    • Georges Racinet's avatar
      rhgitaly::mercurial::DirIteratorWithFlatPaths · aba798503268
      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)
      aba798503268
    • Georges Racinet's avatar
      rhgitaly::mercurial::RecursiveDirIterator · 934afef84173
      Georges Racinet authored
      This is the core engine for one of the three modes of
      `CommitService.GetTreeEntries`.
      934afef84173
  19. Aug 31, 2023
    • Georges Racinet's avatar
      rhgitaly::mercurial::DirIteratorWithoutFlatPaths · 74c6bbd8b086
      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.
      74c6bbd8b086
  20. Aug 30, 2023
    • Georges Racinet's avatar
      rhgitaly::util::common_subpath_split · b4465e96862f
      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.
      b4465e96862f
    • Georges Racinet's avatar
      rhgitaly::mercurial: an iterator over a directory of a manifest · 831f85fc375a
      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.
      831f85fc375a
    • Georges Racinet's avatar
      rhgitaly::streaming::stream_with_pagination · 13486a81ceb7
      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.
      13486a81ceb7
    • Georges Racinet's avatar
      rhgitaly::streaming::stream_chunks · d124dd5220da
      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.
      d124dd5220da
  21. Aug 18, 2023
  22. Aug 12, 2023
  23. Aug 07, 2023
  24. Jul 31, 2023
  25. Aug 07, 2023
    • Georges Racinet's avatar
      rhgitaly::oid: methods for tree handling · eb6763d77568
      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).
      eb6763d77568
    • Georges Racinet's avatar
      rhgitaly::mercurial::ls_path: listing a subset of manifest · 721ac5a4c6a6
      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.
      721ac5a4c6a6
    • Georges Racinet's avatar
      RHGitaly: allowing to stream TreeEntryResponse from BlobResponseChunk · 87b6970c4ac6
      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.
      87b6970c4ac6
Loading