Skip to content
Snippets Groups Projects
  1. Mar 07, 2024
  2. 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
  3. Aug 12, 2023
  4. Aug 06, 2023
    • Georges Racinet's avatar
      RHGitaly: bumped MSRV to 1.65 · 2acf3e5f6f58
      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`".
      2acf3e5f6f58
  5. Jul 29, 2023
    • Georges Racinet's avatar
      RHGitaly: blocking variant of revision resolution · 81cb41f4e9fa
      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).
      81cb41f4e9fa
  6. Jun 29, 2023
  7. Jun 16, 2023
    • Georges Racinet's avatar
      RHGitaly: GitLab revision resolution as node. · 734564f0daab
      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
      734564f0daab
    • Georges Racinet's avatar
      RHGitaly: reading the GitLab default branch file · c81b8f78d8d1
      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.
      c81b8f78d8d1
    • Georges Racinet's avatar
      RHGitaly: utilities to resolve refs as Nodes · 2c80b0782b36
      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.
      2c80b0782b36
  8. Jun 14, 2023
    • Georges Racinet's avatar
      RHGitaly: gitlab::revision, only with `map_full_ref()` for now. · 5ac1a8499504
      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.
      5ac1a8499504
    • Georges Racinet's avatar
      RHGitaly: reading keep-arounds state file · 725e8c524ffa
      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.
      725e8c524ffa
    • Georges Racinet's avatar
      RHGitaly: reading GitLab ref files · bcab70280a33
      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).
      bcab70280a33
Loading