Skip to content
Snippets Groups Projects
  1. Feb 11, 2024
    • Georges Racinet's avatar
      hgitaly.diff.Chunk: adopted and improved the index line insertion function · edce640489e1
      Georges Racinet authored
      It is now able to understand diff headers generated without the option
      that dumps the full binary content in Git format, and returns whether
      a binary placeholder is to be generated.
      edce640489e1
    • Georges Racinet's avatar
      Diffs: refactoring with a common `Chunk` class · 29a5c9015d1c
      Georges Racinet authored
      The main purpose is to encapsulate the various accesses to
      file contexts, hence
      
      - improving clarity
      - making sure to avoid repeated manifest lookups (even though they are
        partially cached, because the C `lazymanifest` should be instantiated
        only once).
      
      We take the opportunity to change some old/new namings in favour of
      from/to, clearer to us and more in line with Gitaly protocol namings.
      
      The minor drawback is that some methods do not really
      need the change contexts.
      29a5c9015d1c
    • Georges Racinet's avatar
      DiffService: moving index line util functions to hgitaly.diff · 03d51755d098
      Georges Racinet authored
      Although all callers are expected to be in the `DiffService`, this
      will improve the testing capability. Large refactorings are obiously
      needed.
      03d51755d098
  2. Feb 10, 2024
  3. Feb 09, 2024
  4. Jan 29, 2024
  5. Jan 28, 2024
    • Georges Racinet's avatar
      MercurialOperations: define and implement MergeBranch · dca77baea98a
      Georges Racinet authored
      This is the counterpart of Gitaly's `OperationService.UserMergeBranch`.
      
      We had to make a dedicated method because
      
      - the two-phase system of Gitaly does not make sense for Mercurial:
        merging does move branches right away, as branch information is
        enclosed in the changeset. We started development by mimicking it,
        but it soon became overly complicated
      - we have the `semi_linear` field, nothing alike on the Gitaly side,
        since the method always performs a merge, and ours would fast-forward
        by default.
      - we have error cases that do not exist in Git (obsolescence and
        instability checks). Actually, we reuse some of Gitaly errors
        to ease the burden of treatment on the client side. The case
        of `reference_check` being a borderline, but it shouldn't matter
        much.
      
      (bumping minimal py-heptapod version for `GitRepo.git()` helper method)
      dca77baea98a
  6. Jan 29, 2024
  7. Jan 28, 2024
  8. Jan 23, 2024
    • Georges Racinet's avatar
      Comparison tests: separated method to compare exceptions · 794bbdd4c2fb
      Georges Racinet authored
      As explained in the docstring, this will allow comparing exceptions
      obtained with different gRPC methods. First use-case will be Mercurial
      version of `UserMergeBranch` that will have to differ yet will return
      same exceptions and structured errors.
      
      Also introducing a way normalize structured errors: some of them, such
      as `MergeConflictError` can indeed contain commit ids.
      794bbdd4c2fb
    • Georges Racinet's avatar
      Servicer: adopted changeset publication method · d4c14b0b88f6
      Georges Racinet authored
      Because of the duality bewteen `OperationService` and
      `MercurialOperationService`, it will be useful to have it upstairs in the
      class hierarchy (attributes are really used, to that moving to an
      utility module will not be appropriate)
      d4c14b0b88f6
  9. Jan 18, 2024
    • Georges Racinet's avatar
      MercurialRepositoryService, proto: defined `ResetCaches` method. · 10aeb6d5502a
      Georges Racinet authored
      It is meant to back `hg_reset_tags_cache`, but we make room for
      other caches that could be useful in the future.
      10aeb6d5502a
    • Georges Racinet's avatar
    • Georges Racinet's avatar
      MercurialRepositoryService: added `Recover` and `Optimize` methods · 98e6b1627f81
      Georges Racinet authored
      The request and response for `Recover` were already defined, but the
      method was not.
      98e6b1627f81
    • Georges Racinet's avatar
      MercurialRepository proto: new Pull method · c143dda0c0c8
      Georges Racinet authored
      No need for user and internal API dance, so that is simple.
      We assume that the list of Gitlab branches will be small enough,
      but we could make a streaming variant later on if needed.
      Similarly, upstream's `FetchRemote` is not streaming either.
      c143dda0c0c8
    • Georges Racinet's avatar
      MercurialOperationService: implement PublishChangeset with GitLab hooks errors · a0aee70be565
      Georges Racinet authored
      The pre- and post-receive hooks error treatment is an important aspect
      of the question, since we cannot really test it from the service tests
      (we should at some point start a fake internal API server to that
      effect).
      However, the uniformity introduced by the `errors.operation_error_treatment`
      context manager makes it acceptable for the time being. First, it is
      entirely unit-tested, preventing stupid mistakes common in untested
      error treatment and second, this mutualization has the effect of having
      each gRPC method test its siblings, e.g., testing a real-life authorization
      failure would test all of them. It still depends on absence of typos
      in the protocol (would be better to make the `gitlab_hook` attribute name
      used in all of our methods).
      
      Since this method will soon be used on the Rails side for the
      file operations only, we don't add all checks that are in `UserFFBranch`
      for obsolete and unstable changesets, but we could.
      a0aee70be565
    • Georges Racinet's avatar
      MercurialOperationsService, proto: defined `PublishChangeset` method · 50e917e7c124
      Georges Racinet authored
      We had to introduce the `MercurialPermissions` enum, to play the same
      role as the existing "web" permissions (`heptapod-write`, `heptapod-publish`).
      
      Ideally, we should find a way to enforce these automatically, hence with
      an environment variable, so that it can be fully uniform with the way
      it works when receiving pushes for example.
      50e917e7c124
    • Georges Racinet's avatar
      Bumping minor version and regenerated Ruby gem for changes in protocol · 6647abde33d3
      Georges Racinet authored
      We already have new fields in `MercurialChangesetService` and are about
      to add a bunch of important new methods to other Mercurial services,
      fulfilling about a third of what remains to be done for HGitaly3 (remote
      HGitaly).
      
      Besides, next HGitaly version cut from this branch will back Heptapod 1.0.0,
      everything pleads for next HGitaly version to be 1.0.0
      6647abde33d3
    • Georges Racinet's avatar
      New test fixture for mutating methods · 746ce1ab33ad
      Georges Racinet authored
      746ce1ab33ad
  10. Jan 20, 2024
  11. Jan 17, 2024
  12. Jan 15, 2024
  13. Jan 13, 2024
Loading