1. 15 Apr, 2021 1 commit
  2. 05 Apr, 2021 2 commits
    • Georges Racinet's avatar
      HGitaly RSpec tests for Blob/Tree in fully native mode · 5a6c09aa65b2
      Georges Racinet authored
      The tests are conditionally skipped according to the
      HGitaly server version.
      There *is* a small discrepancy: line ending in commit message,
      but it doesn't actually lie in the code being tested, it should
      be a comparison case in `FindCommit`.
      Comparing with `HgGitRepository` is still useful for these
      tests at this point, because there is some plumbery involved
      on the Rails side for the HGitaly1 mode, and even in fully native
      mode, it's good to check that nothing goes wrong. When the dust
      settles on all this, though, it will be removable: actual thorough
      comparisons are to be done in the testing code of HGitaly.
      branch : heptapod
    • Georges Racinet's avatar
      RSpec: request and store HGitaly version on configuration object · ea7d9baf84e2
      Georges Racinet authored
      With this, the HGitaly version will be accessible as
      `RSpec.configuration.hgitaly_version`, and mostly used
      for conditional skipping, making hooking in Rails and
      landing in HGitaly less interdependent, provided new
      features in HGitaly come with an appropriate version
      change (doesn't have to be pushed to PyPI because the
      CI always run HGitaly from the head of the `default` or
      `stable` branch).
      The simplest syntax to skip RSpec tests is
        if 'does something', skip: boolean_method
      but `boolean_method` would have to be a class method, and
      would turn out to be executed before `TestEnv`, hence before
      HGitaly is started. Therefore the `skip` method will have to
      be run from examples (and `before` hooks). The new
      `RSpec.configuration` method is a good way to access the version
      information. It's not lazy, but it's expected to be negligible
      compared to the huge startup time.
      branch : heptapod
  3. 29 Mar, 2021 1 commit
    • Georges Racinet's avatar
      Mercurial fully native: hooking up Blob and Tree methods · d1704dedec2a
      Georges Racinet authored
      This relies on the HGitaly side implementation of these
      methods, and is the core difference between HGitaly1 and
      It does not seem relevant to try and split this in several
      changesets: as soon as a method returns a HGitaly Blob oid,
      it can be fed to another method, which then needs to be
      able to handle it.
      branch : heptapod
  4. 03 Apr, 2021 3 commits
    • Georges Racinet's avatar
      Mercurial fully native mode: list_last_commit_for_tree · b212225ac913
      Georges Racinet authored
      Similar to the Diff service methods, `ListLastCommitForTree`
      does not really depend on Tree nor Blob oids, so we could
      later on stop gating it with the fully native feature flag.
      branch : heptapod
    • Georges Racinet's avatar
      Updated some comments according to current plans · 16dfbc546af0
      Georges Racinet authored
      The previous wording were assuming that reaching HGitaly2
      will mean that the HGitaly1 mode of operation would no longer
      be useful. But actually, with the features flag based rollout,
      we'll have both in parallel.
      branch : heptapod
    • Georges Racinet's avatar
      Fully native Mercurial mode for DiffService · 17ae44e17a1f
      Georges Racinet authored
      In the fully native mode, we will now call HGitaly instead of
      Gitaly for the  Diff service (actually called by
      `GitalyClient::CommitService). This means in particular that
      we will skip the back and forth conversions.
      Because the dependence on actual Tree and Blob ids is very
      weak for diffs, we could even stop gating this with the
      feature flag in a later move. For now, it is a convenient way
      to test it in the wild.
      branch : heptapod
  5. 05 Apr, 2021 4 commits
    • Georges Racinet's avatar
      HGitaly RSpec: cosmetic changes to Blob/Tree spec · ca45bde93b1a
      Georges Racinet authored
      After the shared example reorg, using `subject` was just a source
      of confusion. Better clearly know what we are testing.
      Also made the full log in "documentation" mode (as in CI) a bit
      less awkward, but it's mostly a lost cause.
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly RSpec: made a shared example groups in Blob/Tree tests · 3367868ff782
      Georges Racinet authored
      This will allow us to run the same examples in the upcoming
      fully native mode easily.
      Diff is kept minimal, we'll tidy up right afterwards.
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly Rspec: moved Blob tests to the blob/tree file · 544078db0057
      Georges Racinet authored
      This is done with minimal adaptation
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly RSpec: adopted Tree tests in hgitaly_blob_spec · e88c01c07709
      Georges Racinet authored
      We are also renaming as `hgitaly_blob_tree_spec.rb`.
      It is a good thing to split the tests in several files, both
      for readability and for better balancing of shards in CI.
      Also, we're about to introduce new variants (RSpec contexts)
      for HGitaly2 feature flags.
      Since these tests are read-only, we also take care in the same
      move to create repo content only once for the whole examples file.
      This is a bit of wrestling with the test framework, perhaps
      reinventing partly factories:
      - the hgitaly_repo_init classmethod is needed to be callable
        from the `before(:all)` and `after(:all)` hooks.
      - we are still rewrapping it in the `let(:hgitaly_repo`
        statement, so that each call from the examples does not
        re-instantiate (would have no bearing on actual data, but
      - it's near impossible to stub the constant repo path both
        for the `:all` hooks and regular code, but we don't really
        need it any more. In `hg_git_repository`, we just clone
        the information carried by `hgitaly_repo`.
      branch : heptapod
  6. 03 Apr, 2021 2 commits
    • Georges Racinet's avatar
      GitalyClient::CommitService: stop cloning the Repository object · 9b0fba741fbc
      Georges Racinet authored
      This cloning was intermediate scaffolding for the early
      Hgitaly1 days: we didn't want to change almost every service
      method caller to switch from `@repository.storage` (would be
      Git without `vcs_storage_clone) to `@storage` when the fully
      native mode was still very far in the future: having to
      adapt new service methods from upstream just because we
      changed a few sounded ineffective.
      Now that the fully native mode is close to shipping, we can
      bite the bullet: we'll need to maintain all these methods
      anyway, or just upstream the switch to the `@storage` pattern.
      branch : heptapod
    • Georges Racinet's avatar
      Fully native: documented feature flags · 77c077605c66
      Georges Racinet authored
      This doc can be accessed on any instance as
      It was also the occasion to describe VCS types in general,
      although the doc for the settings should really be in
      (perhaps in more detailed form).
      branch : heptapod
  7. 02 Apr, 2021 2 commits
    • Georges Racinet's avatar
      Project: exposing the `hgitaly1` boolean in API · 01c9f0029eee
      Georges Racinet authored
      This will be useful to avoid people reaching wrong conclusions
      about issues being due to the fully native mode or not.
      In particular, it will be used by the functional tests to ensure
      that they are testing what they are supposed to test.
      branch : heptapod
    • Georges Racinet's avatar
      Fully native mode: feature flags and `Project#hgitaly1?` · 25538af903cb
      Georges Racinet authored
      Following the examples from
      we are introducing two feature flags:
      - `hg_fully_native` will be used to switch the whole instance
        to the fully native mode to be developped (HGitaly2 milestone).
      - `hgitaly1_fallback` will be used to get back for a specific project
        to the partial native mode of HGitaly1
      The evaluation is done relative to the whole instance or the project.
      Setting these feature flags for a group does nothing. This should
      be good enough for our progressive testing strategy. The documentation
      also warns against using several actors for one feature flag, hence
      we would need a third one to introduce group-level control.
      The convenience method `hgitaly1?` on the Project model provides
      a uniform way to know if the project is a Mercurial native one, running
      in HGitaly1 mode. To that end, it combines the `vcs_type` field and
      the feature flag, so that the result is meaningful for all kinds of
      Because the code controlled by the feature flags will typically
      be one of the  `GitalyClient` classes, it won't have direct access
      to the relevant project. Hence we are also providing the `hgitaly1?`
      method, on the three raw repository classes, that should in practice
      be the one to use from most code, notably classes within the
      `GitalyClient` module.
      Finally, we introduce new RSpec example files for the Project and
      Repository models in the Mercurial cases. That will help minimize
      useless conflicts when merging upstream GitLab. Because we don't
      have much specifics, it didn't seem useful to make separate files
      for the Repository model: we're testing the Repository (its
      `raw_repository` factory method notably), together with
      branch : heptapod
  8. 05 Apr, 2021 2 commits
    • Georges Racinet's avatar
      Merged test harness improvement from heptapod-stable · 7b2da10cf18f
      Georges Racinet authored
      branch : heptapod
    • Georges Racinet's avatar
      RSpec tests harness: avoid useless Workhorse rebuilds · 22de94601b66
      Georges Racinet authored
      Since Workhorse upstream GitLab bundled Workhorse in the main
      repository, the test harness is using it, with a detection system
      to trigger rebuilds. Being based on Git, it wasn't working
      properly, resulting in `bin/rspec` always rebuilding Workhorse.
      Here we adapt the rebuild triggering logic to Mercurial
      One could expect a Makefile calling the Go compiler to run fast
      in any case, but that still took 14 seconds on my fast workstation,
      the irony being that the tests we are using in development of
      Heptapod are very seldom calling through Workhorse.
      branch : heptapod-stable
  9. 02 Apr, 2021 5 commits
  10. 01 Apr, 2021 1 commit
  11. 30 Mar, 2021 3 commits
  12. 25 Mar, 2021 1 commit
  13. 24 Mar, 2021 1 commit
    • Georges Racinet on mutations.racinet.fr's avatar
      BlobService for HgitalyRepository: don't break on LFS methods · ff79d7dcdda0
      In-between GitLab v13.10.0-rc41 and v13.10.0, the LFS methods got
      systematically called, at least in HDK context. With the current
      HGitaly1 native repositories, this was calling Gitaly with a Mercurial
      changeset hash.
      It is possible we won't even need these methods for future LFS
      integration on fully native (HGitaly2) repositories. We'll see when we
      get to that.
      branch : heptapod
  14. 20 Mar, 2021 6 commits
  15. 19 Mar, 2021 1 commit
  16. 18 Mar, 2021 5 commits