1. 27 Aug, 2020 1 commit
    • Georges Racinet on mutations.racinet.fr's avatar
      HgGitRepository: attribute to skip Git hooks for tests · db821ec4ea3f
      This new attribute is not meant to be used in any other context
      than RSpec tests, whence the name. It allows us to use higher
      level methods such as `multi_action` in tests setups and will be
      necessary to test them.
      Upstream does something similar with no need to involve the tested code:
      they launch Gitaly server with the `GITALY_TESTING_NO_GIT_HOOKS` environment
      branch : heptapod
  2. 26 Aug, 2020 3 commits
  3. 25 Aug, 2020 4 commits
  4. 24 Aug, 2020 6 commits
    • Georges Racinet's avatar
      Unauthorized commit creation from Web UI: user feedback · d6cf46bd51c4
      Georges Racinet authored
      As already stated, it would be nicer not to display file edit
      buttons if the user actually can't create a commit in the given
      branch, but at least this gives a proper 403 page and gives users
      a proper explanation.
      branch : heptapod-stable
    • Georges Racinet's avatar
      Repository Files API: proper treatment for ForbiddenError · 7f9b4f78a549
      Georges Racinet authored
      In a previous commit, we had the Repository model raise ForbiddenError
      in case the given action entails creating a public changeset, this
      turns it in the proper HTTP 403 response.
      branch : heptapod-stable
    • Georges Racinet's avatar
      Repository files (multi_action): check publisher permission · e029134a44f0
      Georges Racinet authored
      This is a variant of #332 for multi_action.
      As with the case of merge requests, the check should also be
      performed at low level by Mercurial, but doing it at the model
      level makes for early failure, avoiding atomicity issues.
      A difference with MRs is that we don't have a simple way *not* to
      propose the action to the user yet, because higher layers are more
      complicated and don't involve checks, since they are meant to produce
      forks for users without write permission.
      This currently provides 500 errors, but at least it closes the
      security problem, and we can later on add the necessary catching.
      We didn't want to affect Wikis, because for them, allowing publication
      for Developers is pretty normal.
      branch : heptapod-stable
    • Georges Racinet's avatar
      HgGitRepository: split out hg_config_item_bool? method · ff5823e89d14
      Georges Racinet authored
      This is just cleaner and prone to reuse.
      branch : heptapod-stable
    • Georges Racinet's avatar
      Merge Requests: only publishers are allowed to merge · 7ef09f4b1371
      Georges Racinet authored
      Part of #332
      This is to be understood as somewhat temporary,
      making sense only because currently merges from the Rails app always
      involve publishing, which can change for various reasons.
      It has the following advantages:
      - merge button will be disabled for ordinary Developers, hence
        avoiding obscure error message
      - in case users find their way to click the button anyway (or
        just use the API), this fails early, whereas only enforcing
        the publishing permission in Mercurial itself would only refuse
        the phase change, meaning that a draft merge commit could still have
        been created.
      branch : heptapod-stable
    • Georges Racinet's avatar
      UserAccess: new hg_can_publish? method · 6e3752b4f72c
      Georges Racinet authored
      It will be used from now on to centralize that question.
      Refraining to change the caller in `HgAccess` in the stable
      branch, but it should be done ASAP in the `heptapod` branch
      branch : heptapod-stable
  5. 22 Aug, 2020 2 commits
  6. 04 Aug, 2020 1 commit
  7. 03 Aug, 2020 1 commit
    • Georges Racinet's avatar
      Operations: port over HGRC files from main repo to share · db7ee4fbacad
      Georges Racinet authored
      Closes #324
      The specific repo configuration was ignored in all Mercurial
      operations initiated by the Rails app.
      I've considered making links instead of copying the file, but
      it could give rise to funny situations if the original HGRC
      files get changed in concurrency with some operation.
      Edition of the HGRC files is by no means atomic in itself,
      but that's a separate issue. On the other hand, operations can be
      arbitrary long, involving several calls to the `hg` executable.
      One would not want the rules to change in the middle of that.
      branch : heptapod
  8. 04 Aug, 2020 11 commits
  9. 31 Jul, 2020 2 commits
  10. 03 Aug, 2020 1 commit
    • Georges Racinet's avatar
      ui: hide "Web IDE" button from the directory view · 742ed75595d5
      Georges Racinet authored
      Because GitLab is very Git oriented, this is called a 'tree' view,
      but nevertheless, noticed while testing previous commit that this
      one was still there, and even proposing a fork to people not
      having direct commit rights.
      branch : heptapod
  11. 31 Jul, 2020 2 commits
    • Raphaël Gomès's avatar
      ui: hide "Web IDE" button from the web UI · 01e67b976a63
      Raphaël Gomès authored
      The Web IDE is not yet supported on Heptapod (see issue #285).
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly test setup: listening at configured address · be29b013ca96
      Georges Racinet authored
      With the existing RSpec tests calling that address, this
      makes it possible to use another address than the default
      Next move will be to always configure the test environment
      differently than the development one in the HDK, so that
      developers don't need to shut their main HGitaly
      server down to run the tests.
      branch : heptapod
  12. 29 Jul, 2020 5 commits
    • Georges Racinet's avatar
      HGitaly: Rspec test for the connection · 54beeb896034
      Georges Racinet authored
      This validates that our testing harness is functional.
      We're using a `HgGitRepository` but it doesn't matter and
      as long as it's in the code base, it's even better for this
      low level not to depend on the future `HGitalyRepository`.
      Even if the test is pretty trivial, it's also interesting to
      be able to add uncommitted tests in there for low overhead
      debugging purposes.
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly: introducing the `hgitaly_adress` storage setting · 71a92071a33f
      Georges Racinet authored
      We give it for now a default value, because that simplifies
      our scaffolding a lot for this initial development.
      Eventually, it should become as explicit and often Unix Domain
      socket oriented as `gitaly_address` is.
      branch : heptapod
    • Georges Racinet's avatar
      HGitaly: starting the server from RSpec tests · 8983ca3d188a
      Georges Racinet authored
      All the configuration is passed on the command line, so we
      don't need anything in CI's test.hgrc.
      A key difference with the Gitaly setup is that we don't install
      HGitaly: we assume it's installed already, whether that's manually,
      by the CI or by the HDK. That's good enough for now. Besides, when
      it's released on PyPI, we'll put it in `python/requirements`, which
      will bring at least a base version (and the possibility to test
      against the latest released HGitaly instead of the current dev
      Later on, when we'll have Unix Domain sockets, it'll make sense to
      make a temporary directory, same as the Gitaly service for tests.
      branch : heptapod
    • Georges Racinet's avatar
      Mercurial housekeeping: removed hg_optim · 8ecbb2ee6900
      Georges Racinet authored
      The `debugupgraderepo` command it does is way too deep and
      can take hours on larger repos. It makes sense for initial
      imports only.
      Closes #320 (see more details there)
      branch : heptapod-stable
    • Georges Racinet's avatar
      hgignore: ignoring more generated files · f94309ab70b4
      Georges Racinet authored
      frontend assets and files generated by unit and functional tests
      in HDK context.
      branch : heptapod-stable
  13. 27 Jul, 2020 1 commit