Commit Graph

62 Commits

Author SHA1 Message Date
Zeger-Jan van de Weg 417a21a123
Raw diffs are served from Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/222
2018-06-22 13:40:38 +02:00
Jacob Vosmaer e7ef91339e Simplify server feature flags 2018-06-06 11:20:41 +02:00
Zeger-Jan van de Weg f131757fc8 Set Gitaly Server feature flags from Rails
Gitaly itself hold very little state, other than the data on disk. This
limits the interfaces to set feature flags. Gitaly now has the ability
to interpret the request metadata to check for feature flags.
https://gitlab.com/gitlab-org/gitaly/merge_requests/704
This allows clients control on the Gitaly server, and given that Rails
has an internal chatops interface to set these values this was chosen as
solution.

Known limitation right now, is that this package doesn't support the opt
out that other Gitaly features do.
2018-06-06 11:20:41 +02:00
Ahmad Sherif 019f5e2469 Add handling for commit/tags with big messages 2018-05-18 20:51:10 +02:00
Zeger-Jan van de Weg dfdd881510
Workhorse to send raw diff and patch for commits
Prior to this change, this was done through unicorn. In theory this
could time out. Workhorse has been sending these raw patches and diffs
for a long time and is stable in doing so.

Added bonus is the fact that `Commit#to_patch` can be removed.

`Commit#to_diff` too, which closes
https://gitlab.com/gitlab-org/gitaly/issues/324

Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
2018-05-16 11:52:43 +02:00
Zeger-Jan van de Weg e02f1271f5
Return nil on empty path
The execution path wasn't clear from the error, but either way this is a
fix.

Closes gitlab-org/gitaly#1115
2018-04-17 16:30:18 +02:00
Zeger-Jan van de Weg 2ba0118505
Move ListCommitsByOid to OPT_OUT
Acceptence testing was successfull in
[#844](https://gitlab.com/gitlab-org/gitaly/issues/844)

Part of gitlab-org/gitaly#670
2018-04-04 16:41:43 +02:00
Zeger-Jan van de Weg 635d5bf2a2
Move CommitService::CommitPatch to OPT_OUT
Part of gitlab-org/gitaly#324
2018-03-07 14:52:56 +01:00
Ahmad Sherif 03f3350f3f Fetch commit signatures from Gitaly in batches
Closes gitaly#1046
2018-03-01 18:31:31 +01:00
Sean McGivern 23dd313d76 Convert Gitaly commit parent IDs to array as early as possible
The tracking issue if this causes problems is
https://gitlab.com/gitlab-org/gitaly/issues/1028
2018-02-19 11:21:23 +00:00
Micaël Bergeron af5cd10e00 applying feedback
#	modified:   lib/gitlab/git/commit.rb
2018-02-16 13:51:19 -05:00
Micaël Bergeron f949255461 fix specs 2018-02-16 13:51:19 -05:00
Zeger-Jan van de Weg 73e78c4e15
Don't use rugged in Repository#refs_hash
The refs hash is used to determine what branches and tags have a commit
as head in the network graph. The previous implementation depended on
Rugged#references. The problem with this implementation was that it
depended on rugged, but also that it iterated over all references and
thus loading more data than needed if for example the project uses CI/CD
environments, Pipelines, or Merge Requests.

Given only refs are checked the network cares about the GraphHelper#refs
method has no need to reject those, simplifying the method.

Closes gitlab-org/gitaly#880
2018-02-07 15:07:03 +01:00
Jacob Vosmaer (GitLab) 4d87f3bb37 Retrieve commit signatures with Gitaly 2018-01-18 14:10:17 +00:00
Ahmad Sherif f32f04a50f Migrate Commit#uri_type to Gitaly
Closes gitaly#915
2018-01-15 14:16:22 +01:00
Jacob Vosmaer ac2cb65ab3 Remove the Commit#tree method 2018-01-04 18:00:28 +01:00
Zeger-Jan van de Weg c6edae3887
Load commit in batches for pipelines#index
Uses `list_commits_by_oid` on the CommitService, to request the needed
commits for pipelines. These commits are needed to display the user that
created the commit and the commit title.

This includes fixes for tests failing that depended on the commit
being `nil`. However, now these are batch loaded, this doesn't happen
anymore and the commits are an instance of BatchLoader.
2017-12-19 10:05:40 +01:00
micael.bergeron cb6f51ec9b add support for the commit reference filter 2017-12-07 09:01:37 -05:00
Kim "BKC" Carlbäcker 49dd62ada1 Migrate Gitlab::Git::Commit.shas_with_signatures
- Added tests for Git::Commit.shas_with_signatures
2017-12-05 14:43:46 +01:00
Ahmad Sherif 8be9567c64 Migrate Gitlab::Git::Repository#cherry_pick to Gitaly
Closes gitaly#737
2017-12-04 19:21:07 +01:00
Alejandro Rodríguez 37cc50f843 Incorporate Gitaly's OperationService.UserFFBranch RPC 2017-10-31 16:28:09 -03:00
Zeger-Jan van de Weg 3411fef1df
Cache commits on the repository model
Now, when requesting a commit from the Repository model, the results are
not cached. This means we're fetching the same commit by oid multiple times
during the same request. To prevent us from doing this, we now cache
results. Caching is done only based on object id (aka SHA).

Given we cache on the Repository model, results are scoped to the
associated project, eventhough the change of two repositories having the
same oids for different commits is small.
2017-10-27 12:49:11 +02:00
Jacob Vosmaer (GitLab) 75509fac17 Prepare cherry-pick and revert for migration to Gitaly 2017-09-19 17:09:10 +00:00
Kim "BKC" Carlbäcker 25c34608b9 Migrate Git::CommitStats to Gitaly 2017-09-11 21:00:58 +02:00
Alejandro Rodríguez 258d5a50e6 Incorporate DiffService.CommitPatch Gitaly RPC 2017-08-22 16:31:59 -03:00
Douwe Maan ba7251fefd Only create commit GPG signature when necessary 2017-08-16 18:57:50 +02:00
Brian Neel 9770c57fab Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04: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
Jacob Vosmaer 29a07fd3a1 Rename 'commits_between' to 'rugged_commits_between' 2017-08-03 15:48:10 +02:00
Alexis Reigel a01eabc19f update rugged
the rugged versions up to 0.26.0b3 had a bug concerning the signature
extraction. The extracted signature was not always the same, probably
due to a buffer (overflow) issue in libgit.

see https://github.com/libgit2/rugged/issues/608
2017-07-27 15:43:36 +02:00
Alexis Reigel 28bb5e3d53 commit signature with spec 2017-07-27 15:40:40 +02:00
Kevin O'Connor 817d9558fe Prototype key verification 2017-07-27 15:40:40 +02:00
Ahmad Sherif b043100b65 Migrate Gitlab::Git::Commit.find_all to Gitaly
Closes gitaly#396
2017-07-20 22:03:55 +02:00
Alejandro Rodríguez 25b01b4c85 Incorporate Gitaly's Commits#between RPC 2017-07-18 16:20:27 -04:00
Alejandro Rodríguez 90f8feae46 Adapt to new Gitaly commit message format 2017-07-18 16:11:44 -04:00
Jacob Vosmaer b2ecf0aa35 Change Git::Repository#log to return Commits 2017-07-13 14:54:21 +02:00
Jacob Vosmaer 47c844bf34 Add Gitaly notes and annotations to Gitlab::Git 2017-07-12 17:06:31 +02:00
Jacob Vosmaer 43c3a65062 Remove 'contains' option from Commit.find_all 2017-06-27 12:38:58 +02:00
Jacob Vosmaer 144e37c667 Remove Gitlab::Git::Repository#find_all 2017-06-27 12:30:51 +02:00
Jacob Vosmaer 2bad43f5ee Remove unused Gitlab::Git::Commit#to_diff argument 2017-06-26 18:50:26 +02:00
Jacob Vosmaer d66d126382 Remove unused attr_accessor from Gitlab::Git::Commit 2017-06-20 17:20:02 +02:00
Bob Van Landuyt e564fe971f Rename `Gitlab::Git::EncodingHelper` to `Gitlab::EncodingHelper` 2017-06-01 21:21:14 +00:00
Alejandro Rodríguez 925945f01b Incorporate Gitaly's local_branches operation into repo code 2017-05-17 18:12:10 -04:00
Alejandro Rodríguez 71569a9c41 Compare ids of commits if present for equality test
This solves a problem where commits populated with Gitaly were not equal
to commits populated with Rugged. This is because Gitaly may not return
all fields of a commit for optimizations purposes, which resulted in
false negatives when comparing the same commit (commits with the same
sha) with different sources.
2017-05-16 20:54:45 -04:00
Jacob Vosmaer 48254d187f Don't use DiffCollection for deltas 2017-05-09 12:27:17 +02:00
Douwe Maan b3ff48c9a1 Move up delegate calls 2017-02-23 09:32:42 -06:00
Douwe Maan 75f5fa997d Enable Rails/Delegate 2017-02-23 09:32:42 -06:00
Robert Speicher 2e20a71d21 Ensure internal Gitlab::Git references use the namespace 2017-01-04 19:09:29 -05:00