Commit Graph

22 Commits

Author SHA1 Message Date
Stan Hu db759c5d9c Allow ref name caching CommitService#find_commit
For a given merge request, it's quite common to see duplicate FindCommit
Gitaly requests because the Gitaly CommitService caches the request by
the commit SHA, not by the ref name. However, most of the duplicate
requests use the ref name, so the cache is never actually used in
practice. This leads to unnecessary requests that slow performance.

This commit allows certain callers to bypass the ref name to
OID conversion in the cache. We don't do this by default because it's
possible the tip of the branch changes during the commit, which
would cause the caller to get stale data.

This commit also forces the Ci::Pipeline to use the full ref name
so that caching can work for merge requests.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57083
2019-03-27 14:46:39 -05:00
Oswaldo Ferreira c9d6c02f15 Add Gitaly diff stats RPC client
This adds a basic interface to fetch diff statistics given two SHAs.
It's a requirement for #49399 #20282 and #19232.
2018-09-17 12:27:01 -03:00
Oswaldo Ferreira 965ff14b6f Send max_patch_bytes to Gitaly via Gitaly::CommitDiffRequest
We used to apply this limitation on GitLab when using Rugged. Now that
we've shifted to Gitaly, this parameter needs to be sent via a RPC
request. Currently this value is hardcoded on Gitaly.
2018-09-06 19:18:27 -03:00
Sean McGivern 2c2422d54e Fix MR diffs created with gitaly_diff_between enabled
When we save merge request diffs to the database, we need to expand the diff
before doing so. That's so that we can expand diffs (within the normal limits)
without hitting the repository, but just by going to the database.

This is done implicitly - diffs are expanded unless we say otherwise. However,
we have another option we can pass, that lets us enforce diff size limits, that
defaults to true.

Prior to this commit:

- The Rugged code path defaulted to setting `expanded: true` and
  `enforce_limits: true`.
- The Gitaly code path defaulted to setting `expanded: false` and
  `enforce_limits: true`.

This was introduced by eb36fa17a6, which
implemented the initial feature. Since then, if the `gitaly_diff_between`
feature flag was enabled, MRs would have diffs that could not be expanded in
some cases, with no fix other than to disable the feature flag and force push to
the MR to refresh the diff in the database.
2018-06-29 14:25:35 +01:00
Rubén Dávila d28b1dfc46 Backport of EE !4989 2018-04-11 22:05:07 -05:00
Ahmad Sherif c370f53cb6 Migrate recursive tree entries fetching to Gitaly 2018-02-26 16:59:29 +01:00
Ahmad Sherif cf25ef38d2 Cache Gitaly FindCommit RPC response 2018-02-07 17:02:34 +01:00
Lin Jen-Shin b33e7281ff Make sure we're passing ASCII-8BIT to Gitaly
when counting commit count.
2018-01-23 16:27:34 +08:00
Andrew Newdigate 27cc1c2b28 Fix for Gitaly nil encoding issue 2017-10-03 08:03:19 +00:00
Ahmad Sherif 28d95e10a4 Encode paths properly for Gitaly Commit{Diff,Delta}
Fixes gitaly#589
2017-09-19 13:35:22 +02:00
Kim "BKC" Carlbäcker 25c34608b9 Migrate Git::CommitStats to Gitaly 2017-09-11 21:00:58 +02:00
Sean McGivern d546f7d36e Merge branch 'gitaly-commit-patch' into 'master'
Incorporate DiffService.CommitPatch Gitaly RPC

Closes gitaly#463

See merge request !13441
2017-08-23 10:39:01 +00:00
Alejandro Rodríguez 258d5a50e6 Incorporate DiffService.CommitPatch Gitaly RPC 2017-08-22 16:31:59 -03:00
Alejandro Rodríguez b7ebb447d7 Correctly encode string params for Gitaly's TreeEntries RPC 2017-08-21 15:13:40 -03:00
Alejandro Rodríguez 3ce6f03f14 Incorporate Gitaly's CommitService.FindCommit RPC 2017-08-07 23:33:43 -04:00
Alejandro Rodríguez e363fbf71a Move `deltas` and `diff_from_parents` logic to Gitlab::Git::Commit
This helps keep the abstraction layers simpler, and also keep the
interface of those methods consistent, in case of implementation
changes.
2017-08-07 23:33:40 -04:00
Alejandro Rodríguez c21ae07e33 Refactor Gitlab::Git::Commit to include a repository 2017-08-07 22:34:34 -04:00
Gabriel Mazetto fb06a4d8fe Rename more path_with_namespace -> full_path or disk_path 2017-08-01 07:28:13 +02:00
Alejandro Rodríguez 9eb5cdd73f Incorporate CommitService.GetTreeEntries Gitaly call 2017-07-20 12:47:00 -04:00
Ahmad Sherif ef2b81adb4 Migrate DiffCollection limiting logic to Gitaly 2017-07-19 18:05:22 +02:00
Alejandro Rodríguez 25b01b4c85 Incorporate Gitaly's Commits#between RPC 2017-07-18 16:20:27 -04:00
Andrew Newdigate a89f18bf2c Renamed Gitaly services 2017-07-18 07:59:36 +00:00