1. 10 Nov, 2020 14 commits
  2. 09 Nov, 2020 6 commits
    • Georges Racinet's avatar
      HGitayRepository: fixing Diff invocations · 92500bee7f38
      Georges Racinet authored
      Although they go trough `gitaly_commit_client` they actually
      call the `DiffService`, not currently implemented by HGitaly at
      all (obscure generic NoMethod gRPC error, hard to track which
      caller it was).
      
      We need to
      
      - use @git_storage to call the regular Gitaly
      - convert SHAs to Git SHAs
      
      This gives us our first working Commit page in the Web UI, but only
      for Commits without parents. In the (frequent, yes) general case,
      we still need at least BatchByOids to display the Commit parents list
      (must go partly through Markdown rendering). This last part will be
      done after 0.17.0rc1
      
      --HG--
      branch : heptapod
      92500bee7f38
    • Georges Racinet's avatar
      Repository: SHA conversion with fallback · 2605fa2b1a16
      Georges Racinet authored
      This is so often needed that a separate method
      makes sense. Done at generic level for widest
      compat (only `HGitalyRepository` can return `nil`
      by the way).
      
      --HG--
      branch : heptapod
      2605fa2b1a16
    • Georges Racinet's avatar
      HGitalyRepository: fix cached_exists? and conversions for vcs-cloned · b188426a2147
      Georges Racinet authored
      The `#cached_exists` method can issue a Gitaly call. Of course if
      it's running for a temporary vcs-cloned as `GitalyCommitClient` uses,
      that makes for double VCS prefixing and it fails.
      
      We correct this, and hence its various conversion callers by
      subclassing and doing the right thing explicitely.
      
      --HG--
      branch : heptapod
      b188426a2147
    • Georges Racinet's avatar
      HgitalyRepository: Rspec tests for LastCommitForPath · 8984da88030f
      Georges Racinet authored
      As usual, we're only testing our interpretation of the
      protocol. That extends to what to do if file is not
      present in revision, and if one must match directories, but
      not to actual algorithmic correctness.
      
      --HG--
      branch : heptapod
      8984da88030f
    • Georges Racinet's avatar
      Application Settings: fixing enabled VCS types · 942216da861c
      Georges Racinet authored
      The `.map` has been lost during rename.
      
      --HG--
      branch : heptapod
      942216da861c
    • Georges Racinet's avatar
      Blob,Tree: incoming "sha" can be any revision · a3ed118369a6
      Georges Racinet authored
      That wasn't obvious from the naming, but basic actual browsing
      in the UI failed because these could be just 'branch/default'
      
      --HG--
      branch : heptapod
      a3ed118369a6
  3. 08 Nov, 2020 4 commits
    • Georges Racinet's avatar
      HGitalyRepository: Git-based list_last_commit_for_tree · e77cd6a5f21f
      Georges Racinet authored
      Arguably, this method has nothing to do with Trees – it
      uses paths, not actual Git Tree objects and could therefore
      be implemented directly in HGitaly.
      
      To be frank, if we had come to that conclusion earlier we
      probably would have made it that way, but now that this code
      is there, we can as well turn to other pressing matters.
      
      A consequence is the `hpd_back_convert!` method, but it could
      turn out to be useful for something else. Of course, like its
      cousins in the `Tree` and `Blob` class, we'd prefer not to
      need it at all.
      
      --HG--
      branch : heptapod
      e77cd6a5f21f
    • Georges Racinet's avatar
      Tree: transitional implementation for Mercurial native repo · e77d525616cd
      Georges Racinet authored
      Similar to what's been done previously for Blob, we switch back
      to Git mode and the point is the the Tree OID is the Git one,
      while the corresponding Commit ID is the Mercurial one.
      
      --HG--
      branch : heptapod
      e77d525616cd
    • Georges Racinet's avatar
      Blob: transitional implementation for native Mercurial repos · 6db10a1faece
      Georges Racinet authored
      Git blobs are typically addressed by their OID, meaning that
      we only have to address the few methods that allow to find that
      OID from a Commit and a relative path.
      
      For example, `Gitlab::Workhorse` returns a special payload including
      the blob OID to the Workhorse server in front of the Rails app,
      allowing it to serve the full blob content directly from Gitaly.
      
      We are systematically calling `gitsha_from_sha` and its converse
      here, hoping it won't be too much of an overhead.
      
      The changes to the `Blob` method are tested through methods of
      `Repository` (inherited by `HgitalyRepository`) that in turn call
      them. Comparison with the case of `HgGitRepository` is provided
      for reference.
      
      --HG--
      branch : heptapod
      6db10a1faece
    • Georges Racinet's avatar
      Repository classes: gitsha methods, preparing for HGitaly1 · 312149ad6346
      Georges Racinet authored
      For the integration of native Mercurial repositories to reach
      milestone HGitaly1 (mixed mode still relying on Git conversion for
      some data access), we will need to be able to convert internally
      to Git SHAs. Of course, this conversion is trivial for
      `Git::Repository` and `Mercurial::HgGitRepository`.
      
      Various classes in the `Gitlab::Git` module will make use of
      these methods, `Blob` and `Tree` being the first to come to mind.
      
      --HG--
      branch : heptapod
      312149ad6346
  4. 04 Nov, 2020 1 commit
  5. 03 Nov, 2020 3 commits
  6. 02 Nov, 2020 3 commits
  7. 07 Nov, 2020 5 commits
    • Georges Racinet's avatar
      multi-vcs: restrict Project creation Web UI according to app setting · 1c314c133569
      Georges Racinet authored
      In the helper, we're now making the distinction between all
      possible values and those that are enabled in the application settings.
      
      In the default value, we're in particular treating the corner case
      where the library-level default is not allowed by Application Settings.
      It is not expected with the current possible values to happen often,
      but one may even imagine people restricting to Git as part as a
      transition plan from upstream GitLab CE to Heptapod.
      
      We don't want to do the same for the API, because the default
      is quite arbitrary in that case, and it's not guaranteed a
      human being would be witnessing its value.
      
      --HG--
      branch : heptapod
      1c314c133569
    • Georges Racinet's avatar
      multi-vcs: validate Project vcs_type against Application Settings · e90fbe3ee00f
      Georges Racinet authored
      Now that we have the `vcs_types` Application Settings field,
      we use it to enforce upon Project creation that the selected
      `vcs_type` is among them.
      
      This validation has to be done by a separate method in order
      to access the `CurrentSettings` object.
      
      Also, we've considered making the default value for `vcs_type` in
      `CreateService` not to be the library-level default, so that
      explicitely passing a value is never required, even in the case where
      the library default is not allowed by Application Settings, but
      finally decided that failing with an explicit message in that case
      was better than such magic. Note also that the Web UI will always
      pass a value, so this case is in practice for API calls only.
      
      --HG--
      branch : heptapod
      e90fbe3ee00f
    • Georges Racinet's avatar
      multi-vcs: centralizing the default VCS type · e6e8952549c8
      Georges Racinet authored
      it's obviously bad to have a magic constant in the service,
      given that we already have one in `Gitlab::VCS`.
      
      --HG--
      branch : heptapod
      e6e8952549c8
    • Georges Racinet's avatar
      multi-vcs: application settings panel to set VCS types on new projects · dfa98ee0aa7a
      Georges Racinet authored
      This allows to fill in the new `vcs_types` field.
      
      --HG--
      branch : heptapod
      dfa98ee0aa7a
    • Georges Racinet's avatar
      Abiding to some Rubocop rules · 601956cea856
      Georges Racinet authored
      I'm especially not happy with the trailing comma rule in
      Hashes, but doing it anyway.
      
      --HG--
      branch : heptapod
      601956cea856
  8. 05 Nov, 2020 1 commit
  9. 08 Nov, 2020 3 commits