Read about our upcoming Code of Conduct on this issue

  1. 27 Jul, 2020 2 commits
  2. 29 Jul, 2020 4 commits
  3. 28 Jul, 2020 3 commits
  4. 27 Jul, 2020 8 commits
  5. 19 Jul, 2020 6 commits
    • Georges Racinet's avatar
      RSpec tests for HgAccess · 4dc62079111e
      Georges Racinet authored
      These were simply copied from `git_access_spec` and
      adapted to work with `hg_access_spec`.
      
      At this point, we removed the tests related to protected
      branches, because they will probably lead us to changes that
      should not be done in the Heptapod 0.15 series
      
      It would be better to find a way to reduce code duplication, but
      this is obviously better than no tests.
      
      --HG--
      branch : heptapod
      4dc62079111e
    • Georges Racinet's avatar
      RSpec factories: hg_git_project and hg_repository · c40ee05f4b4f
      Georges Racinet authored
      The new `:hg_git_project` factory creates a Project
      with `vcs_type='hg_git'`, and the `:hg_repository`
      trait can be used to initialize its repository with
      commit content.
      
      The `:empty_repository` trait also works straight ahead for
      Projects created by `:hg_git_project`.
      
      --HG--
      branch : heptapod
      c40ee05f4b4f
    • Georges Racinet's avatar
      hg_access: restore check for authentication abilities · 5e816f27eabf
      Georges Racinet authored
      Not entirely sure what the real security implications are, but
      this has to be backported to the stable branch in any case.
      
      the `check_authentication_abilities!` method didn't use the
      correct (Mercurial) lists of download and push commands in the
      case of `HgAccess`. As a result, it was doing nothing.
      
      Spotted by RSpec tests about to be introduced, because the
      `ForbiddenError` message is expected to be the specific
      `:auth_download` or `:auth_upload` instead of just `download`
      or `upload`.
      
      --HG--
      branch : heptapod-stable
      5e816f27eabf
    • Georges Racinet's avatar
      First rspec tests for HgGitRepository · d907e80d79a1
      Georges Racinet authored
      They don't do much, but it's a start.
      
      An important piece of information is that this
      works right away on a HDK setup by running
      
      ```
      bin/rspec spec/lib/gitlab/mercurial
      ```
      
      In particular, the test harness does start a Gitaly
      server (and also Workhorse, but these repository
      tests don't need it)
      
      --HG--
      branch : heptapod
      d907e80d79a1
    • Georges Racinet's avatar
      hgignore for rspec synthetic report · 4f608c6af016
      Georges Racinet authored
      --HG--
      branch : heptapod
      4f608c6af016
    • Georges Racinet's avatar
      Constant for the NULL mercurial node · c587ede7cab6
      Georges Racinet authored
      Although it's the same value as in the Git case, who
      knows? They could evolve separately in the future.
      
      --HG--
      branch : heptapod
      c587ede7cab6
  6. 25 Jul, 2020 8 commits
    • Georges Racinet's avatar
      heptapod-ci: running RSpec tests for CI jobs · b9c26622dd30
      Georges Racinet authored
      This adds less than a minute on my workstation to the
      execution time.
      
      A previous attempt to add all CI related tests ended up
      with a failure on CI only (see #318)
      
      --HG--
      branch : heptapod
      b9c26622dd30
    • Georges Racinet's avatar
      heptapod-ci: tests for Merge Request, Commit and Compare models · f802bb973cde
      Georges Racinet authored
      Running these tests that have just been fixed make the full run
      take a bit less than 6.5 minutes on my workstation (from about 5).
      
      --HG--
      branch : heptapod
      f802bb973cde
    • Georges Racinet's avatar
      Fixed RSpec tests for MergeRequest model · a08291771946
      Georges Racinet authored
      The fix is simply avoiding conversions from Git SHA to Mercurial
      for Git repositories. All repositories created by the upstream
      GitLab factories are and will stay Git ones.
      
      --HG--
      branch : heptapod
      a08291771946
    • Georges Racinet's avatar
      heptapod-ci: fixing Gitaly tests install · 5f6241ea5cfa
      Georges Racinet authored
      Unless in first job execution in this particular runner,
      the `tmp/tests/gitaly` directory was not empty at the time of
      `TestEnv.init`: it still had stale Unix Domain sockets, and
      this seems to prevent checkouting the sources and makes the
      whole build fail.
      
      We should also compare how aggressively Heptapod Runner does
      `hg clean` compared to `git clean`, there's maybe something to
      fix here.
      
      --HG--
      branch : heptapod
      5f6241ea5cfa
    • Georges Racinet's avatar
      heptapod-ci: attempt to use the cache · ed0725bcc9e3
      Georges Racinet authored
      See in particular the long comment about the key policy.
      
      We don't have a distributed (S3) setup at the moment on
      foss.h.n, but we have few runners and they are persistent.
      
      --HG--
      branch : heptapod
      ed0725bcc9e3
    • Georges Racinet's avatar
      heptapod-ci: added a debugging line · 2cf161723894
      Georges Racinet authored
      This will be useful for flakiness in `gitaly-test-build`.
      
      --HG--
      branch : heptapod
      2cf161723894
    • Georges Racinet's avatar
      A separate script to launch Heptapod sanctioned RSpec tests · ba0ff15fdf38
      Georges Racinet authored
      and of course we want to run it in the CI.
      
      This runs in about 5 minutes on my workstation in HDK context
      (hence with almost every dependency already provided).
      
      We'll add new test patterns to this list as we make them pass.
      Later on we'll probably want to split it, maybe run several jobs
      etc.
      
      --HG--
      branch : heptapod
      ba0ff15fdf38
    • Georges Racinet's avatar
      Very crude first CI setup for Heptapod Rails application · 7a407860a9a8
      Georges Racinet authored
      For the sake of demonstration, this just runs the RSpec
      tests for `Gitlab::Git::Repository`. We'll follow up with
      a bigger subset of all available RSpec tests.
      
      This reuses some of the very rich upstream setup and is
      for now vastly inefficient. Notably:
      
      - we don't cache the Gitaly and Workhorse builds. Upstream
        uses a separate job for that, of which we reused some parts.
      - we don't run tests in parallel.
      
      All of these have to be investigated separately, and may
      require some tweaking of foss.heptapod.net and/or creation of
      a base CI image for Heptapod (we have less moving parts than
      upstream, with notably the set of gems and Gitaly version that
      never changes in the `heptapod` and `heptapod-stable` branches).
      
      --HG--
      branch : heptapod
      7a407860a9a8
  7. 24 Jul, 2020 1 commit
  8. 17 Jul, 2020 3 commits
    • Georges Racinet's avatar
      housekeeping: running `hg recover` systematically · dae6e5ab4439
      Georges Racinet authored
      It's cheap and it can unblock a repo.
      
      --HG--
      branch : heptapod-stable
      dae6e5ab4439
    • Georges Racinet's avatar
      Started Mercurial specific housekeeping · a53cdbad8015
      Georges Racinet authored
      This performs the same optimization as after imports in the
      case of full_repack.
      
      We also introduce the new `gitlab:git:force_housekeeping`
      rake task both for functional tests and because it may turn
      useful on real installations.
      
      Everything is still called "git" because at this point it's much
      simpler to build onto existing infrastructure than to introduce
      Mercurial specific rake tasks, workers, etc.
      
      --HG--
      branch : heptapod-stable
      a53cdbad8015
    • Georges Racinet's avatar
      HGRC: new API call to reset to defaults · c27b05247bb6
      Georges Racinet authored
      With the change done for #300, we lost the ability
      to remove a setting entirely, which unless it's inherited
      from the group or present in the global HGRC means not to
      interfere with lower level settings.
      
      This introduces a new API call, `DELETE projects/:id/hgrc`
      that resets to the defaults:
      
      - inherit=true
      - no content in project-local HGRC file except audit
        comments
      
      --HG--
      branch : heptapod-stable
      c27b05247bb6
  9. 16 Jul, 2020 5 commits
    • Georges Racinet's avatar
      HgrcSetService: incrementality · 973bc757d9e3
      Georges Racinet authored
      Closes #300
      
      Thanks to the `local` option in `get_hg_heptapod_config` we
      can know the exact values in the local config (should be
      `hgrc.managed`, and if not, it's arguably a legitimate
      starting point) and repeat them for the new content of
      `hgrc.managed`.
      
      For `inherit`, we have to use the other method, and that
      allows us to repeat the value if not passed.
      
      What we lose here is the ability to erase a setting, since
      a nil value cannot be told apart from a value not passed in
      the API, but this is functionally a price we're willing to
      pay.
      
      --HG--
      branch : heptapod-stable
      973bc757d9e3
    • Georges Racinet's avatar
      HgrcSetService: fixing exception catching · be03c96f22e7
      Georges Racinet authored
      That exception was renamed along with the whole module.
      
      --HG--
      branch : heptapod-stable
      be03c96f22e7
    • Georges Racinet's avatar
      HgGitRepository#get_hg_heptapod_config can ignore global conf · 05ed90b0af75
      Georges Racinet authored
      This will be useful for an incremental approach of configuration
      setting, and spares us INI format parsing in Ruby (GitLab does not
      come with a gem for this).
      
      --HG--
      branch : heptapod-stable
      05ed90b0af75
    • Georges Racinet's avatar
      Repository model: using `delegate` · da933348c308
      Georges Racinet authored
      It's nicer than explicit forwarding in that it'd adapt to
      all argument passing explicitely.
      
      --HG--
      branch : heptapod-stable
      da933348c308
    • Georges Racinet's avatar
      HgGitRepository: make get_hg_heptapod_config work if empty · e70d3a5eb8d7
      Georges Racinet authored
      Because `hg config SECTION` exits with code 1 if no matching
      setting have been found, we previously had an error if this
      method (and the corresponding API endpoint) was called before
      any local setting is set in the `[heptapod]` section.
      
      This can be considered part of #299, too
      
      Also fixed the exception raising, Ruby has its quirks, not the
      same as Python's.
      
      --HG--
      branch : heptapod-stable
      e70d3a5eb8d7