Skip to content
Snippets Groups Projects
  1. Jan 03, 2024
    • Georges Racinet's avatar
      Error treatment: matching Gitaly 16.4.0 except for #156 · 296cf2ea
      Georges Racinet authored
      Structured errors in `GetTreeEntries` will be a larger effort,
      should be done this week, though.
      296cf2ea
    • Georges Racinet's avatar
      Comparison Tests: allow not to compare structured errors · 2c7eb9ca
      Georges Racinet authored
      This brings some incrementality, provided the developper references
      a tracking issue. In our current case, we have to return structured
      errors for the first time [from RHGitaly](#156), which has to be
      done, but we don't have enough time to tinker with tonic builtins for that
      today. On the other hand, we can at least return the proper error status.
      
      Not covering the case where they are skipped, because it is meant to
      be exceptionally used.
      2c7eb9ca
  2. Jan 02, 2024
    • Georges Racinet's avatar
      New dev cycle · 0766cfb9
      Georges Racinet authored
      0766cfb9
    • Georges Racinet's avatar
      8131c9e2
    • Georges Racinet's avatar
    • Georges Racinet's avatar
      rhgitaly: upgrade tonic to 0.10 · a341ff42
      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.
      a341ff42
    • Georges Racinet's avatar
      gRPC: bumping to 1.58 · 3d5614cb
      Georges Racinet authored
      Normally, this version should also be compatible with Python 3.11
      (supported as of 1.49), but I still could not install it in a
      HDK virtualenv (might be a Cython version problem, though).
      
      This brings an unexpected complication: the Python client for
      gRPC 1.58 sets a wrong default authority header in the case
      of Unix Domain Sockets (the Ruby client does the same, and possibly
      also the Go client). General work-arounds might be in the works
      at the level of the `h2` crate, but for now the rigorous Rust
      implementations don't accept it, so we have to fix it client-side.
      In this case, this was a problem in Comparison Tests only.
      
      This is well worth a minor version bump.
      3d5614cb
    • Georges Racinet's avatar
      Merged stable branch into default · 7b082b30
      Georges Racinet authored
      7b082b30
    • Georges Racinet's avatar
      hgdemandimport: unconditional disabling · e43149f8
      Georges Racinet authored
      hgdemandimport has always been of little value for long-running
      processes, such as HGitaly.
      
      On the other hand, attempts to upgrade the gRPC dependencies (grpcio etc.)
      to 1.58 showed that it was wreaking havoc with imports between generated stub
      modules, with messages such as:
      
        TypeError: Couldn't build proto file into descriptor pool: Depends on file
        'google/protobuf/timestamp.proto', but it has not been loaded
      
      (this one upon importing `shared_pb2`, but it does not matter).
      e43149f8
  3. Dec 23, 2023
    • Georges Racinet's avatar
      Merged oldstable branch in stable · b62026a8
      Georges Racinet authored
      b62026a8
    • Georges Racinet's avatar
      RHGitaly: bump hg-core dependency to 6.5.3 · de615355
      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
      de615355
    • Georges Racinet's avatar
      Bump Gitaly protocol to v16.3 · 9ae42b08
      Georges Racinet authored
      As often, it doesn't change in patch versions.
      9ae42b08
    • Georges Racinet's avatar
      DiffService.CommitDiff: fully implement whitespace options · 582aee6e
      Georges Racinet authored
      In Gitaly protocol 16.3, the `ignore_whitespace_changes` boolean
      disappears, being replaced with a 3-valued enum, corresponding
      to two levels of whitespace ignoring in Git.
      
      The disparition means that the attribute was long deprecated, and
      no upstream client had been using it for a while, so it was about
      time we implement the "new" `WhitespaceChanges` enum.
      
      Closes #137
      582aee6e
  4. Dec 20, 2023
  5. Dec 19, 2023
  6. Dec 17, 2023
    • Georges Racinet's avatar
      OperationService.UserFFBranch implementation · 12ed203c
      Georges Racinet authored
      Closes #164
      
      In the course of implementation, we introduce the new `changeset_by_commit_id`
      helpers which are useful in cases where the input is expected to be a full
      Node ID (instead of any Git revspec) and that is to be validated (because
      Gitaly does). Would need their separated testing to commit them separately,
      too lazy today for that.
      12ed203c
  7. Dec 19, 2023
  8. Dec 17, 2023
  9. Dec 14, 2023
    • Georges Racinet's avatar
      OperationService: implement UserSquash · ddc25d39
      Georges Racinet authored
      The breakthrough is that HGitaly is able to control internal Git mirroring
      and this can be tested from HGitaly (ordinary) integration tests.
      
      The presence of the `commit_author` and `timestamp` attributes raise some
      questions more explicitely than it was the case in the Rails app, where the
      feature has been implemented long ago by spawning a Mercurial subprocess.
      We decided to behave identically, and in particular to postpone the question of
      representing the difference between committer and author to another time,
      as such a distinction does not exist currently in Mercurial (could be an extension
      around providing that, though).
      
      The `UserSquash` method in itself was only chosen because it does not
      have many options and is at its core very simple to implement.
      
      Closes #163
      ddc25d39
    • Georges Racinet's avatar
      HGitalyServicer: loading repository for mutation · 15f7720b
      Georges Racinet authored
      The `HGitalyServicer` base class now provides a `for_mutation_by`
      optional argument that triggers the setting of all needed repository
      config items and environment variables as already in use when spawning
      Mercurial subprocesses from the Rails application: repository mode (nativity,
      with Git mirroring or not), link to MR to allow distinguishing between
      merge permissions and direct pushes, etc.
      
      The acting user is part of the request message in all examples we
      have considered so far, hence passed down by the caller (concrete
      service subclass). Other metadata are expected as invocation metadata
      (hence HTTP/2 headers, which matches what also happens between Workhorse
      and the Rails aplication).
      
      We had to add invocation metadata handling to the `FakeContext`
      to maintain coverage. The import path from `grpc` is probably
      instable, but we'll live with it.
      
      
      WIP implement UserSquash, with Git mirroring or not
      
      Needs lint to be ok, coverage to be 100%, a decision about
      itering on invocation metadata so much.
      
      The breakthrough is that HGitaly is able to control internal Git mirroring
      and this can be tested from HGitaly (ordinary) integration tests.
      At this point this does not implement passing of user information to internal API
      (can only be tested from functional tests, as it requires
      a fully working Heptapod instance).
      
      The `UserSquash` method in itself was only chosen because it does not
      have many options and is at its core very simple to implement.
      
      
      WIP to fold: refactoring putting mutation metadata in repo config/environ
      
      
      WIP first version working in functional tests
      
      
      WIP some linting (grpc import in tests will be used later)
      
      
      WIP added tests with Gitaly
      
      
      Almost complete (for_mr_iid missing) except coverage when skipping Gitaly Comparison
      
      
      accept_mr_iid
      
      
      Full coverage for UserSquash
      15f7720b
    • Georges Racinet's avatar
      HGitalyServicer: utility to call Mercurial commands · 6f9ca3f8
      Georges Racinet authored
      Very similar to what, e.g., mercurial-testhelpers and many
      similar tools do. This is as close to the CLI as possible, and
      suitable for methods that can be implemented in a single mutating command,
      as the command will typically enclose the actual mutation in its own
      transaction.
      
      Methods to be implemented as a succession of mutation commands should
      better manage a single transaction themselves, probably at the price
      of a greate duplication from Mercurial core.
      6f9ca3f8
  10. Nov 30, 2023
  11. Dec 12, 2023
  12. Nov 24, 2023
  13. Nov 22, 2023
  14. Nov 21, 2023
  15. Nov 20, 2023
    • Georges Racinet's avatar
      RemoveRepository: make repo name in trash unique · 00a51b36
      Georges Racinet authored
      In case a project id is reused (Heptapod application context, since the
      repo path is derived from the project id) or a repository path is reused
      (e.g. in RSpec tests), it is possible that a previous failed cleanup
      (crash or brutal stop before the final trashed repo `rmtree) would
      get in the way of the removal.
      
      Unlikely, but easy to prevent by making the name in trash unique (time-based,
      random would also have been good).
      00a51b36
    • Georges Racinet's avatar
      RemoveRepository: better robustness in intermediate situations · 10d6717c
      Georges Racinet authored
      It was a mistake to depend on `load_repo`, as it will fail if,
      e.g., the `.hg` sub directory does not exist (seen in Rails
      RSpec tests) and various corrupted cases that a *removal* should
      clean up.
      
      The price to pay is the transactionality of the roster, but we
      cannot lock it properly without a repo. In theory in should be
      possible to instantiate the `Vfs` separately, but it does not seem
      to matter so much.
      
      With this change, if removing the working directories fails, it
      will not prevent removing the trashed repository (but of course
      we risk a later collision in workdirs).
      
      Backs out in particular changeset 1c735d40cfe7
      10d6717c
  16. Nov 18, 2023
  17. Nov 15, 2023
    • Georges Racinet's avatar
      Fixing a startup problem · 2a621d00
      Georges Racinet authored
      The error message is
      
      ```
      *** failed to import extension "hgitaly": unicode '[OPTIONS]...' found in cmdtable.hgitaly-serve
      ```
      
      It is completely obscure why this has not been a problem before. Got this with
      Mercurial 6.4.5, then 6.4 on Python 3.9 (usually running with Python 3.10 if that
      makes any difference).
Loading